@huntflow/ui 0.0.48 → 0.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ui.es.js CHANGED
@@ -1,36 +1,54 @@
1
- (function(){"use strict";var e;try{if(typeof document<"u"){var o=document.createElement("style");o.nonce=(e=document.head.querySelector("meta[property=csp-nonce]"))==null?void 0:e.content,o.appendChild(document.createTextNode('._button_1ey6t_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_1ey6t_1 ._contentWrapper_1ey6t_13{display:flex;align-items:center}._button_1ey6t_1:focus{outline:none}._primary_1ey6t_23{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_1ey6t_23:hover{background-color:var(--hf-button-primary-hover-background-color)}._primary_1ey6t_23:focus{box-shadow:0 0 0 3px var(--hf-button-primary-focus-color)}._primary_1ey6t_23._bordered_1ey6t_38{background-color:#fff;color:var(--hf-button-primary-background-color);border:1px solid var(--hf-button-primary-background-color)}._danger_1ey6t_44{color:var(--hf-button-danger-text-color);border:1px solid var(--hf-button-danger-background-color);background-color:var(--hf-button-danger-background-color)}._danger_1ey6t_44:hover{background-color:var(--hf-button-danger-hover-background-color)}._danger_1ey6t_44:focus{box-shadow:0 0 0 3px var(--hf-button-danger-focus-color)}._danger_1ey6t_44._bordered_1ey6t_38{background-color:#fff;color:var(--hf-button-danger-background-color);border:1px solid var(--hf-button-danger-background-color)}._default_1ey6t_64{background-color:#fff;color:var(--hf-button-default-text-color);border:1px solid var(--hf-button-default-border-color)}._default_1ey6t_64:hover{background-color:var(--hf-button-default-hover-background-color)}._default_1ey6t_64:focus{box-shadow:0 0 0 3px var(--hf-button-default-focus-color)}._link_1ey6t_78{background-color:#fff;color:#007bff;text-decoration:underline}._block_1ey6t_84{width:100%}._disabled_1ey6t_88{background-color:#e9ecef;color:#6c757d;cursor:not-allowed}._disabled_1ey6t_88:hover{background-color:inherit}._loading_1ey6t_98{cursor:wait}._loading_1ey6t_98 ._content_1ey6t_13{visibility:hidden}._circle_1ey6t_106{border-radius:100%;padding:0!important}._bordered_1ey6t_38{border:1px solid currentColor}._icon_1ey6t_115{display:flex;align-items:center}._iconLeft_1ey6t_120{margin-right:8px}._iconRight_1ey6t_124{margin-left:8px}._xs_1ey6t_128{padding:4px 8px;font-size:12px}._s_1ey6t_133{padding:6px 12px;font-size:14px;line-height:20px}._m_1ey6t_139{padding:6px 12px;font-size:15px;line-height:24px}._l_1ey6t_78{padding:16px 32px;font-size:18px}._xl_1ey6t_150{padding:20px 40px;font-size:20px}._loadingWrapper_1ey6t_155{width:100%;height:100%;position:absolute;left:0;right:0;display:flex;align-items:center;justify-content:center}._loadingWrapper_1ey6t_155 ._spinner_1ey6t_166{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_1ey6t_166 .6s linear infinite}@keyframes _spin_1ey6t_166{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)}}._label_jcdiv_1{display:flex;align-items:center;gap:8px;height:20px}._label_jcdiv_1._disabled_jcdiv_7{color:gray;cursor:not-allowed}._label_jcdiv_1 span{margin-top:-5px}._input_jcdiv_17[type=checkbox]{vertical-align:-2px;margin:0;border-radius:4px;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;width:16px;height:16px;border:1px solid #25CFE8;transform:translateY(-.075em);display:grid;place-content:center}._input_jcdiv_17._error_jcdiv_30[type=checkbox]{border:1px solid #FF0000}._input_jcdiv_17[type=checkbox]:before{content:"";width:16px;height:16px;clip-path:polygon(0 0,50% 0,100% 0,100% 100%,50% 100%,0 100%);transform:scale(0);transform-origin:bottom left;transition:.12s transform ease-in-out;background-color:#25cfe8;border-radius:4px}._input_jcdiv_17[type=checkbox]:checked:before{transform:scale(1)}._input_jcdiv_17[type=checkbox]:focus{outline:2px solid #C4EDFA}._input_jcdiv_17._error_jcdiv_30[type=checkbox]:focus{outline:2px solid #FFD6D6}._input_jcdiv_17[type=checkbox]:disabled{border-color:#00000029;opacity:30%;color:#000;cursor:not-allowed}._text_jcdiv_70{-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:15px;line-height:20px}._errorText_jcdiv_76{color:red;font-size:12px}._icon_1p8iz_2{font-style:normal;display:inline-block;vertical-align:middle}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
- import { defineComponent as v, computed as b, openBlock as c, createElementBlock as d, normalizeClass as o, unref as a, createElementVNode as u, createCommentVNode as _, renderSlot as m, mergeModels as h, useModel as B, toDisplayString as g, withDirectives as x, vModelDynamic as E, vModelCheckbox as T, normalizeStyle as w } from "vue";
3
- const z = "_button_1ey6t_1", M = "_contentWrapper_1ey6t_13", N = "_primary_1ey6t_23", W = "_bordered_1ey6t_38", j = "_danger_1ey6t_44", L = "_link_1ey6t_78", R = "_block_1ey6t_84", S = "_disabled_1ey6t_88", V = "_loading_1ey6t_98", D = "_content_1ey6t_13", U = "_circle_1ey6t_106", A = "_icon_1ey6t_115", K = "_iconLeft_1ey6t_120", O = "_iconRight_1ey6t_124", P = "_xs_1ey6t_128", q = "_s_1ey6t_133", F = "_m_1ey6t_139", G = "_l_1ey6t_78", H = "_xl_1ey6t_150", J = "_loadingWrapper_1ey6t_155", Q = "_spinner_1ey6t_166", X = "_spin_1ey6t_166", r = {
4
- button: z,
5
- contentWrapper: M,
6
- primary: N,
7
- bordered: W,
8
- danger: j,
9
- default: "_default_1ey6t_64",
10
- link: L,
11
- block: R,
12
- disabled: S,
13
- loading: V,
14
- content: D,
15
- circle: U,
16
- icon: A,
17
- iconLeft: K,
18
- iconRight: O,
19
- xs: P,
20
- s: q,
21
- m: F,
22
- l: G,
23
- xl: H,
24
- loadingWrapper: J,
25
- spinner: Q,
26
- spin: X
27
- }, Y = ["name", "type", "disabled"], je = /* @__PURE__ */ v({
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_1syl2_1{position:relative;display:inline-flex;align-items:center;justify-content:center;border:solid 1px;cursor:pointer;font-family:var(--hf-font-family-body);font-style:normal;min-width:-moz-max-content;min-width:max-content;text-decoration:none;color:inherit;gap:4px}._button_1syl2_1:active{background-color:#999}._button_1syl2_1:focus{outline:none}._button_1syl2_1:focus-visible{outline:solid 3px var(--hf-color-button-disable-default)}._button_1syl2_1:is(._disabled_1syl2_1),._button_1syl2_1:is(._disabled_1syl2_1):hover{background:var(--hf-color-button-disable-default);border-color:transparent;color:var(--hf-color-text-light);box-shadow:none;transform:none;cursor:default}._button_1syl2_1._loading_1syl2_1>*:not(._loader_1syl2_1){visibility:hidden}._content_1syl2_1{display:flex;line-height:inherit}._content_1syl2_1:first-child:last-child{width:100%;text-align:center}._loader_1syl2_1{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center}._s_1syl2_2{border-radius:var(--hf-radius-button-s);font-size:var(--hf-font-size-button-s);font-weight:var(--hf-font-weight-button-s);line-height:var(--hf-font-line-height-button-s);padding:var(--hf-padding-button-top-bottom-s) var(--hf-padding-button-left-right-s)}._xs_1syl2_1{font-size:var(--hf-font-size-button-xs);font-weight:var(--hf-font-weight-button-xs);line-height:var(--hf-font-line-height-button-xs);padding:var(--hf-padding-button-top-bottom-xs) var(--hf-padding-button-left-right-xs)}._xs_1syl2_1._square_1syl2_1{border-radius:var(--hf-radius-button-xs)}._xs_1syl2_1._circle_1syl2_1{border-radius:var(--hf-radius-button-circle)}._m_1syl2_1{border-radius:var(--hf-radius-button-m);font-size:var(--hf-font-size-button-m);font-weight:var(--hf-font-weight-button-m);line-height:var(--hf-font-line-height-button-m);padding:var(--hf-padding-button-top-bottom-m) var(--hf-padding-button-left-right-m)}._l_1syl2_1{border-radius:var(--hf-radius-button-l);font-size:var(--hf-font-size-button-l);font-weight:var(--hf-font-weight-button-l);line-height:var(--hf-font-line-height-button-l);padding:var(--hf-padding-button-top-bottom-l) var(--hf-padding-button-left-right-l)}._primary_1syl2_1{color:var(--hf-color-text-invert);background-color:var(--hf-color-button-primary-default);border-color:var(--hf-color-button-primary-default)}._primary_1syl2_1:hover{background-color:var(--hf-color-button-primary-hover);border-color:var(--hf-color-button-primary-hover)}._primary_1syl2_1:active{background-color:var(--hf-color-button-primary-active);border-color:var(--hf-color-button-primary-active)}._secondary_1syl2_1{color:var(--hf-color-text-main);background-color:var(--hf-color-button-secondary-fill-default);border-color:var(--hf-color-button-secondary-border-default);box-shadow:0 1px 4px #0505050a}._secondary_1syl2_1:hover{background-color:var(--hf-color-button-secondary-fill-hover);border-color:var(--hf-color-button-secondary-fill-hover)}._secondary_1syl2_1:active{background-color:var(--hf-color-button-secondary-fill-active);border-color:var(--hf-color-button-secondary-fill-active)}._accent_1syl2_1{color:var(--hf-color-text-invert);background-color:var(--hf-color-button-accent-default);border-color:var(--hf-color-button-accent-default)}._accent_1syl2_1:hover{background-color:var(--hf-color-button-accent-hover);border-color:var(--hf-color-button-accent-hover)}._accent_1syl2_1:active{background-color:var(--hf-color-button-accent-active);border-color:var(--hf-color-button-accent-active)}._danger_1syl2_1{color:var(--hf-color-text-invert);background-color:var(--hf-color-button-danger-default);border-color:var(--hf-color-button-danger-default)}._danger_1syl2_1:hover{background-color:var(--hf-color-button-danger-hover);border-color:var(--hf-color-button-danger-hover)}._danger_1syl2_1:active{background-color:var(--hf-color-button-danger-active);border-color:var(--hf-color-button-danger-active)}._jobsites_1syl2_1{color:var(--hf-color-text-invert);background-color:var(--hf-color-button-jobsite-default);border-color:var(--hf-color-button-jobsite-default)}._jobsites_1syl2_1:hover{background-color:var(--hf-color-button-jobsite-hover);border-color:var(--hf-color-button-jobsite-hover)}._jobsites_1syl2_1:active{background-color:var(--hf-color-button-jobsite-active);border-color:var(--hf-color-button-jobsite-active)}._ghost_1syl2_1{color:var(--hf-color-text-main);background-color:transparent;border-color:transparent}._ghost_1syl2_1:hover{background-color:var(--hf-color-button-secondary-fill-hover)}._ghost_1syl2_1:active{background-color:var(--hf-color-button-secondary-fill-active)}._ghost-danger_1syl2_1{color:var(--hf-color-text-main);background-color:transparent;border-color:transparent}._ghost-danger_1syl2_1:hover{color:var(--hf-color-text-invert);background-color:var(--hf-color-button-danger-hover)}._ghost-danger_1syl2_1:active{color:var(--hf-color-text-invert);background-color:var(--hf-color-button-danger-active)}@keyframes _loader-animation_t6bg6_1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}._loader_t6bg6_10{display:block;color:var(--hf-loader-color);flex:0 0 auto}._circle_t6bg6_15{animation-name:_loader-animation_t6bg6_1;animation-iteration-count:infinite;animation-duration:1s;animation-timing-function:linear}._white_t6bg6_22{--hf-loader-color: var(--hf-color-text-invert)}._black_t6bg6_26{--hf-loader-color: var(--hf-color-text-main)}._s_t6bg6_30{width:18px;height:18px}._m_t6bg6_35{width:28px;height:28px}._l_t6bg6_10{width:56px;height:56px}._spinner_t6bg6_45{display:inline-block;border:1px solid var(--hf-loader-color);border-top-color:transparent;border-left-color:transparent;border-radius:50%}._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)}}._label_jcdiv_1{display:flex;align-items:center;gap:8px;height:20px}._label_jcdiv_1._disabled_jcdiv_7{color:gray;cursor:not-allowed}._label_jcdiv_1 span{margin-top:-5px}._input_jcdiv_17[type=checkbox]{vertical-align:-2px;margin:0;border-radius:4px;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;width:16px;height:16px;border:1px solid #25CFE8;transform:translateY(-.075em);display:grid;place-content:center}._input_jcdiv_17._error_jcdiv_30[type=checkbox]{border:1px solid #FF0000}._input_jcdiv_17[type=checkbox]:before{content:"";width:16px;height:16px;clip-path:polygon(0 0,50% 0,100% 0,100% 100%,50% 100%,0 100%);transform:scale(0);transform-origin:bottom left;transition:.12s transform ease-in-out;background-color:#25cfe8;border-radius:4px}._input_jcdiv_17[type=checkbox]:checked:before{transform:scale(1)}._input_jcdiv_17[type=checkbox]:focus{outline:2px solid #C4EDFA}._input_jcdiv_17._error_jcdiv_30[type=checkbox]:focus{outline:2px solid #FFD6D6}._input_jcdiv_17[type=checkbox]:disabled{border-color:#00000029;opacity:30%;color:#000;cursor:not-allowed}._text_jcdiv_70{-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:15px;line-height:20px}._errorText_jcdiv_76{color:red;font-size:12px}._icon_1p8iz_2{font-style:normal;display:inline-block;vertical-align:middle}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
+ import { defineComponent as $, computed as f, openBlock as i, createElementBlock as d, normalizeClass as r, unref as c, createVNode as j, createCommentVNode as u, renderSlot as y, createElementVNode as h, mergeModels as v, useModel as C, toDisplayString as k, withDirectives as z, vModelDynamic as N, vModelCheckbox as T, normalizeStyle as x } from "vue";
3
+ const M = "_button_1syl2_1", I = "_disabled_1syl2_1", L = "_loading_1syl2_1", V = "_loader_1syl2_1", q = "_content_1syl2_1", D = "_s_1syl2_2", O = "_xs_1syl2_1", S = "_square_1syl2_1", A = "_circle_1syl2_1", R = "_m_1syl2_1", U = "_l_1syl2_1", K = "_primary_1syl2_1", P = "_secondary_1syl2_1", F = "_accent_1syl2_1", G = "_danger_1syl2_1", H = "_jobsites_1syl2_1", J = "_ghost_1syl2_1", p = {
4
+ button: M,
5
+ disabled: I,
6
+ loading: L,
7
+ loader: V,
8
+ content: q,
9
+ s: D,
10
+ xs: O,
11
+ square: S,
12
+ circle: A,
13
+ m: R,
14
+ l: U,
15
+ primary: K,
16
+ secondary: P,
17
+ accent: F,
18
+ danger: G,
19
+ jobsites: H,
20
+ ghost: J,
21
+ "ghost-danger": "_ghost-danger_1syl2_1"
22
+ }, Q = "_loader_t6bg6_10", W = "_circle_t6bg6_15", X = "_white_t6bg6_22", Y = "_black_t6bg6_26", Z = "_s_t6bg6_30", ee = "_m_t6bg6_35", se = "_l_t6bg6_10", te = "_spinner_t6bg6_45", g = {
23
+ loader: Q,
24
+ circle: W,
25
+ "loader-animation": "_loader-animation_t6bg6_1",
26
+ white: X,
27
+ black: Y,
28
+ s: Z,
29
+ m: ee,
30
+ l: se,
31
+ spinner: te
32
+ }, oe = /* @__PURE__ */ $({
33
+ __name: "loader",
34
+ props: {
35
+ className: {},
36
+ size: { default: "l" },
37
+ color: { default: "black" }
38
+ },
39
+ setup(n) {
40
+ const s = n, t = f(() => [g.loader, g[s.size], g[s.color], g.circle]);
41
+ return (l, e) => (i(), d("span", {
42
+ class: r([c(g).spinner, t.value])
43
+ }, null, 2));
44
+ }
45
+ }), ne = ["name", "type", "disabled"], Ae = /* @__PURE__ */ $({
46
+ name: "BaseButton",
28
47
  __name: "button",
29
48
  props: {
30
49
  size: { default: "m" },
31
50
  className: {},
32
- type: { default: "default" },
33
- block: { type: Boolean },
51
+ type: { default: "primary" },
34
52
  disabled: { type: Boolean, default: !1 },
35
53
  loading: { type: Boolean, default: !1 },
36
54
  active: { type: Boolean, default: !1 },
@@ -40,80 +58,74 @@ const z = "_button_1ey6t_1", M = "_contentWrapper_1ey6t_13", N = "_primary_1ey6t
40
58
  htmlType: {}
41
59
  },
42
60
  emits: ["click"],
43
- setup(i) {
44
- const t = i, l = b(() => [
45
- r.button,
46
- r[t.size],
47
- r[t.type],
61
+ setup(n) {
62
+ const s = n, t = {
63
+ primary: "white",
64
+ secondary: "black",
65
+ accent: "white",
66
+ danger: "white",
67
+ jobsites: "white",
68
+ ghost: "black",
69
+ "ghost-danger": "black"
70
+ }, l = f(() => [
71
+ p.button,
72
+ p[s.size],
73
+ p[s.type],
74
+ s.circle ? [p.circle] : [p.square],
48
75
  {
49
- [r.block]: t.block,
50
- [r.disabled]: t.disabled,
51
- [r.loading]: t.loading,
52
- [r.active]: t.active,
53
- [r.circle]: t.circle,
54
- [r.bordered]: t.bordered
76
+ [p.disabled]: s.disabled,
77
+ [p.loading]: s.loading,
78
+ [p.active]: s.active,
79
+ [p.bordered]: s.bordered
55
80
  },
56
- t.className
57
- ]);
58
- return (s, e) => (c(), d("button", {
59
- name: s.name,
60
- class: o(l.value),
61
- type: s.htmlType,
62
- disabled: s.disabled,
63
- onClick: e[0] || (e[0] = (f) => s.$emit("click"))
81
+ s.className
82
+ ]), e = f(() => t[s.type] || "white");
83
+ return (a, m) => (i(), d("button", {
84
+ name: a.name,
85
+ class: r(l.value),
86
+ type: a.htmlType,
87
+ disabled: a.disabled || a.loading,
88
+ onClick: m[0] || (m[0] = (B) => a.$emit("click"))
64
89
  }, [
65
- s.loading ? (c(), d("div", {
90
+ a.loading ? (i(), d("div", {
66
91
  key: 0,
67
- class: o(a(r).loadingWrapper)
92
+ class: r(c(p).loader)
68
93
  }, [
69
- u("span", {
70
- class: o(a(r).spinner)
71
- }, null, 2)
72
- ], 2)) : _("", !0),
73
- u("div", {
74
- class: o(a(r).contentWrapper)
94
+ j(c(oe), {
95
+ size: "s",
96
+ color: e.value
97
+ }, null, 8, ["color"])
98
+ ], 2)) : u("", !0),
99
+ a.$slots.before ? y(a.$slots, "before", { key: 1 }) : u("", !0),
100
+ h("span", {
101
+ class: r(c(p).content)
75
102
  }, [
76
- s.$slots.leftIcon ? (c(), d("span", {
77
- key: 0,
78
- class: o([a(r).icon, a(r).iconLeft])
79
- }, [
80
- m(s.$slots, "leftIcon")
81
- ], 2)) : _("", !0),
82
- u("span", {
83
- class: o(a(r).content)
84
- }, [
85
- m(s.$slots, "default")
86
- ], 2),
87
- s.$slots.rightIcon ? (c(), d("span", {
88
- key: 1,
89
- class: o([a(r).icon, a(r).iconRight])
90
- }, [
91
- m(s.$slots, "rightIcon")
92
- ], 2)) : _("", !0)
93
- ], 2)
94
- ], 10, Y));
103
+ y(a.$slots, "default")
104
+ ], 2),
105
+ a.$slots.after ? y(a.$slots, "after", { key: 2 }) : u("", !0)
106
+ ], 10, ne));
95
107
  }
96
- }), Z = "_wrapper_f5n0f_1", ee = "_label_f5n0f_6", se = "_container_f5n0f_13", te = "_input_f5n0f_19", ne = "_error_f5n0f_29", oe = "_xs_f5n0f_41", le = "_s_f5n0f_46", ae = "_m_f5n0f_51", re = "_l_f5n0f_6", ie = "_xl_f5n0f_61", ce = "_disabled_f5n0f_66", de = "_errorText_f5n0f_71", pe = "_prefix_f5n0f_78", _e = "_suffix_f5n0f_79", ue = "_loading_f5n0f_94", fe = "_spinner_f5n0f_98", ye = "_spin_f5n0f_98", p = {
97
- wrapper: Z,
98
- label: ee,
99
- container: se,
100
- input: te,
101
- error: ne,
102
- xs: oe,
103
- s: le,
104
- m: ae,
105
- l: re,
106
- xl: ie,
107
- disabled: ce,
108
- errorText: de,
109
- prefix: pe,
110
- suffix: _e,
111
- loading: ue,
112
- spinner: fe,
113
- spin: ye
114
- }, me = ["for"], be = ["id", "name", "type", "disabled", "placeholder"], Le = /* @__PURE__ */ v({
108
+ }), le = "_wrapper_f5n0f_1", ae = "_label_f5n0f_6", re = "_container_f5n0f_13", ce = "_input_f5n0f_19", ie = "_error_f5n0f_29", de = "_xs_f5n0f_41", _e = "_s_f5n0f_46", pe = "_m_f5n0f_51", ue = "_l_f5n0f_6", fe = "_xl_f5n0f_61", me = "_disabled_f5n0f_66", be = "_errorText_f5n0f_71", ye = "_prefix_f5n0f_78", he = "_suffix_f5n0f_79", ge = "_loading_f5n0f_94", $e = "_spinner_f5n0f_98", ve = "_spin_f5n0f_98", _ = {
109
+ wrapper: le,
110
+ label: ae,
111
+ container: re,
112
+ input: ce,
113
+ error: ie,
114
+ xs: de,
115
+ s: _e,
116
+ m: pe,
117
+ l: ue,
118
+ xl: fe,
119
+ disabled: me,
120
+ errorText: be,
121
+ prefix: ye,
122
+ suffix: he,
123
+ loading: ge,
124
+ spinner: $e,
125
+ spin: ve
126
+ }, ke = ["for"], Be = ["id", "name", "type", "disabled", "placeholder"], Re = /* @__PURE__ */ $({
115
127
  __name: "input",
116
- props: /* @__PURE__ */ h({
128
+ props: /* @__PURE__ */ v({
117
129
  value: {},
118
130
  type: { default: "text" },
119
131
  id: {},
@@ -129,79 +141,79 @@ const z = "_button_1ey6t_1", M = "_contentWrapper_1ey6t_13", N = "_primary_1ey6t
129
141
  value: {},
130
142
  valueModifiers: {}
131
143
  }),
132
- emits: /* @__PURE__ */ h(["update:value", "enter"], ["update:value"]),
133
- setup(i, { emit: t }) {
134
- const l = B(i, "value"), s = i, e = t, f = b(() => [
135
- p.input,
136
- p[s.size],
144
+ emits: /* @__PURE__ */ v(["update:value", "enter"], ["update:value"]),
145
+ setup(n, { emit: s }) {
146
+ const t = C(n, "value"), l = n, e = s, a = f(() => [
147
+ _.input,
148
+ _[l.size],
137
149
  {
138
- [p.disabled]: s.disabled,
139
- [p.error]: s.error,
140
- [p.loading]: s.loading
150
+ [_.disabled]: l.disabled,
151
+ [_.error]: l.error,
152
+ [_.loading]: l.loading
141
153
  },
142
- s.className
143
- ]), $ = (n) => {
144
- e("update:value", n.target.value);
145
- }, C = (n) => {
146
- n.key === "Enter" && e("enter");
154
+ l.className
155
+ ]), m = (o) => {
156
+ e("update:value", o.target.value);
157
+ }, B = (o) => {
158
+ o.key === "Enter" && e("enter");
147
159
  };
148
- return (n, k) => (c(), d("div", {
149
- class: o(a(p).wrapper)
160
+ return (o, w) => (i(), d("div", {
161
+ class: r(c(_).wrapper)
150
162
  }, [
151
- n.label ? (c(), d("label", {
163
+ o.label ? (i(), d("label", {
152
164
  key: 0,
153
- for: n.id,
154
- class: o(a(p).label)
155
- }, g(n.label), 11, me)) : _("", !0),
156
- u("div", {
157
- class: o(a(p).container)
165
+ for: o.id,
166
+ class: r(c(_).label)
167
+ }, k(o.label), 11, ke)) : u("", !0),
168
+ h("div", {
169
+ class: r(c(_).container)
158
170
  }, [
159
- n.$slots.prefix ? (c(), d("span", {
171
+ o.$slots.prefix ? (i(), d("span", {
160
172
  key: 0,
161
- class: o(a(p).prefix)
173
+ class: r(c(_).prefix)
162
174
  }, [
163
- m(n.$slots, "prefix")
164
- ], 2)) : _("", !0),
165
- x(u("input", {
166
- id: n.id,
167
- "onUpdate:modelValue": k[0] || (k[0] = (I) => l.value = I),
168
- name: n.name,
169
- type: n.type,
170
- disabled: n.disabled || n.loading,
171
- placeholder: n.placeholder,
172
- class: o(f.value),
173
- onInput: $,
174
- onKeydown: C
175
- }, null, 42, be), [
176
- [E, l.value]
175
+ y(o.$slots, "prefix")
176
+ ], 2)) : u("", !0),
177
+ z(h("input", {
178
+ id: o.id,
179
+ "onUpdate:modelValue": w[0] || (w[0] = (E) => t.value = E),
180
+ name: o.name,
181
+ type: o.type,
182
+ disabled: o.disabled || o.loading,
183
+ placeholder: o.placeholder,
184
+ class: r(a.value),
185
+ onInput: m,
186
+ onKeydown: B
187
+ }, null, 42, Be), [
188
+ [N, t.value]
177
189
  ]),
178
- n.$slots.suffix ? (c(), d("span", {
190
+ o.$slots.suffix ? (i(), d("span", {
179
191
  key: 1,
180
- class: o(a(p).suffix)
192
+ class: r(c(_).suffix)
181
193
  }, [
182
- m(n.$slots, "suffix")
183
- ], 2)) : _("", !0),
184
- n.loading ? (c(), d("span", {
194
+ y(o.$slots, "suffix")
195
+ ], 2)) : u("", !0),
196
+ o.loading ? (i(), d("span", {
185
197
  key: 2,
186
- class: o(a(p).spinner)
187
- }, null, 2)) : _("", !0)
198
+ class: r(c(_).spinner)
199
+ }, null, 2)) : u("", !0)
188
200
  ], 2),
189
- n.error ? (c(), d("p", {
201
+ o.error ? (i(), d("p", {
190
202
  key: 1,
191
- class: o(a(p).errorText)
192
- }, g(n.error), 3)) : _("", !0)
203
+ class: r(c(_).errorText)
204
+ }, k(o.error), 3)) : u("", !0)
193
205
  ], 2));
194
206
  }
195
- }), ve = "_label_jcdiv_1", $e = "_disabled_jcdiv_7", he = "_input_jcdiv_17", ge = "_error_jcdiv_30", ke = "_text_jcdiv_70", Be = "_errorText_jcdiv_76", y = {
196
- label: ve,
197
- disabled: $e,
198
- input: he,
199
- error: ge,
200
- text: ke,
201
- errorText: Be
202
- }, xe = ["for"], Ce = ["id", "name", "disabled"], Re = /* @__PURE__ */ v({
207
+ }), we = "_label_jcdiv_1", Ce = "_disabled_jcdiv_7", ze = "_input_jcdiv_17", Ee = "_error_jcdiv_30", je = "_text_jcdiv_70", Ne = "_errorText_jcdiv_76", b = {
208
+ label: we,
209
+ disabled: Ce,
210
+ input: ze,
211
+ error: Ee,
212
+ text: je,
213
+ errorText: Ne
214
+ }, Te = ["for"], xe = ["id", "name", "disabled"], Ue = /* @__PURE__ */ $({
203
215
  __name: "checkbox",
204
- props: /* @__PURE__ */ h({
216
+ props: /* @__PURE__ */ v({
205
217
  id: {},
206
218
  name: {},
207
219
  disabled: { type: Boolean },
@@ -213,92 +225,93 @@ const z = "_button_1ey6t_1", M = "_contentWrapper_1ey6t_13", N = "_primary_1ey6t
213
225
  checkedModifiers: {}
214
226
  }),
215
227
  emits: ["update:checked"],
216
- setup(i) {
217
- const t = B(i, "checked"), l = i, s = b(() => [
218
- y.label,
228
+ setup(n) {
229
+ const s = C(n, "checked"), t = n, l = f(() => [
230
+ b.label,
219
231
  {
220
- [y.disabled]: l.disabled
232
+ [b.disabled]: t.disabled
221
233
  },
222
- l.className
234
+ t.className
223
235
  ]);
224
- return (e, f) => (c(), d("div", null, [
225
- u("label", {
236
+ return (e, a) => (i(), d("div", null, [
237
+ h("label", {
226
238
  for: e.id,
227
- class: o(s.value)
239
+ class: r(l.value)
228
240
  }, [
229
- x(u("input", {
241
+ z(h("input", {
230
242
  id: e.id,
231
- "onUpdate:modelValue": f[0] || (f[0] = ($) => t.value = $),
243
+ "onUpdate:modelValue": a[0] || (a[0] = (m) => s.value = m),
232
244
  name: e.name,
233
245
  type: "checkbox",
234
246
  disabled: e.disabled,
235
- class: o([a(y).input, { [a(y).error]: !!l.error }])
236
- }, null, 10, Ce), [
237
- [T, t.value]
247
+ class: r([c(b).input, { [c(b).error]: !!t.error }])
248
+ }, null, 10, xe), [
249
+ [T, s.value]
238
250
  ]),
239
- e.$slots.default ? (c(), d("span", {
251
+ e.$slots.default ? (i(), d("span", {
240
252
  key: 0,
241
- class: o(a(y).text)
253
+ class: r(c(b).text)
242
254
  }, [
243
- m(e.$slots, "default")
244
- ], 2)) : _("", !0)
245
- ], 10, xe),
246
- e.error ? (c(), d("div", {
255
+ y(e.$slots, "default")
256
+ ], 2)) : u("", !0)
257
+ ], 10, Te),
258
+ e.error ? (i(), d("div", {
247
259
  key: 0,
248
- class: o(a(y).errorText)
249
- }, g(e.error), 3)) : _("", !0)
260
+ class: r(c(b).errorText)
261
+ }, k(e.error), 3)) : u("", !0)
250
262
  ]));
251
263
  }
252
- }), Ie = ["aria-label", "width", "height"], Ee = ["xlink:href"], Te = /* @__PURE__ */ v({
264
+ }), Me = ["aria-label", "width", "height"], Ie = ["xlink:href"], Le = /* @__PURE__ */ $({
253
265
  __name: "icon",
254
266
  props: {
255
267
  type: {},
256
268
  color: {},
257
269
  block: { type: Boolean }
258
270
  },
259
- setup(i) {
260
- const t = i, l = b(() => {
261
- const e = t.type.match(/(\d+)$/);
271
+ setup(n) {
272
+ const s = n, t = f(() => {
273
+ const e = s.type.match(/(\d+)$/);
262
274
  return e ? parseInt(e[1], 10) : 16;
263
- }), s = b(() => {
275
+ }), l = f(() => {
264
276
  const e = {};
265
- return t.color && (e.color = t.color), t.block && (e.display = "block"), e;
277
+ return s.color && (e.color = s.color), s.block && (e.display = "block"), e;
266
278
  });
267
- return (e, f) => (c(), d("svg", {
268
- class: o(e.$style.icon),
279
+ return (e, a) => (i(), d("svg", {
280
+ class: r(e.$style.icon),
269
281
  "aria-label": e.type,
270
- style: w(s.value),
282
+ style: x(l.value),
271
283
  role: "img",
272
- width: l.value,
273
- height: l.value
284
+ width: t.value,
285
+ height: t.value
274
286
  }, [
275
- u("use", {
287
+ h("use", {
276
288
  "xlink:href": `../assets/sprite.svg#${e.type}`
277
- }, null, 8, Ee)
278
- ], 14, Ie));
289
+ }, null, 8, Ie)
290
+ ], 14, Me));
279
291
  }
280
- }), we = "_icon_1p8iz_2", ze = {
281
- icon: we
282
- }, Me = (i, t) => {
283
- const l = i.__vccOpts || i;
284
- for (const [s, e] of t)
285
- l[s] = e;
286
- return l;
287
- }, Ne = {
288
- $style: ze
289
- }, Se = /* @__PURE__ */ Me(Te, [["__cssModules", Ne]]), Ve = () => {
290
- const i = "huntflow-uikit-icons-sprite", t = "/src/assets/sprite.svg";
291
- if (!document.getElementById(i)) {
292
- const l = document.createElement("svg");
293
- l.style.display = "none", l.id = i;
294
- const s = document.createElement("defs"), e = document.createElement("use");
295
- e.setAttribute("href", `${t}`), s.appendChild(e), l.appendChild(s), document.body.appendChild(l);
292
+ }), Ve = "_icon_1p8iz_2", qe = {
293
+ icon: Ve
294
+ }, De = (n, s) => {
295
+ const t = n.__vccOpts || n;
296
+ for (const [l, e] of s)
297
+ t[l] = e;
298
+ return t;
299
+ }, Oe = {
300
+ $style: qe
301
+ }, Ke = /* @__PURE__ */ De(Le, [["__cssModules", Oe]]), Pe = () => {
302
+ const n = "huntflow-uikit-icons-sprite", s = "/src/assets/sprite.svg";
303
+ if (!document.getElementById(n)) {
304
+ const t = document.createElement("svg");
305
+ t.style.display = "none", t.id = n;
306
+ const l = document.createElement("defs"), e = document.createElement("use");
307
+ e.setAttribute("href", `${s}`), l.appendChild(e), t.appendChild(l), document.body.appendChild(t);
296
308
  }
297
309
  };
298
310
  export {
299
- je as BaseButton,
300
- Re as BaseCheckbox,
301
- Se as BaseIcon,
302
- Le as BaseInput,
303
- Ve as useIcons
311
+ Ae as BaseButton,
312
+ Ue as BaseCheckbox,
313
+ Ke as BaseIcon,
314
+ Re as BaseInput,
315
+ oe as BaseLoader,
316
+ Pe as useIcons
304
317
  };
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.48",
5
+ "version": "0.0.49",
6
6
  "author": {
7
7
  "name": "HuntFlow Developer",
8
8
  "nickname": "developer",
@@ -23,7 +23,8 @@
23
23
  "storybook": "storybook dev -p 6006",
24
24
  "build-storybook": "storybook build",
25
25
  "lint": "eslint './src/**/*.{js,vue,ts}' --quiet",
26
- "icons": "npx tsx utils/figma-icons.ts"
26
+ "icons": "npx tsx utils/figma-icons.ts",
27
+ "variables": "npx tsx utils/figma-variables.ts"
27
28
  },
28
29
  "publishConfig": {
29
30
  "access": "public"
@@ -75,6 +76,7 @@
75
76
  "postcss-nesting": "^13.0.1",
76
77
  "prettier": "^3.4.2",
77
78
  "storybook": "^8.4.7",
79
+ "storybook-addon-pseudo-states": "^4.0.2",
78
80
  "stylelint": "^16.12.0",
79
81
  "stylelint-config-recommended": "^14.0.1",
80
82
  "tsx": "^4.19.2",