@shtabapp/ui-kit 1.28.0 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/SAvatar-BS9Lu2eL.js +249 -0
  3. package/dist/SAvatar-BXABKIV0.cjs +1 -0
  4. package/dist/{SAvatarGroup-Cc4sBQjA.cjs → SAvatarGroup-CMa9KhUZ.cjs} +1 -1
  5. package/dist/{SAvatarGroup-Buja-Gw9.js → SAvatarGroup-wkXHy_tK.js} +1 -1
  6. package/dist/SBadge-BDxQJh6c.js +83 -0
  7. package/dist/SBadge-d1GOPFP-.cjs +1 -0
  8. package/dist/SButton-C-z_q5CG.cjs +1 -0
  9. package/dist/SButton-DnU_XZ1C.js +223 -0
  10. package/dist/{SInput-Bno-hQ-b.cjs → SInput-DYS84eMS.cjs} +1 -1
  11. package/dist/{SInput-W2257ZAC.js → SInput-iNlzBX5m.js} +1 -1
  12. package/dist/{SList-D-J6fBrQ.cjs → SList-CU2Sy9Md.cjs} +1 -1
  13. package/dist/{SList-9BpZD3aT.js → SList-C_S9ej45.js} +2 -2
  14. package/dist/{SListItem-BAWj5_pk.js → SListItem-BD7wvCNe.js} +11 -11
  15. package/dist/{SListItem-4OTUkahk.cjs → SListItem-BDkldLVt.cjs} +1 -1
  16. package/dist/{SSelect-DADK22v2.cjs → SSelect-CTxBjl2J.cjs} +1 -1
  17. package/dist/{SSelect-DFkWwUc1.js → SSelect-MzZwivEY.js} +70 -70
  18. package/dist/{STabs-DLFs7km7.cjs → STabs-C6QQnCZd.cjs} +1 -1
  19. package/dist/{STabs-Cfv9NIJe.js → STabs-Ce7tHq8T.js} +10 -10
  20. package/dist/{STag-ZPesEPB4.js → STag-CYoj7L-p.js} +8 -8
  21. package/dist/{STag-DlVk53Cn.cjs → STag-DVrSWByQ.cjs} +1 -1
  22. package/dist/{STagGroup-C3-hAyGi.js → STagGroup-B2-_OG3R.js} +1 -1
  23. package/dist/{STagGroup-C4qL3p57.cjs → STagGroup-BMyuxfVX.cjs} +1 -1
  24. package/dist/components/SAvatar/SAvatar.types.d.ts +2 -0
  25. package/dist/components/SAvatar/SAvatar.types.d.ts.map +1 -1
  26. package/dist/components/SAvatar/SAvatar.vue.d.ts.map +1 -1
  27. package/dist/components/SAvatar/utils/useAvatarBadge.d.ts +13 -0
  28. package/dist/components/SAvatar/utils/useAvatarBadge.d.ts.map +1 -0
  29. package/dist/components/SBadge/SBadge.types.d.ts +15 -0
  30. package/dist/components/SBadge/SBadge.types.d.ts.map +1 -1
  31. package/dist/components/SBadge/SBadge.vue.d.ts.map +1 -1
  32. package/dist/components/SBadge/index.d.ts +1 -1
  33. package/dist/components/SBadge/index.d.ts.map +1 -1
  34. package/dist/components/SButton/SButton.types.d.ts +7 -0
  35. package/dist/components/SButton/SButton.types.d.ts.map +1 -1
  36. package/dist/components/SButton/SButton.vue.d.ts.map +1 -1
  37. package/dist/components/SButton/utils/useButtonBadge.d.ts +21 -0
  38. package/dist/components/SButton/utils/useButtonBadge.d.ts.map +1 -0
  39. package/dist/components/SList/utils/resolveListItemFields.d.ts +1 -1
  40. package/dist/components/SList/utils/resolveListItemFields.d.ts.map +1 -1
  41. package/dist/entries/avatar-group.cjs +1 -1
  42. package/dist/entries/avatar-group.js +1 -1
  43. package/dist/entries/avatar.cjs +1 -1
  44. package/dist/entries/avatar.js +1 -1
  45. package/dist/entries/badge.cjs +1 -1
  46. package/dist/entries/badge.js +1 -1
  47. package/dist/entries/button.cjs +1 -1
  48. package/dist/entries/button.js +1 -1
  49. package/dist/entries/input.cjs +1 -1
  50. package/dist/entries/input.js +1 -1
  51. package/dist/entries/list-item.cjs +1 -1
  52. package/dist/entries/list-item.js +1 -1
  53. package/dist/entries/list.cjs +1 -1
  54. package/dist/entries/list.js +1 -1
  55. package/dist/entries/select.cjs +1 -1
  56. package/dist/entries/select.js +1 -1
  57. package/dist/entries/tabs.cjs +1 -1
  58. package/dist/entries/tabs.js +1 -1
  59. package/dist/entries/tag-group.cjs +1 -1
  60. package/dist/entries/tag-group.js +2 -2
  61. package/dist/entries/tag.cjs +1 -1
  62. package/dist/entries/tag.js +1 -1
  63. package/dist/index.cjs +1 -1
  64. package/dist/index.js +24 -24
  65. package/dist/uikit-components.css +1 -1
  66. package/package.json +3 -3
  67. package/dist/SAvatar-CRq0LG8U.cjs +0 -1
  68. package/dist/SAvatar-kB6E-fX6.js +0 -187
  69. package/dist/SBadge-BQFJFZtw.cjs +0 -1
  70. package/dist/SBadge-CcCknHTw.js +0 -43
  71. package/dist/SButton-CHxE2l-X.cjs +0 -1
  72. package/dist/SButton-D5yFE3W2.js +0 -156
  73. package/dist/components/SAvatar/SAvatarBadge.vue.d.ts +0 -5
  74. package/dist/components/SAvatar/SAvatarBadge.vue.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [@shtabapp/ui-kit-v1.30.0](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.29.0...@shtabapp/ui-kit@1.30.0) (2026-06-29)
2
+
3
+ ### Features
4
+
5
+ - complex badge for avatar & button ([46cb6d5](https://gitlab.com/mstikharev/shtab-ui-kit/commit/46cb6d5a0c515567adf83b542a7cdb3a55c074bc))
6
+
7
+ ## [@shtabapp/ui-kit-v1.29.0](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.28.0...@shtabapp/ui-kit@1.29.0) (2026-06-29)
8
+
9
+ ### Features
10
+
11
+ - change slist item min size ([daa481f](https://gitlab.com/mstikharev/shtab-ui-kit/commit/daa481f77a390edfd58aa35218a78275aae815a9))
12
+
1
13
  ## [@shtabapp/ui-kit-v1.28.0](https://gitlab.com/mstikharev/shtab-ui-kit/compare/@shtabapp/ui-kit@1.27.0...@shtabapp/ui-kit@1.28.0) (2026-06-22)
2
14
 
3
15
  ### Features
@@ -0,0 +1,249 @@
1
+ import { i as e, n as t, r as n, t as r } from "./SBadge-BDxQJh6c.js";
2
+ import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, mergeProps as f, normalizeClass as p, openBlock as m, ref as h, renderList as g, toDisplayString as _, toValue as v, unref as y, useAttrs as b, watch as x } from "vue";
3
+ import { ESIconName as S, SIcon as C } from "@shtabapp/ui-kit-primitives";
4
+ //#region src/components/SAvatar/SAvatar.types.ts
5
+ var w = /* @__PURE__ */ function(e) {
6
+ return e.SIZE_80 = "80", e.SIZE_72 = "72", e.SIZE_64 = "64", e.SIZE_56 = "56", e.SIZE_48 = "48", e.SIZE_40 = "40", e.SIZE_32 = "32", e.SIZE_24 = "24", e.SIZE_20 = "20", e.SIZE_16 = "16", e;
7
+ }({}), T = /* @__PURE__ */ function(e) {
8
+ return e.CIRCLE = "circle", e.SQUARE = "square", e;
9
+ }({}), E = /* @__PURE__ */ function(e) {
10
+ return e.TEAL = "teal", e.CYAN = "cyan", e.INDIGO = "indigo", e.VIOLET = "violet", e.PINK = "pink", e.SURFACE = "surface", e;
11
+ }({}), D = /* @__PURE__ */ function(e) {
12
+ return e.NEUTRAL = "neutral", e.MAIN = "main", e;
13
+ }({}), O = /* @__PURE__ */ function(e) {
14
+ return e.DEFAULT = "default", e.ONLINE = "online", e.OFFLINE = "offline", e.RECENTLY = "recently", e.ERROR = "error", e.TRACK = "track", e.DONE = "done", e.CONTROLLER = "controller", e.FAVORITE = "favorite", e.PIN = "pin", e.PRIVATE = "private", e;
15
+ }({}), k = /* @__PURE__ */ function(e) {
16
+ return e.SMALL = "s", e.MEDIUM = "m", e.LARGE = "l", e;
17
+ }({}), A = {
18
+ [w.SIZE_80]: "s-ui-typography-heading-h3-semibold",
19
+ [w.SIZE_72]: "s-ui-typography-heading-h4-semibold",
20
+ [w.SIZE_64]: "s-ui-typography-heading-h4-semibold",
21
+ [w.SIZE_56]: "s-ui-typography-label-16-medium",
22
+ [w.SIZE_48]: "s-ui-typography-label-16-medium",
23
+ [w.SIZE_40]: "s-ui-typography-label-16-medium",
24
+ [w.SIZE_32]: "s-ui-typography-label-14-medium",
25
+ [w.SIZE_24]: "s-ui-typography-label-12-medium",
26
+ [w.SIZE_20]: "s-ui-typography-label-12-medium",
27
+ [w.SIZE_16]: "s-ui-typography-label-10-medium"
28
+ }, j = {
29
+ [w.SIZE_80]: 40,
30
+ [w.SIZE_72]: 40,
31
+ [w.SIZE_64]: 40,
32
+ [w.SIZE_56]: 32,
33
+ [w.SIZE_48]: 32,
34
+ [w.SIZE_40]: 24,
35
+ [w.SIZE_32]: 24,
36
+ [w.SIZE_24]: 20,
37
+ [w.SIZE_20]: 16,
38
+ [w.SIZE_16]: 16
39
+ }, M = {
40
+ [w.SIZE_80]: k.LARGE,
41
+ [w.SIZE_72]: k.LARGE,
42
+ [w.SIZE_64]: k.MEDIUM,
43
+ [w.SIZE_56]: k.MEDIUM,
44
+ [w.SIZE_48]: k.SMALL,
45
+ [w.SIZE_40]: k.SMALL,
46
+ [w.SIZE_32]: k.SMALL,
47
+ [w.SIZE_24]: k.SMALL,
48
+ [w.SIZE_20]: k.SMALL,
49
+ [w.SIZE_16]: k.SMALL
50
+ }, N = {
51
+ [k.SMALL]: e.SMALL,
52
+ [k.MEDIUM]: e.MEDIUM,
53
+ [k.LARGE]: e.LARGE
54
+ }, P = {
55
+ [e.SMALL]: 8,
56
+ [e.MEDIUM]: 10,
57
+ [e.LARGE]: 12
58
+ }, F = {
59
+ [e.SMALL]: 12,
60
+ [e.MEDIUM]: 16,
61
+ [e.LARGE]: 20
62
+ }, I = 16, L = {
63
+ [w.SIZE_80]: 0,
64
+ [w.SIZE_72]: 0,
65
+ [w.SIZE_64]: 0,
66
+ [w.SIZE_56]: 0,
67
+ [w.SIZE_48]: 0,
68
+ [w.SIZE_40]: 0,
69
+ [w.SIZE_32]: -2,
70
+ [w.SIZE_24]: -2,
71
+ [w.SIZE_20]: -4,
72
+ [w.SIZE_16]: -4
73
+ }, R = {
74
+ [w.SIZE_80]: -8,
75
+ [w.SIZE_72]: -8,
76
+ [w.SIZE_64]: -8,
77
+ [w.SIZE_56]: -8,
78
+ [w.SIZE_48]: -8,
79
+ [w.SIZE_40]: -8,
80
+ [w.SIZE_32]: -8,
81
+ [w.SIZE_24]: -8,
82
+ [w.SIZE_20]: -10,
83
+ [w.SIZE_16]: -10
84
+ }, z = {
85
+ [O.DEFAULT]: t.MAIN,
86
+ [O.ONLINE]: t.SUCCESS,
87
+ [O.OFFLINE]: t.WHITE,
88
+ [O.RECENTLY]: t.WARNING,
89
+ [O.ERROR]: t.DANGER,
90
+ [O.TRACK]: t.MAIN,
91
+ [O.DONE]: t.SUCCESS,
92
+ [O.CONTROLLER]: t.MAIN,
93
+ [O.FAVORITE]: t.WARNING,
94
+ [O.PIN]: t.MAIN,
95
+ [O.PRIVATE]: t.BILLING
96
+ }, B = {
97
+ [O.TRACK]: S.playFill,
98
+ [O.DONE]: S.checkBold,
99
+ [O.CONTROLLER]: S.controlFill,
100
+ [O.FAVORITE]: S.starFill,
101
+ [O.PIN]: S.pinFill,
102
+ [O.PRIVATE]: S.tabooBold
103
+ }, V = ({ avatarSize: e, badgeSize: t, hasIcon: n }) => {
104
+ let r = L[e];
105
+ return n ? r : r + (F[t] - P[t]) / 2;
106
+ }, H = (e, t) => ({
107
+ offsetX: -e - t / 2,
108
+ offsetY: -e - t / 2
109
+ }), U = (e, t) => ({
110
+ offsetX: -e - t / 2,
111
+ offsetY: e + t / 2
112
+ }), W = ({ badge: r, counter: i, size: o }) => {
113
+ let s = a(() => {
114
+ let e = v(r);
115
+ if (!e) return;
116
+ let t = v(o), i = B[e], a = N[M[t]], s = i ? F[a] : P[a], c = H(V({
117
+ avatarSize: t,
118
+ badgeSize: a,
119
+ hasIcon: !!i
120
+ }), s);
121
+ return {
122
+ anchored: !0,
123
+ color: z[e],
124
+ icon: i,
125
+ label: e,
126
+ offsetX: c.offsetX,
127
+ offsetY: c.offsetY,
128
+ placement: n.BOTTOM_END,
129
+ size: a
130
+ };
131
+ }), c = a(() => {
132
+ let r = v(i);
133
+ if (typeof r != "number") return;
134
+ let a = R[v(o)], s = U(a, I);
135
+ return {
136
+ anchored: !0,
137
+ color: t.MAIN,
138
+ offsetX: s.offsetX,
139
+ offsetY: s.offsetY,
140
+ placement: n.TOP_END,
141
+ size: e.MEDIUM,
142
+ value: r
143
+ };
144
+ });
145
+ return { avatarBadgeItemsProps: a(() => {
146
+ let e = [];
147
+ return c.value && e.push(c.value), s.value && e.push(s.value), e;
148
+ }) };
149
+ }, G = (e) => e.startsWith("#"), K = (e) => G(e) ? "s-ui-avatar--color-custom" : `s-ui-avatar--color-${e}`, q = (e) => ({ "--s-ui-avatar-background": e }), J = ["aria-disabled"], Y = { class: "s-ui-avatar__content" }, X = ["src", "alt"], Z = {
150
+ key: 1,
151
+ class: "s-ui-avatar__icon"
152
+ }, Q = ["role", "aria-label"], $ = {
153
+ key: 0,
154
+ class: "s-ui-avatar__name"
155
+ }, ee = /* @__PURE__ */ d({
156
+ inheritAttrs: !1,
157
+ __name: "SAvatar",
158
+ props: {
159
+ alt: {},
160
+ badge: {},
161
+ bordered: {
162
+ type: Boolean,
163
+ default: !0
164
+ },
165
+ color: { default: () => E.TEAL },
166
+ counter: {},
167
+ disabled: {
168
+ type: Boolean,
169
+ default: !1
170
+ },
171
+ icon: {},
172
+ iconBackground: { default: () => D.NEUTRAL },
173
+ initialLength: { default: 1 },
174
+ name: {},
175
+ shape: { default: () => T.CIRCLE },
176
+ showName: {
177
+ type: Boolean,
178
+ default: !0
179
+ },
180
+ size: { default: () => w.SIZE_40 },
181
+ src: {}
182
+ },
183
+ setup(e) {
184
+ let t = b(), n = h(!1), d = (e) => typeof e == "number" || typeof e == "string", v = a(() => {
185
+ if (d(t.tabindex)) return t.tabindex;
186
+ if (d(t.tabIndex)) return t.tabIndex;
187
+ }), S = a(() => d(t.tabindex) || d(t.tabIndex)), w = a(() => e.disabled ? -1 : S.value ? v.value : 0), T = a(() => ({
188
+ ...t,
189
+ tabindex: w.value
190
+ })), E = a(() => [
191
+ `s-ui-avatar--size-${e.size}`,
192
+ `s-ui-avatar--shape-${e.shape}`,
193
+ K(e.color),
194
+ `s-ui-avatar--icon-background-${e.iconBackground}`,
195
+ {
196
+ "s-ui-avatar--bordered": e.bordered,
197
+ "s-ui-avatar--disabled": e.disabled,
198
+ "s-ui-avatar--icon": k.value,
199
+ "s-ui-avatar--photo": O.value
200
+ }
201
+ ]), D = a(() => {
202
+ if (!k.value && G(e.color)) return q(e.color);
203
+ }), O = a(() => !!(e.src && !n.value)), k = a(() => !!(!O.value && e.icon)), M = (e) => {
204
+ let t = e.split(/\s+/).filter(Boolean);
205
+ if (t.length === 1) {
206
+ let e = t[0];
207
+ if (e) return e;
208
+ }
209
+ return t.map((e) => e.slice(0, 1)).join("");
210
+ }, N = a(() => e.name ? M(e.name) : ""), P = a(() => e.alt ? e.alt : e.name ? e.name : N.value), F = a(() => {
211
+ if (e.alt) return e.alt;
212
+ if (e.name) return e.name;
213
+ }), I = a(() => N.value.slice(0, Math.max(e.initialLength, 0))), L = a(() => A[e.size]), R = a(() => j[e.size]), { avatarBadgeItemsProps: z } = W({
214
+ badge: () => e.badge,
215
+ counter: () => e.counter,
216
+ size: () => e.size
217
+ }), B = () => {
218
+ n.value = !0;
219
+ };
220
+ return x(() => e.src, () => {
221
+ n.value = !1;
222
+ }), (t, a) => (m(), c("span", f(T.value, {
223
+ class: ["s-ui-avatar", E.value],
224
+ style: D.value,
225
+ "aria-disabled": e.disabled || void 0
226
+ }), [l("span", Y, [e.src && !n.value ? (m(), c("img", {
227
+ key: 0,
228
+ class: "s-ui-avatar__image",
229
+ src: e.src,
230
+ alt: P.value,
231
+ onError: B
232
+ }, null, 40, X)) : e.icon ? (m(), c("span", Z, [u(y(C), {
233
+ name: e.icon,
234
+ size: R.value,
235
+ "aria-label": F.value
236
+ }, null, 8, [
237
+ "name",
238
+ "size",
239
+ "aria-label"
240
+ ])])) : (m(), c("span", {
241
+ key: 2,
242
+ class: p(["s-ui-avatar__initials", L.value]),
243
+ role: e.alt ? "img" : void 0,
244
+ "aria-label": e.alt
245
+ }, _(I.value), 11, Q)), (m(!0), c(i, null, g(y(z), (e) => (m(), o(y(r), f({ key: e.placement }, { ref_for: !0 }, e), null, 16))), 128))]), e.showName && e.name ? (m(), c("span", $, _(e.name), 1)) : s("", !0)], 16, J));
246
+ }
247
+ });
248
+ //#endregion
249
+ export { T as a, D as i, O as n, w as o, E as r, ee as t };
@@ -0,0 +1 @@
1
+ const e=require("./SBadge-d1GOPFP-.cjs");let t=require("vue"),n=require("@shtabapp/ui-kit-primitives");var r=function(e){return e.SIZE_80=`80`,e.SIZE_72=`72`,e.SIZE_64=`64`,e.SIZE_56=`56`,e.SIZE_48=`48`,e.SIZE_40=`40`,e.SIZE_32=`32`,e.SIZE_24=`24`,e.SIZE_20=`20`,e.SIZE_16=`16`,e}({}),i=function(e){return e.CIRCLE=`circle`,e.SQUARE=`square`,e}({}),a=function(e){return e.TEAL=`teal`,e.CYAN=`cyan`,e.INDIGO=`indigo`,e.VIOLET=`violet`,e.PINK=`pink`,e.SURFACE=`surface`,e}({}),o=function(e){return e.NEUTRAL=`neutral`,e.MAIN=`main`,e}({}),s=function(e){return e.DEFAULT=`default`,e.ONLINE=`online`,e.OFFLINE=`offline`,e.RECENTLY=`recently`,e.ERROR=`error`,e.TRACK=`track`,e.DONE=`done`,e.CONTROLLER=`controller`,e.FAVORITE=`favorite`,e.PIN=`pin`,e.PRIVATE=`private`,e}({}),c=function(e){return e.SMALL=`s`,e.MEDIUM=`m`,e.LARGE=`l`,e}({}),l={[r.SIZE_80]:`s-ui-typography-heading-h3-semibold`,[r.SIZE_72]:`s-ui-typography-heading-h4-semibold`,[r.SIZE_64]:`s-ui-typography-heading-h4-semibold`,[r.SIZE_56]:`s-ui-typography-label-16-medium`,[r.SIZE_48]:`s-ui-typography-label-16-medium`,[r.SIZE_40]:`s-ui-typography-label-16-medium`,[r.SIZE_32]:`s-ui-typography-label-14-medium`,[r.SIZE_24]:`s-ui-typography-label-12-medium`,[r.SIZE_20]:`s-ui-typography-label-12-medium`,[r.SIZE_16]:`s-ui-typography-label-10-medium`},u={[r.SIZE_80]:40,[r.SIZE_72]:40,[r.SIZE_64]:40,[r.SIZE_56]:32,[r.SIZE_48]:32,[r.SIZE_40]:24,[r.SIZE_32]:24,[r.SIZE_24]:20,[r.SIZE_20]:16,[r.SIZE_16]:16},d={[r.SIZE_80]:c.LARGE,[r.SIZE_72]:c.LARGE,[r.SIZE_64]:c.MEDIUM,[r.SIZE_56]:c.MEDIUM,[r.SIZE_48]:c.SMALL,[r.SIZE_40]:c.SMALL,[r.SIZE_32]:c.SMALL,[r.SIZE_24]:c.SMALL,[r.SIZE_20]:c.SMALL,[r.SIZE_16]:c.SMALL},f={[c.SMALL]:e.i.SMALL,[c.MEDIUM]:e.i.MEDIUM,[c.LARGE]:e.i.LARGE},p={[e.i.SMALL]:8,[e.i.MEDIUM]:10,[e.i.LARGE]:12},m={[e.i.SMALL]:12,[e.i.MEDIUM]:16,[e.i.LARGE]:20},h=16,g={[r.SIZE_80]:0,[r.SIZE_72]:0,[r.SIZE_64]:0,[r.SIZE_56]:0,[r.SIZE_48]:0,[r.SIZE_40]:0,[r.SIZE_32]:-2,[r.SIZE_24]:-2,[r.SIZE_20]:-4,[r.SIZE_16]:-4},_={[r.SIZE_80]:-8,[r.SIZE_72]:-8,[r.SIZE_64]:-8,[r.SIZE_56]:-8,[r.SIZE_48]:-8,[r.SIZE_40]:-8,[r.SIZE_32]:-8,[r.SIZE_24]:-8,[r.SIZE_20]:-10,[r.SIZE_16]:-10},v={[s.DEFAULT]:e.n.MAIN,[s.ONLINE]:e.n.SUCCESS,[s.OFFLINE]:e.n.WHITE,[s.RECENTLY]:e.n.WARNING,[s.ERROR]:e.n.DANGER,[s.TRACK]:e.n.MAIN,[s.DONE]:e.n.SUCCESS,[s.CONTROLLER]:e.n.MAIN,[s.FAVORITE]:e.n.WARNING,[s.PIN]:e.n.MAIN,[s.PRIVATE]:e.n.BILLING},y={[s.TRACK]:n.ESIconName.playFill,[s.DONE]:n.ESIconName.checkBold,[s.CONTROLLER]:n.ESIconName.controlFill,[s.FAVORITE]:n.ESIconName.starFill,[s.PIN]:n.ESIconName.pinFill,[s.PRIVATE]:n.ESIconName.tabooBold},b=({avatarSize:e,badgeSize:t,hasIcon:n})=>{let r=g[e];return n?r:r+(m[t]-p[t])/2},x=(e,t)=>({offsetX:-e-t/2,offsetY:-e-t/2}),S=(e,t)=>({offsetX:-e-t/2,offsetY:e+t/2}),C=({badge:n,counter:r,size:i})=>{let a=(0,t.computed)(()=>{let r=(0,t.toValue)(n);if(!r)return;let a=(0,t.toValue)(i),o=y[r],s=f[d[a]],c=o?m[s]:p[s],l=x(b({avatarSize:a,badgeSize:s,hasIcon:!!o}),c);return{anchored:!0,color:v[r],icon:o,label:r,offsetX:l.offsetX,offsetY:l.offsetY,placement:e.r.BOTTOM_END,size:s}}),o=(0,t.computed)(()=>{let n=(0,t.toValue)(r);if(typeof n!=`number`)return;let a=_[(0,t.toValue)(i)],o=S(a,h);return{anchored:!0,color:e.n.MAIN,offsetX:o.offsetX,offsetY:o.offsetY,placement:e.r.TOP_END,size:e.i.MEDIUM,value:n}});return{avatarBadgeItemsProps:(0,t.computed)(()=>{let e=[];return o.value&&e.push(o.value),a.value&&e.push(a.value),e})}},w=e=>e.startsWith(`#`),T=e=>w(e)?`s-ui-avatar--color-custom`:`s-ui-avatar--color-${e}`,E=e=>({"--s-ui-avatar-background":e}),D=[`aria-disabled`],O={class:`s-ui-avatar__content`},k=[`src`,`alt`],A={key:1,class:`s-ui-avatar__icon`},j=[`role`,`aria-label`],M={key:0,class:`s-ui-avatar__name`},N=(0,t.defineComponent)({inheritAttrs:!1,__name:`SAvatar`,props:{alt:{},badge:{},bordered:{type:Boolean,default:!0},color:{default:()=>a.TEAL},counter:{},disabled:{type:Boolean,default:!1},icon:{},iconBackground:{default:()=>o.NEUTRAL},initialLength:{default:1},name:{},shape:{default:()=>i.CIRCLE},showName:{type:Boolean,default:!0},size:{default:()=>r.SIZE_40},src:{}},setup(r){let i=(0,t.useAttrs)(),a=(0,t.ref)(!1),o=e=>typeof e==`number`||typeof e==`string`,s=(0,t.computed)(()=>{if(o(i.tabindex))return i.tabindex;if(o(i.tabIndex))return i.tabIndex}),c=(0,t.computed)(()=>o(i.tabindex)||o(i.tabIndex)),d=(0,t.computed)(()=>r.disabled?-1:c.value?s.value:0),f=(0,t.computed)(()=>({...i,tabindex:d.value})),p=(0,t.computed)(()=>[`s-ui-avatar--size-${r.size}`,`s-ui-avatar--shape-${r.shape}`,T(r.color),`s-ui-avatar--icon-background-${r.iconBackground}`,{"s-ui-avatar--bordered":r.bordered,"s-ui-avatar--disabled":r.disabled,"s-ui-avatar--icon":g.value,"s-ui-avatar--photo":h.value}]),m=(0,t.computed)(()=>{if(!g.value&&w(r.color))return E(r.color)}),h=(0,t.computed)(()=>!!(r.src&&!a.value)),g=(0,t.computed)(()=>!!(!h.value&&r.icon)),_=e=>{let t=e.split(/\s+/).filter(Boolean);if(t.length===1){let e=t[0];if(e)return e}return t.map(e=>e.slice(0,1)).join(``)},v=(0,t.computed)(()=>r.name?_(r.name):``),y=(0,t.computed)(()=>r.alt?r.alt:r.name?r.name:v.value),b=(0,t.computed)(()=>{if(r.alt)return r.alt;if(r.name)return r.name}),x=(0,t.computed)(()=>v.value.slice(0,Math.max(r.initialLength,0))),S=(0,t.computed)(()=>l[r.size]),N=(0,t.computed)(()=>u[r.size]),{avatarBadgeItemsProps:P}=C({badge:()=>r.badge,counter:()=>r.counter,size:()=>r.size}),F=()=>{a.value=!0};return(0,t.watch)(()=>r.src,()=>{a.value=!1}),(i,o)=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,(0,t.mergeProps)(f.value,{class:[`s-ui-avatar`,p.value],style:m.value,"aria-disabled":r.disabled||void 0}),[(0,t.createElementVNode)(`span`,O,[r.src&&!a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,class:`s-ui-avatar__image`,src:r.src,alt:y.value,onError:F},null,40,k)):r.icon?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,A,[(0,t.createVNode)((0,t.unref)(n.SIcon),{name:r.icon,size:N.value,"aria-label":b.value},null,8,[`name`,`size`,`aria-label`])])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:2,class:(0,t.normalizeClass)([`s-ui-avatar__initials`,S.value]),role:r.alt?`img`:void 0,"aria-label":r.alt},(0,t.toDisplayString)(x.value),11,j)),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(P),n=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(e.t),(0,t.mergeProps)({key:n.placement},{ref_for:!0},n),null,16))),128))]),r.showName&&r.name?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,M,(0,t.toDisplayString)(r.name),1)):(0,t.createCommentVNode)(``,!0)],16,D))}});Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return N}});
@@ -1 +1 @@
1
- const e=require("./SAvatar-CRq0LG8U.cjs"),t=require("./SOverflowGroup-DyVUzkNu.cjs");let n=require("vue");var r=function(e){return e.EXTRA_SMALL=`extra-small`,e.SMALL=`small`,e.MEDIUM=`medium`,e}({}),i={class:`s-ui-avatar-group__overflow`},a=(0,n.defineComponent)({__name:`SAvatarGroup`,props:{disabled:{type:Boolean,default:!1},maxVisible:{},size:{default:()=>r.SMALL}},setup(a){let o=(0,n.computed)(()=>[`s-ui-avatar-group--size-${a.size}`,{"s-ui-avatar-group--disabled":a.disabled}]),s={[r.EXTRA_SMALL]:e.o.SIZE_16,[r.SMALL]:e.o.SIZE_20,[r.MEDIUM]:e.o.SIZE_24},c=(0,n.computed)(()=>s[a.size]),l=(e,t)=>({"--s-ui-avatar-group-item-z-index":e-t}),u=(t,r)=>t.type===e.t?(0,n.cloneVNode)(t,{...a.disabled?{disabled:!0}:{},showName:!1,size:c.value,style:l(r.visibleCount,r.visibleIndex)}):t;return(e,r)=>((0,n.openBlock)(),(0,n.createBlock)(t.t,{class:(0,n.normalizeClass)([`s-ui-avatar-group`,o.value]),role:`group`,"aria-disabled":a.disabled||void 0,"cluster-class":`s-ui-avatar-group__cluster`,"max-visible":a.maxVisible,"map-vnode":u},{overflow:(0,n.withCtx)(({overflowLabel:e})=>[(0,n.createElementVNode)(`span`,i,(0,n.toDisplayString)(e),1)]),default:(0,n.withCtx)(()=>[(0,n.renderSlot)(e.$slots,`default`)]),_:3},8,[`class`,`aria-disabled`,`max-visible`]))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
1
+ const e=require("./SAvatar-BXABKIV0.cjs"),t=require("./SOverflowGroup-DyVUzkNu.cjs");let n=require("vue");var r=function(e){return e.EXTRA_SMALL=`extra-small`,e.SMALL=`small`,e.MEDIUM=`medium`,e}({}),i={class:`s-ui-avatar-group__overflow`},a=(0,n.defineComponent)({__name:`SAvatarGroup`,props:{disabled:{type:Boolean,default:!1},maxVisible:{},size:{default:()=>r.SMALL}},setup(a){let o=(0,n.computed)(()=>[`s-ui-avatar-group--size-${a.size}`,{"s-ui-avatar-group--disabled":a.disabled}]),s={[r.EXTRA_SMALL]:e.o.SIZE_16,[r.SMALL]:e.o.SIZE_20,[r.MEDIUM]:e.o.SIZE_24},c=(0,n.computed)(()=>s[a.size]),l=(e,t)=>({"--s-ui-avatar-group-item-z-index":e-t}),u=(t,r)=>t.type===e.t?(0,n.cloneVNode)(t,{...a.disabled?{disabled:!0}:{},showName:!1,size:c.value,style:l(r.visibleCount,r.visibleIndex)}):t;return(e,r)=>((0,n.openBlock)(),(0,n.createBlock)(t.t,{class:(0,n.normalizeClass)([`s-ui-avatar-group`,o.value]),role:`group`,"aria-disabled":a.disabled||void 0,"cluster-class":`s-ui-avatar-group__cluster`,"max-visible":a.maxVisible,"map-vnode":u},{overflow:(0,n.withCtx)(({overflowLabel:e})=>[(0,n.createElementVNode)(`span`,i,(0,n.toDisplayString)(e),1)]),default:(0,n.withCtx)(()=>[(0,n.renderSlot)(e.$slots,`default`)]),_:3},8,[`class`,`aria-disabled`,`max-visible`]))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
@@ -1,4 +1,4 @@
1
- import { o as e, t } from "./SAvatar-kB6E-fX6.js";
1
+ import { o as e, t } from "./SAvatar-BS9Lu2eL.js";
2
2
  import { t as n } from "./SOverflowGroup-CVSon6Eg.js";
3
3
  import { cloneVNode as r, computed as i, createBlock as a, createElementVNode as o, defineComponent as s, normalizeClass as c, openBlock as l, renderSlot as u, toDisplayString as d, withCtx as f } from "vue";
4
4
  //#region src/components/SAvatarGroup/SAvatarGroup.types.ts
@@ -0,0 +1,83 @@
1
+ import { computed as e, createBlock as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, normalizeStyle as o, openBlock as s, renderSlot as c, toDisplayString as l, unref as u, useSlots as d } from "vue";
2
+ import { SIcon as f } from "@shtabapp/ui-kit-primitives";
3
+ //#region src/components/SBadge/SBadge.types.ts
4
+ var p = /* @__PURE__ */ function(e) {
5
+ return e.DANGER = "danger", e.MAIN = "main", e.SUCCESS = "success", e.WARNING = "warning", e.GRAY = "gray", e.WHITE = "white", e.BILLING = "billing", e.DISABLED = "disabled", e;
6
+ }({}), m = /* @__PURE__ */ function(e) {
7
+ return e.SMALL = "s", e.MEDIUM = "m", e.LARGE = "l", e;
8
+ }({}), h = /* @__PURE__ */ function(e) {
9
+ return e.TOP_END = "top-end", e.TOP_START = "top-start", e.BOTTOM_END = "bottom-end", e.BOTTOM_START = "bottom-start", e;
10
+ }({}), g = {
11
+ key: 0,
12
+ class: "s-ui-badge-anchor"
13
+ }, _ = ["aria-label"], v = {
14
+ key: 1,
15
+ class: "s-ui-badge__dot"
16
+ }, y = {
17
+ key: 2,
18
+ class: "s-ui-badge__label s-ui-typography-label-10-medium"
19
+ }, b = ["aria-label"], x = {
20
+ key: 1,
21
+ class: "s-ui-badge__dot"
22
+ }, S = {
23
+ key: 2,
24
+ class: "s-ui-badge__label s-ui-typography-label-10-medium"
25
+ }, C = 16, w = /* @__PURE__ */ i({
26
+ __name: "SBadge",
27
+ props: {
28
+ anchored: {
29
+ type: Boolean,
30
+ default: !1
31
+ },
32
+ color: { default: () => p.DANGER },
33
+ value: {},
34
+ max: {},
35
+ label: {},
36
+ icon: {},
37
+ size: { default: () => m.SMALL },
38
+ placement: { default: () => h.TOP_END },
39
+ offsetX: { default: 0 },
40
+ offsetY: { default: 0 }
41
+ },
42
+ setup(i) {
43
+ let p = d(), h = e(() => !!(p.default || i.anchored)), w = e(() => typeof i.value == "number"), T = e(() => typeof i.value == "number" ? i.max && i.value > i.max ? `${i.max}+` : String(i.value) : ""), E = e(() => T.value.length === 1), D = e(() => !!i.icon), O = e(() => !D.value && !w.value), k = e(() => [`s-ui-badge--color-${i.color}`, {
44
+ "s-ui-badge--anchored": h.value,
45
+ "s-ui-badge--single": E.value && !D.value,
46
+ "s-ui-badge--with-dot": O.value,
47
+ "s-ui-badge--with-icon": D.value,
48
+ [`s-ui-badge--size-${i.size}`]: i.size !== m.SMALL || D.value || O.value,
49
+ [`s-ui-badge--placement-${i.placement}`]: h.value
50
+ }]), A = e(() => {
51
+ if (h.value) return {
52
+ "--s-ui-badge-offset-x": `${i.offsetX}px`,
53
+ "--s-ui-badge-offset-y": `${i.offsetY}px`
54
+ };
55
+ }), j = e(() => {
56
+ if (i.label) return i.label;
57
+ if (i.icon) return i.icon;
58
+ if (T.value) return T.value;
59
+ });
60
+ return (e, d) => u(p).default ? (s(), n("span", g, [c(e.$slots, "default"), r("span", {
61
+ class: a(["s-ui-badge", k.value]),
62
+ style: o(A.value),
63
+ "aria-label": j.value
64
+ }, [i.icon ? (s(), t(u(f), {
65
+ key: 0,
66
+ class: "s-ui-badge__icon",
67
+ name: i.icon,
68
+ size: C
69
+ }, null, 8, ["name"])) : O.value ? (s(), n("span", v)) : (s(), n("span", y, l(T.value), 1))], 14, _)])) : (s(), n("span", {
70
+ key: 1,
71
+ class: a(["s-ui-badge", k.value]),
72
+ style: o(A.value),
73
+ "aria-label": j.value
74
+ }, [i.icon ? (s(), t(u(f), {
75
+ key: 0,
76
+ class: "s-ui-badge__icon",
77
+ name: i.icon,
78
+ size: C
79
+ }, null, 8, ["name"])) : O.value ? (s(), n("span", x)) : (s(), n("span", S, l(T.value), 1))], 14, b));
80
+ }
81
+ });
82
+ //#endregion
83
+ export { m as i, p as n, h as r, w as t };
@@ -0,0 +1 @@
1
+ let e=require("vue"),t=require("@shtabapp/ui-kit-primitives");var n=function(e){return e.DANGER=`danger`,e.MAIN=`main`,e.SUCCESS=`success`,e.WARNING=`warning`,e.GRAY=`gray`,e.WHITE=`white`,e.BILLING=`billing`,e.DISABLED=`disabled`,e}({}),r=function(e){return e.SMALL=`s`,e.MEDIUM=`m`,e.LARGE=`l`,e}({}),i=function(e){return e.TOP_END=`top-end`,e.TOP_START=`top-start`,e.BOTTOM_END=`bottom-end`,e.BOTTOM_START=`bottom-start`,e}({}),a={key:0,class:`s-ui-badge-anchor`},o=[`aria-label`],s={key:1,class:`s-ui-badge__dot`},c={key:2,class:`s-ui-badge__label s-ui-typography-label-10-medium`},l=[`aria-label`],u={key:1,class:`s-ui-badge__dot`},d={key:2,class:`s-ui-badge__label s-ui-typography-label-10-medium`},f=16,p=(0,e.defineComponent)({__name:`SBadge`,props:{anchored:{type:Boolean,default:!1},color:{default:()=>n.DANGER},value:{},max:{},label:{},icon:{},size:{default:()=>r.SMALL},placement:{default:()=>i.TOP_END},offsetX:{default:0},offsetY:{default:0}},setup(n){let i=(0,e.useSlots)(),p=(0,e.computed)(()=>!!(i.default||n.anchored)),m=(0,e.computed)(()=>typeof n.value==`number`),h=(0,e.computed)(()=>typeof n.value==`number`?n.max&&n.value>n.max?`${n.max}+`:String(n.value):``),g=(0,e.computed)(()=>h.value.length===1),_=(0,e.computed)(()=>!!n.icon),v=(0,e.computed)(()=>!_.value&&!m.value),y=(0,e.computed)(()=>[`s-ui-badge--color-${n.color}`,{"s-ui-badge--anchored":p.value,"s-ui-badge--single":g.value&&!_.value,"s-ui-badge--with-dot":v.value,"s-ui-badge--with-icon":_.value,[`s-ui-badge--size-${n.size}`]:n.size!==r.SMALL||_.value||v.value,[`s-ui-badge--placement-${n.placement}`]:p.value}]),b=(0,e.computed)(()=>{if(p.value)return{"--s-ui-badge-offset-x":`${n.offsetX}px`,"--s-ui-badge-offset-y":`${n.offsetY}px`}}),x=(0,e.computed)(()=>{if(n.label)return n.label;if(n.icon)return n.icon;if(h.value)return h.value});return(r,p)=>(0,e.unref)(i).default?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,a,[(0,e.renderSlot)(r.$slots,`default`),(0,e.createElementVNode)(`span`,{class:(0,e.normalizeClass)([`s-ui-badge`,y.value]),style:(0,e.normalizeStyle)(b.value),"aria-label":x.value},[n.icon?((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(t.SIcon),{key:0,class:`s-ui-badge__icon`,name:n.icon,size:f},null,8,[`name`])):v.value?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,s)):((0,e.openBlock)(),(0,e.createElementBlock)(`span`,c,(0,e.toDisplayString)(h.value),1))],14,o)])):((0,e.openBlock)(),(0,e.createElementBlock)(`span`,{key:1,class:(0,e.normalizeClass)([`s-ui-badge`,y.value]),style:(0,e.normalizeStyle)(b.value),"aria-label":x.value},[n.icon?((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(t.SIcon),{key:0,class:`s-ui-badge__icon`,name:n.icon,size:f},null,8,[`name`])):v.value?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,u)):((0,e.openBlock)(),(0,e.createElementBlock)(`span`,d,(0,e.toDisplayString)(h.value),1))],14,l))}});Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return p}});
@@ -0,0 +1 @@
1
+ const e=require("./SBadge-d1GOPFP-.cjs"),t=require("./SButton.types-UKroD-ev.cjs"),n=require("./context-kCi2xRHY.cjs"),r=require("./useSelectionGroup-TaektE-I.cjs"),i=require("./useSelectLink-DDdMmsJB.cjs"),a=require("./useLink-1LLWpdDZ.cjs");let o=require("vue"),s=require("@shtabapp/ui-kit-primitives");var c={offsetX:1,offsetY:-1},l={[t.n.SMALL]:{offsetX:-6,offsetY:6},[t.n.MEDIUM]:{offsetX:-7,offsetY:7},[t.n.LARGE]:{offsetX:-8,offsetY:8}},u={[t.n.SMALL]:e.i.SMALL,[t.n.MEDIUM]:e.i.SMALL,[t.n.LARGE]:e.i.MEDIUM},d=({color:t,counterValue:n})=>{if(typeof n==`number`)return{anchored:!0,color:t,offsetX:c.offsetX,offsetY:c.offsetY,placement:e.r.TOP_END,size:e.i.MEDIUM,value:n}},f=({buttonSize:t,color:n,indicator:r})=>{if(!r)return;let i=l[t];return{anchored:!0,color:n,offsetX:i.offsetX,offsetY:i.offsetY,placement:e.r.TOP_END,size:u[t]}},p=({badgeColor:t,counter:n,indicator:r,size:i})=>({buttonBadgeProps:(0,o.computed)(()=>{let a=(0,o.toValue)(t)||e.n.MAIN;return d({color:a,counterValue:(0,o.toValue)(n)})||f({buttonSize:(0,o.toValue)(i),color:a,indicator:(0,o.toValue)(r)})})}),m=[`aria-hidden`],h={key:0,class:`s-ui-button__spinner`,"aria-hidden":`true`},g=(0,o.defineComponent)({inheritAttrs:!1,__name:`SButton`,props:{appearance:{},badgeColor:{},counter:{},disabled:{type:Boolean,default:!1},icon:{},iconLeft:{},iconRight:{},indicator:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{},value:{},variant:{},link:{},exact:{type:Boolean,default:!1},replace:{type:Boolean,default:!1}},setup(c){let l=(0,o.inject)(n.t,null),u=(0,o.useAttrs)(),d=(0,o.computed)(()=>r.a(c.appearance,l?(0,o.toValue)(l.appearance):void 0,t.t.MAJOR)),f=(0,o.computed)(()=>r.a(c.variant,l?(0,o.toValue)(l.variant):void 0,t.r.MAIN)),g=(0,o.computed)(()=>r.a(c.size,l?(0,o.toValue)(l.size):void 0,t.n.MEDIUM)),_=(0,o.computed)(()=>c.disabled||!!(l&&(0,o.toValue)(l.disabled))),v=(0,o.useTemplateRef)(`buttonRootRef`),{buttonBadgeProps:y}=p({badgeColor:()=>c.badgeColor,counter:()=>c.counter,indicator:()=>c.indicator,size:()=>g.value}),b=a.t(()=>c.link,()=>c.exact,()=>c.replace),x=b.linkPresentation;i.t({isRouterLink:b.isRouterLink,isActive:b.isActive,group:()=>l,value:()=>c.value});let S=(0,o.computed)(()=>{let e=x.value;return e.mode===`none`?`button`:e.rootTag}),C=(0,o.computed)(()=>S.value===`button`),w=(0,o.computed)(()=>_.value||c.loading),T=i.n({group:l,value:()=>c.value,el:v,disabled:_,interactive:()=>!w.value}),E=(0,o.computed)(()=>b.isRouterLink.value?b.isActive.value:T.isActive.value),D=(0,o.computed)(()=>[`s-ui-button`,`s-ui-button--tab-focus`,`s-ui-button--appearance-${d.value}`,`s-ui-button--variant-${f.value}`,`s-ui-button--size-${g.value}`,{"s-ui-button--disabled":_.value,"s-ui-button--loading":c.loading,"s-ui-button--icon-only":c.icon,"s-ui-button--active":E.value,"s-ui-button--link":x.value.mode!==`none`}]),O=(0,o.computed)(()=>({disabled:C.value?w.value:void 0,"aria-busy":c.loading?!0:void 0,"aria-pressed":T.ariaPressed.value,"aria-checked":T.ariaChecked.value,tabindex:T.tabIndex.value,...a.n(x.value,{replace:c.replace})})),k=(0,o.computed)(()=>({...O.value,...u})),A={[t.n.SMALL]:`s-ui-typography-label-12-medium`,[t.n.MEDIUM]:`s-ui-typography-label-14-medium`,[t.n.LARGE]:`s-ui-typography-label-16-medium`},j=(0,o.computed)(()=>A[g.value]),M={[t.n.SMALL]:16,[t.n.MEDIUM]:20,[t.n.LARGE]:24},N=(0,o.computed)(()=>M[g.value]),P=(0,o.computed)(()=>_.value||c.loading?!1:f.value===t.r.BILLING&&d.value!==t.t.MAJOR),F=(0,o.computed)(()=>f.value===t.r.BILLING&&d.value!==t.t.MAJOR),I=e=>{if(!w.value){if(b.isRouterLink.value&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),b.navigate();return}T.handleKeydown(e)}},L=e=>{if(w.value){e.preventDefault(),e.stopPropagation();return}b.isRouterLink.value||T.handleClick()};return(t,n)=>((0,o.openBlock)(),(0,o.createBlock)((0,o.resolveDynamicComponent)(S.value),(0,o.mergeProps)({ref_key:`buttonRootRef`,ref:v,class:D.value},k.value,{onClick:L,onKeydown:I}),{default:(0,o.withCtx)(()=>[(0,o.createElementVNode)(`span`,{class:`s-ui-button__inner`,"aria-hidden":c.loading?!0:void 0},[c.icon?((0,o.openBlock)(),(0,o.createBlock)((0,o.unref)(s.SIcon),{key:0,name:c.icon,size:N.value,billing:P.value},null,8,[`name`,`size`,`billing`])):((0,o.openBlock)(),(0,o.createElementBlock)(o.Fragment,{key:1},[c.iconLeft?((0,o.openBlock)(),(0,o.createBlock)((0,o.unref)(s.SIcon),{key:0,name:c.iconLeft,size:N.value,billing:P.value},null,8,[`name`,`size`,`billing`])):(0,o.createCommentVNode)(``,!0),(0,o.createElementVNode)(`span`,{class:(0,o.normalizeClass)([`s-ui-button__label`,j.value])},[(0,o.renderSlot)(t.$slots,`default`)],2),c.iconRight?((0,o.openBlock)(),(0,o.createBlock)((0,o.unref)(s.SIcon),{key:1,name:c.iconRight,size:N.value,billing:P.value},null,8,[`name`,`size`,`billing`])):(0,o.createCommentVNode)(``,!0)],64))],8,m),c.loading?((0,o.openBlock)(),(0,o.createElementBlock)(`span`,h,[(0,o.createVNode)((0,o.unref)(s.SSpinner),{billing:F.value,size:N.value},null,8,[`billing`,`size`])])):(0,o.createCommentVNode)(``,!0),(0,o.unref)(y)?((0,o.openBlock)(),(0,o.createBlock)((0,o.unref)(e.t),(0,o.normalizeProps)((0,o.mergeProps)({key:1},(0,o.unref)(y))),null,16)):(0,o.createCommentVNode)(``,!0)]),_:3},16,[`class`]))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return g}});
@@ -0,0 +1,223 @@
1
+ import { i as e, n as t, r as n, t as r } from "./SBadge-BDxQJh6c.js";
2
+ import { n as i, r as a, t as o } from "./SButton.types-CpdHQtyx.js";
3
+ import { t as s } from "./context-C3WoLJS4.js";
4
+ import { a as c } from "./useSelectionGroup-cKj38lEN.js";
5
+ import { n as l, t as u } from "./useSelectLink-DClG5hGA.js";
6
+ import { n as d, t as f } from "./useLink-Com5VhOk.js";
7
+ import { Fragment as p, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createVNode as y, defineComponent as b, inject as ee, mergeProps as x, normalizeClass as S, normalizeProps as C, openBlock as w, renderSlot as T, resolveDynamicComponent as E, toValue as D, unref as O, useAttrs as k, useTemplateRef as te, withCtx as A } from "vue";
8
+ import { SIcon as j, SSpinner as M } from "@shtabapp/ui-kit-primitives";
9
+ //#region src/components/SButton/utils/useButtonBadge.ts
10
+ var N = {
11
+ offsetX: 1,
12
+ offsetY: -1
13
+ }, P = {
14
+ [i.SMALL]: {
15
+ offsetX: -6,
16
+ offsetY: 6
17
+ },
18
+ [i.MEDIUM]: {
19
+ offsetX: -7,
20
+ offsetY: 7
21
+ },
22
+ [i.LARGE]: {
23
+ offsetX: -8,
24
+ offsetY: 8
25
+ }
26
+ }, F = {
27
+ [i.SMALL]: e.SMALL,
28
+ [i.MEDIUM]: e.SMALL,
29
+ [i.LARGE]: e.MEDIUM
30
+ }, I = ({ color: t, counterValue: r }) => {
31
+ if (typeof r == "number") return {
32
+ anchored: !0,
33
+ color: t,
34
+ offsetX: N.offsetX,
35
+ offsetY: N.offsetY,
36
+ placement: n.TOP_END,
37
+ size: e.MEDIUM,
38
+ value: r
39
+ };
40
+ }, L = ({ buttonSize: e, color: t, indicator: r }) => {
41
+ if (!r) return;
42
+ let i = P[e];
43
+ return {
44
+ anchored: !0,
45
+ color: t,
46
+ offsetX: i.offsetX,
47
+ offsetY: i.offsetY,
48
+ placement: n.TOP_END,
49
+ size: F[e]
50
+ };
51
+ }, R = ({ badgeColor: e, counter: n, indicator: r, size: i }) => ({ buttonBadgeProps: m(() => {
52
+ let a = D(e) || t.MAIN;
53
+ return I({
54
+ color: a,
55
+ counterValue: D(n)
56
+ }) || L({
57
+ buttonSize: D(i),
58
+ color: a,
59
+ indicator: D(r)
60
+ });
61
+ }) }), z = ["aria-hidden"], B = {
62
+ key: 0,
63
+ class: "s-ui-button__spinner",
64
+ "aria-hidden": "true"
65
+ }, V = /* @__PURE__ */ b({
66
+ inheritAttrs: !1,
67
+ __name: "SButton",
68
+ props: {
69
+ appearance: {},
70
+ badgeColor: {},
71
+ counter: {},
72
+ disabled: {
73
+ type: Boolean,
74
+ default: !1
75
+ },
76
+ icon: {},
77
+ iconLeft: {},
78
+ iconRight: {},
79
+ indicator: {
80
+ type: Boolean,
81
+ default: !1
82
+ },
83
+ loading: {
84
+ type: Boolean,
85
+ default: !1
86
+ },
87
+ size: {},
88
+ value: {},
89
+ variant: {},
90
+ link: {},
91
+ exact: {
92
+ type: Boolean,
93
+ default: !1
94
+ },
95
+ replace: {
96
+ type: Boolean,
97
+ default: !1
98
+ }
99
+ },
100
+ setup(e) {
101
+ let t = ee(s, null), n = k(), b = m(() => c(e.appearance, t ? D(t.appearance) : void 0, o.MAJOR)), N = m(() => c(e.variant, t ? D(t.variant) : void 0, a.MAIN)), P = m(() => c(e.size, t ? D(t.size) : void 0, i.MEDIUM)), F = m(() => e.disabled || !!(t && D(t.disabled))), I = te("buttonRootRef"), { buttonBadgeProps: L } = R({
102
+ badgeColor: () => e.badgeColor,
103
+ counter: () => e.counter,
104
+ indicator: () => e.indicator,
105
+ size: () => P.value
106
+ }), V = f(() => e.link, () => e.exact, () => e.replace), H = V.linkPresentation;
107
+ u({
108
+ isRouterLink: V.isRouterLink,
109
+ isActive: V.isActive,
110
+ group: () => t,
111
+ value: () => e.value
112
+ });
113
+ let U = m(() => {
114
+ let e = H.value;
115
+ return e.mode === "none" ? "button" : e.rootTag;
116
+ }), W = m(() => U.value === "button"), G = m(() => F.value || e.loading), K = l({
117
+ group: t,
118
+ value: () => e.value,
119
+ el: I,
120
+ disabled: F,
121
+ interactive: () => !G.value
122
+ }), q = m(() => V.isRouterLink.value ? V.isActive.value : K.isActive.value), J = m(() => [
123
+ "s-ui-button",
124
+ "s-ui-button--tab-focus",
125
+ `s-ui-button--appearance-${b.value}`,
126
+ `s-ui-button--variant-${N.value}`,
127
+ `s-ui-button--size-${P.value}`,
128
+ {
129
+ "s-ui-button--disabled": F.value,
130
+ "s-ui-button--loading": e.loading,
131
+ "s-ui-button--icon-only": e.icon,
132
+ "s-ui-button--active": q.value,
133
+ "s-ui-button--link": H.value.mode !== "none"
134
+ }
135
+ ]), Y = m(() => ({
136
+ disabled: W.value ? G.value : void 0,
137
+ "aria-busy": e.loading ? !0 : void 0,
138
+ "aria-pressed": K.ariaPressed.value,
139
+ "aria-checked": K.ariaChecked.value,
140
+ tabindex: K.tabIndex.value,
141
+ ...d(H.value, { replace: e.replace })
142
+ })), X = m(() => ({
143
+ ...Y.value,
144
+ ...n
145
+ })), Z = {
146
+ [i.SMALL]: "s-ui-typography-label-12-medium",
147
+ [i.MEDIUM]: "s-ui-typography-label-14-medium",
148
+ [i.LARGE]: "s-ui-typography-label-16-medium"
149
+ }, ne = m(() => Z[P.value]), re = {
150
+ [i.SMALL]: 16,
151
+ [i.MEDIUM]: 20,
152
+ [i.LARGE]: 24
153
+ }, Q = m(() => re[P.value]), $ = m(() => F.value || e.loading ? !1 : N.value === a.BILLING && b.value !== o.MAJOR), ie = m(() => N.value === a.BILLING && b.value !== o.MAJOR), ae = (e) => {
154
+ if (!G.value) {
155
+ if (V.isRouterLink.value && (e.key === "Enter" || e.key === " " || e.key === "Spacebar")) {
156
+ e.preventDefault(), V.navigate();
157
+ return;
158
+ }
159
+ K.handleKeydown(e);
160
+ }
161
+ }, oe = (e) => {
162
+ if (G.value) {
163
+ e.preventDefault(), e.stopPropagation();
164
+ return;
165
+ }
166
+ V.isRouterLink.value || K.handleClick();
167
+ };
168
+ return (t, n) => (w(), h(E(U.value), x({
169
+ ref_key: "buttonRootRef",
170
+ ref: I,
171
+ class: J.value
172
+ }, X.value, {
173
+ onClick: oe,
174
+ onKeydown: ae
175
+ }), {
176
+ default: A(() => [
177
+ v("span", {
178
+ class: "s-ui-button__inner",
179
+ "aria-hidden": e.loading ? !0 : void 0
180
+ }, [e.icon ? (w(), h(O(j), {
181
+ key: 0,
182
+ name: e.icon,
183
+ size: Q.value,
184
+ billing: $.value
185
+ }, null, 8, [
186
+ "name",
187
+ "size",
188
+ "billing"
189
+ ])) : (w(), _(p, { key: 1 }, [
190
+ e.iconLeft ? (w(), h(O(j), {
191
+ key: 0,
192
+ name: e.iconLeft,
193
+ size: Q.value,
194
+ billing: $.value
195
+ }, null, 8, [
196
+ "name",
197
+ "size",
198
+ "billing"
199
+ ])) : g("", !0),
200
+ v("span", { class: S(["s-ui-button__label", ne.value]) }, [T(t.$slots, "default")], 2),
201
+ e.iconRight ? (w(), h(O(j), {
202
+ key: 1,
203
+ name: e.iconRight,
204
+ size: Q.value,
205
+ billing: $.value
206
+ }, null, 8, [
207
+ "name",
208
+ "size",
209
+ "billing"
210
+ ])) : g("", !0)
211
+ ], 64))], 8, z),
212
+ e.loading ? (w(), _("span", B, [y(O(M), {
213
+ billing: ie.value,
214
+ size: Q.value
215
+ }, null, 8, ["billing", "size"])])) : g("", !0),
216
+ O(L) ? (w(), h(O(r), C(x({ key: 1 }, O(L))), null, 16)) : g("", !0)
217
+ ]),
218
+ _: 3
219
+ }, 16, ["class"]));
220
+ }
221
+ });
222
+ //#endregion
223
+ export { V as t };
@@ -1 +1 @@
1
- const e=require("./SButton.types-UKroD-ev.cjs"),t=require("./SButton-CHxE2l-X.cjs"),n=require("./SInlineMessage-gjkMiE-W.cjs"),r=require("./SLabel-CTiOAAOu.cjs"),i=require("./useFieldMessages-CzjU0ajM.cjs");let a=require("vue"),o=require("@shtabapp/ui-kit-primitives");var s=function(e){return e.NONE=`none`,e.HORIZONTAL=`horizontal`,e.VERTICAL=`vertical`,e}({}),c=[`inert`,`aria-disabled`],l={key:0,class:`s-ui-input__prepend`},u={class:`s-ui-input__row`},d={key:0,class:`s-ui-input__prefix`},f=[`id`,`type`,`name`,`placeholder`,`disabled`,`readonly`,`autocomplete`],p={key:0,class:`s-ui-input__inline`},m={key:1,class:`s-ui-input__clear`},h={key:2,class:`s-ui-input__action`},g={key:1,class:`s-ui-input__messages`},_=16,v=(0,a.defineComponent)({inheritAttrs:!1,__name:`SInput`,props:(0,a.mergeModels)({label:{},labelProps:{},placeholder:{},helpMessages:{},errorMessages:{},bordered:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},hasValue:{type:Boolean},focused:{type:Boolean,default:!1},iconLeft:{},iconRight:{},customize:{default:()=>s.NONE},name:{},type:{default:`text`},id:{},autocomplete:{}},{modelValue:{default:``},modelModifiers:{}}),emits:(0,a.mergeModels)([`clear`,`focus`,`blur`],[`update:modelValue`]),setup(v,{expose:y,emit:b}){let x=(0,a.useModel)(v,`modelValue`),S=b,C=(0,a.useAttrs)(),w=(0,a.useSlots)(),T=(0,a.useId)(),E=(0,a.useTemplateRef)(`fieldElementRef`),D=(0,a.useTemplateRef)(`inputElementRef`),{isFocused:O,handleFocus:k,handleFocusOut:A}=i.n({isDisabled:()=>v.disabled,blurField:()=>Y(),emitFocus:e=>S(`focus`,e),emitBlur:e=>S(`blur`,e)}),{normalizedHelpMessages:j,normalizedErrorMessages:M,hasErrorMessages:N,hasHelpMessages:P}=i.t(()=>v.helpMessages,()=>v.errorMessages),F=(0,a.computed)(()=>v.id?v.id:T),I=(0,a.computed)(()=>!!(v.label||w.label)),L=(0,a.computed)(()=>!!(v.iconLeft||w.prefix)),R=(0,a.computed)(()=>v.customize===s.VERTICAL&&!!w.prepend),z=(0,a.computed)(()=>v.customize===s.HORIZONTAL&&!!w.prepend),B=(0,a.computed)(()=>!v.clearable||v.disabled||v.readonly?!1:x.value.length>0),V=(0,a.computed)(()=>{if(!O.value)return-1}),H=(0,a.computed)(()=>!!(v.iconRight||w.action)),U=(0,a.computed)(()=>!!w.message||P.value||N.value),W=(0,a.computed)(()=>v.hasValue===void 0?x.value.length>0:v.hasValue),G=(0,a.computed)(()=>({"s-ui-input--disabled":v.disabled,"s-ui-input--readonly":v.readonly})),K=(0,a.computed)(()=>[{"s-ui-input__field--bordered":v.bordered,"s-ui-input__field--borderless":!v.bordered,"s-ui-input__field--disabled":v.disabled,"s-ui-input__field--readonly":v.readonly,"s-ui-input__field--error":N.value,"s-ui-input__field--filled":W.value,"s-ui-input__field--vertical":v.customize===s.VERTICAL,"s-ui-input__field--focused":O.value||v.focused}]),q=e=>{let t=E.value;t&&t.querySelector(`.s-ui-input__control, .s-ui-select__control, .s-ui-select__search-input, [tabindex]:not([tabindex="-1"])`)?.focus(e)},J=e=>{if(w.control){q(e);return}D.value?.focus(e)},Y=()=>{if(w.control){let e=document.activeElement;e instanceof HTMLElement&&E.value?.contains(e)&&e.blur();return}D.value?.blur()},X=e=>{v.disabled||v.readonly||e.target instanceof HTMLElement&&(e.target.closest(`.s-ui-input__prepend, .s-ui-input__inline, .s-ui-input__clear, .s-ui-input__action`)||J())},Z=()=>{x.value=``,S(`clear`),J()};return y({blur:Y,focus:J,fieldElementRef:E,inputElementRef:D}),(i,y)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{class:(0,a.normalizeClass)([`s-ui-input`,G.value])},[I.value?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(r.t),(0,a.mergeProps)({key:0},v.labelProps,{"html-for":F.value}),{default:(0,a.withCtx)(()=>[(0,a.renderSlot)(i.$slots,`label`,{},()=>[(0,a.createTextVNode)((0,a.toDisplayString)(v.label),1)])]),_:3},16,[`html-for`])):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`div`,{ref_key:`fieldElementRef`,ref:E,class:(0,a.normalizeClass)([`s-ui-input__field`,K.value]),inert:v.disabled?!0:void 0,"aria-disabled":v.disabled?!0:void 0,onClick:y[2]||=e=>X(e),onFocusout:y[3]||=(...e)=>(0,a.unref)(A)&&(0,a.unref)(A)(...e)},[R.value?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,l,[(0,a.renderSlot)(i.$slots,`prepend`,{disabled:v.disabled})])):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`div`,u,[L.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,d,[(0,a.renderSlot)(i.$slots,`prefix`,{disabled:v.disabled},()=>[v.iconLeft?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(o.SIcon),{key:0,name:v.iconLeft,size:_},null,8,[`name`])):(0,a.createCommentVNode)(``,!0)])])):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`div`,{class:(0,a.normalizeClass)([`s-ui-input__control-wrap`,{"s-ui-input__control-wrap--horizontal":v.customize===(0,a.unref)(s).HORIZONTAL}])},[(0,a.renderSlot)(i.$slots,`control`,{disabled:v.disabled},()=>[(0,a.withDirectives)((0,a.createElementVNode)(`input`,(0,a.mergeProps)({id:F.value,ref_key:`inputElementRef`,ref:D,"onUpdate:modelValue":y[0]||=e=>x.value=e,class:`s-ui-input__control s-ui-typography-body-14-regular`,type:v.type,name:v.name,placeholder:v.placeholder,disabled:v.disabled,readonly:v.readonly,autocomplete:v.autocomplete},(0,a.unref)(C),{onFocus:y[1]||=(...e)=>(0,a.unref)(k)&&(0,a.unref)(k)(...e)}),null,16,f),[[a.vModelDynamic,x.value]])]),z.value?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,p,[(0,a.renderSlot)(i.$slots,`prepend`,{disabled:v.disabled})])):(0,a.createCommentVNode)(``,!0)],2),B.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,m,[(0,a.createVNode)((0,a.unref)(t.t),{appearance:(0,a.unref)(e.t).BARE,variant:(0,a.unref)(e.r).NEUTRAL,size:(0,a.unref)(e.n).SMALL,icon:`closeMini`,"aria-label":`Clear`,tabindex:V.value,onClick:(0,a.withModifiers)(Z,[`stop`])},null,8,[`appearance`,`variant`,`size`,`tabindex`])])):(0,a.createCommentVNode)(``,!0),H.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,h,[(0,a.renderSlot)(i.$slots,`action`,{disabled:v.disabled},()=>[v.iconRight?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(t.t),{key:0,appearance:(0,a.unref)(e.t).BARE,variant:(0,a.unref)(e.r).NEUTRAL,size:(0,a.unref)(e.n).SMALL,disabled:v.disabled,icon:v.iconRight,tabindex:-1},null,8,[`appearance`,`variant`,`size`,`disabled`,`icon`])):(0,a.createCommentVNode)(``,!0)])])):(0,a.createCommentVNode)(``,!0)])],42,c),U.value?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,g,[(0,a.renderSlot)(i.$slots,`message`,{},()=>[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(j),(e,t)=>((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(n.t),{key:`help-${t}`,message:e},null,8,[`message`]))),128)),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(M),(e,t)=>((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(n.t),{key:`error-${t}`,message:e,"validation-status":(0,a.unref)(n.n).ERROR},null,8,[`message`,`validation-status`]))),128))])])):(0,a.createCommentVNode)(``,!0)],2))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}});
1
+ const e=require("./SButton.types-UKroD-ev.cjs"),t=require("./SButton-C-z_q5CG.cjs"),n=require("./SInlineMessage-gjkMiE-W.cjs"),r=require("./SLabel-CTiOAAOu.cjs"),i=require("./useFieldMessages-CzjU0ajM.cjs");let a=require("vue"),o=require("@shtabapp/ui-kit-primitives");var s=function(e){return e.NONE=`none`,e.HORIZONTAL=`horizontal`,e.VERTICAL=`vertical`,e}({}),c=[`inert`,`aria-disabled`],l={key:0,class:`s-ui-input__prepend`},u={class:`s-ui-input__row`},d={key:0,class:`s-ui-input__prefix`},f=[`id`,`type`,`name`,`placeholder`,`disabled`,`readonly`,`autocomplete`],p={key:0,class:`s-ui-input__inline`},m={key:1,class:`s-ui-input__clear`},h={key:2,class:`s-ui-input__action`},g={key:1,class:`s-ui-input__messages`},_=16,v=(0,a.defineComponent)({inheritAttrs:!1,__name:`SInput`,props:(0,a.mergeModels)({label:{},labelProps:{},placeholder:{},helpMessages:{},errorMessages:{},bordered:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},hasValue:{type:Boolean},focused:{type:Boolean,default:!1},iconLeft:{},iconRight:{},customize:{default:()=>s.NONE},name:{},type:{default:`text`},id:{},autocomplete:{}},{modelValue:{default:``},modelModifiers:{}}),emits:(0,a.mergeModels)([`clear`,`focus`,`blur`],[`update:modelValue`]),setup(v,{expose:y,emit:b}){let x=(0,a.useModel)(v,`modelValue`),S=b,C=(0,a.useAttrs)(),w=(0,a.useSlots)(),T=(0,a.useId)(),E=(0,a.useTemplateRef)(`fieldElementRef`),D=(0,a.useTemplateRef)(`inputElementRef`),{isFocused:O,handleFocus:k,handleFocusOut:A}=i.n({isDisabled:()=>v.disabled,blurField:()=>Y(),emitFocus:e=>S(`focus`,e),emitBlur:e=>S(`blur`,e)}),{normalizedHelpMessages:j,normalizedErrorMessages:M,hasErrorMessages:N,hasHelpMessages:P}=i.t(()=>v.helpMessages,()=>v.errorMessages),F=(0,a.computed)(()=>v.id?v.id:T),I=(0,a.computed)(()=>!!(v.label||w.label)),L=(0,a.computed)(()=>!!(v.iconLeft||w.prefix)),R=(0,a.computed)(()=>v.customize===s.VERTICAL&&!!w.prepend),z=(0,a.computed)(()=>v.customize===s.HORIZONTAL&&!!w.prepend),B=(0,a.computed)(()=>!v.clearable||v.disabled||v.readonly?!1:x.value.length>0),V=(0,a.computed)(()=>{if(!O.value)return-1}),H=(0,a.computed)(()=>!!(v.iconRight||w.action)),U=(0,a.computed)(()=>!!w.message||P.value||N.value),W=(0,a.computed)(()=>v.hasValue===void 0?x.value.length>0:v.hasValue),G=(0,a.computed)(()=>({"s-ui-input--disabled":v.disabled,"s-ui-input--readonly":v.readonly})),K=(0,a.computed)(()=>[{"s-ui-input__field--bordered":v.bordered,"s-ui-input__field--borderless":!v.bordered,"s-ui-input__field--disabled":v.disabled,"s-ui-input__field--readonly":v.readonly,"s-ui-input__field--error":N.value,"s-ui-input__field--filled":W.value,"s-ui-input__field--vertical":v.customize===s.VERTICAL,"s-ui-input__field--focused":O.value||v.focused}]),q=e=>{let t=E.value;t&&t.querySelector(`.s-ui-input__control, .s-ui-select__control, .s-ui-select__search-input, [tabindex]:not([tabindex="-1"])`)?.focus(e)},J=e=>{if(w.control){q(e);return}D.value?.focus(e)},Y=()=>{if(w.control){let e=document.activeElement;e instanceof HTMLElement&&E.value?.contains(e)&&e.blur();return}D.value?.blur()},X=e=>{v.disabled||v.readonly||e.target instanceof HTMLElement&&(e.target.closest(`.s-ui-input__prepend, .s-ui-input__inline, .s-ui-input__clear, .s-ui-input__action`)||J())},Z=()=>{x.value=``,S(`clear`),J()};return y({blur:Y,focus:J,fieldElementRef:E,inputElementRef:D}),(i,y)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{class:(0,a.normalizeClass)([`s-ui-input`,G.value])},[I.value?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(r.t),(0,a.mergeProps)({key:0},v.labelProps,{"html-for":F.value}),{default:(0,a.withCtx)(()=>[(0,a.renderSlot)(i.$slots,`label`,{},()=>[(0,a.createTextVNode)((0,a.toDisplayString)(v.label),1)])]),_:3},16,[`html-for`])):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`div`,{ref_key:`fieldElementRef`,ref:E,class:(0,a.normalizeClass)([`s-ui-input__field`,K.value]),inert:v.disabled?!0:void 0,"aria-disabled":v.disabled?!0:void 0,onClick:y[2]||=e=>X(e),onFocusout:y[3]||=(...e)=>(0,a.unref)(A)&&(0,a.unref)(A)(...e)},[R.value?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,l,[(0,a.renderSlot)(i.$slots,`prepend`,{disabled:v.disabled})])):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`div`,u,[L.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,d,[(0,a.renderSlot)(i.$slots,`prefix`,{disabled:v.disabled},()=>[v.iconLeft?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(o.SIcon),{key:0,name:v.iconLeft,size:_},null,8,[`name`])):(0,a.createCommentVNode)(``,!0)])])):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`div`,{class:(0,a.normalizeClass)([`s-ui-input__control-wrap`,{"s-ui-input__control-wrap--horizontal":v.customize===(0,a.unref)(s).HORIZONTAL}])},[(0,a.renderSlot)(i.$slots,`control`,{disabled:v.disabled},()=>[(0,a.withDirectives)((0,a.createElementVNode)(`input`,(0,a.mergeProps)({id:F.value,ref_key:`inputElementRef`,ref:D,"onUpdate:modelValue":y[0]||=e=>x.value=e,class:`s-ui-input__control s-ui-typography-body-14-regular`,type:v.type,name:v.name,placeholder:v.placeholder,disabled:v.disabled,readonly:v.readonly,autocomplete:v.autocomplete},(0,a.unref)(C),{onFocus:y[1]||=(...e)=>(0,a.unref)(k)&&(0,a.unref)(k)(...e)}),null,16,f),[[a.vModelDynamic,x.value]])]),z.value?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,p,[(0,a.renderSlot)(i.$slots,`prepend`,{disabled:v.disabled})])):(0,a.createCommentVNode)(``,!0)],2),B.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,m,[(0,a.createVNode)((0,a.unref)(t.t),{appearance:(0,a.unref)(e.t).BARE,variant:(0,a.unref)(e.r).NEUTRAL,size:(0,a.unref)(e.n).SMALL,icon:`closeMini`,"aria-label":`Clear`,tabindex:V.value,onClick:(0,a.withModifiers)(Z,[`stop`])},null,8,[`appearance`,`variant`,`size`,`tabindex`])])):(0,a.createCommentVNode)(``,!0),H.value?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,h,[(0,a.renderSlot)(i.$slots,`action`,{disabled:v.disabled},()=>[v.iconRight?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(t.t),{key:0,appearance:(0,a.unref)(e.t).BARE,variant:(0,a.unref)(e.r).NEUTRAL,size:(0,a.unref)(e.n).SMALL,disabled:v.disabled,icon:v.iconRight,tabindex:-1},null,8,[`appearance`,`variant`,`size`,`disabled`,`icon`])):(0,a.createCommentVNode)(``,!0)])])):(0,a.createCommentVNode)(``,!0)])],42,c),U.value?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,g,[(0,a.renderSlot)(i.$slots,`message`,{},()=>[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(j),(e,t)=>((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(n.t),{key:`help-${t}`,message:e},null,8,[`message`]))),128)),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(M),(e,t)=>((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(n.t),{key:`error-${t}`,message:e,"validation-status":(0,a.unref)(n.n).ERROR},null,8,[`message`,`validation-status`]))),128))])])):(0,a.createCommentVNode)(``,!0)],2))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}});
@@ -1,5 +1,5 @@
1
1
  import { n as e, r as t, t as n } from "./SButton.types-CpdHQtyx.js";
2
- import { t as r } from "./SButton-D5yFE3W2.js";
2
+ import { t as r } from "./SButton-DnU_XZ1C.js";
3
3
  import { n as ee, t as i } from "./SInlineMessage-Dirk5RwO.js";
4
4
  import { t as te } from "./SLabel-yzcX4qp5.js";
5
5
  import { n as a, t as o } from "./useFieldMessages-Cb06My1W.js";