@shtabapp/ui-kit 1.27.0 → 1.28.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 (31) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/SAvatar-CRq0LG8U.cjs +1 -0
  3. package/dist/SAvatar-kB6E-fX6.js +187 -0
  4. package/dist/{SAvatarGroup-CpXYyENT.js → SAvatarGroup-Buja-Gw9.js} +1 -1
  5. package/dist/{SAvatarGroup-UZFNjjwz.cjs → SAvatarGroup-Cc4sBQjA.cjs} +1 -1
  6. package/dist/components/SAvatar/SAvatar.types.d.ts +39 -0
  7. package/dist/components/SAvatar/SAvatar.types.d.ts.map +1 -1
  8. package/dist/components/SAvatar/SAvatar.vue.d.ts.map +1 -1
  9. package/dist/components/SAvatar/SAvatarBadge.vue.d.ts +5 -0
  10. package/dist/components/SAvatar/SAvatarBadge.vue.d.ts.map +1 -0
  11. package/dist/components/SAvatar/constants/SAvatar.constants.d.ts +6 -0
  12. package/dist/components/SAvatar/constants/SAvatar.constants.d.ts.map +1 -0
  13. package/dist/components/SAvatar/index.d.ts +1 -1
  14. package/dist/components/SAvatar/index.d.ts.map +1 -1
  15. package/dist/components/SList/utils/resolveListItemFields.d.ts +1 -1
  16. package/dist/components/SList/utils/resolveListItemFields.d.ts.map +1 -1
  17. package/dist/components/SSelect/SSelect.vue.d.ts +2 -2
  18. package/dist/entries/avatar-group.cjs +1 -1
  19. package/dist/entries/avatar-group.js +1 -1
  20. package/dist/entries/avatar.cjs +1 -1
  21. package/dist/entries/avatar.d.ts +1 -1
  22. package/dist/entries/avatar.d.ts.map +1 -1
  23. package/dist/entries/avatar.js +2 -2
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +34 -34
  28. package/dist/uikit-components.css +1 -1
  29. package/package.json +2 -2
  30. package/dist/SAvatar-C9YzCOKj.cjs +0 -1
  31. package/dist/SAvatar-CGxQaW36.js +0 -87
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shtabapp/ui-kit",
3
- "version": "1.27.0",
3
+ "version": "1.28.0",
4
4
  "description": "Vue 3 component library by Shtab — 30+ typed components, design tokens, light/dark themes",
5
5
  "keywords": [
6
6
  "shtab",
@@ -218,7 +218,7 @@
218
218
  },
219
219
  "dependencies": {
220
220
  "chart.js": "^4.5.0",
221
- "@shtabapp/ui-kit-primitives": "^1.12.0",
221
+ "@shtabapp/ui-kit-primitives": "^1.14.0",
222
222
  "@shtabapp/ui-kit-tokens": "^1.14.0"
223
223
  },
224
224
  "devDependencies": {
@@ -1 +0,0 @@
1
- let e=require("vue");var t=function(e){return e.SIZE_80=`80`,e.SIZE_40=`40`,e.SIZE_32=`32`,e.SIZE_24=`24`,e.SIZE_20=`20`,e.SIZE_16=`16`,e}({}),n=function(e){return e.CIRCLE=`circle`,e.SQUARE=`square`,e}({}),r=function(e){return e.TEAL=`teal`,e.CYAN=`cyan`,e.INDIGO=`indigo`,e.VIOLET=`violet`,e.PINK=`pink`,e.SURFACE=`surface`,e}({}),i=e=>e.startsWith(`#`),a=e=>i(e)?`s-ui-avatar--color-custom`:`s-ui-avatar--color-${e}`,o=e=>({"--s-ui-avatar-background":e}),s=[`aria-disabled`],c={class:`s-ui-avatar__content`},l=[`src`,`alt`],u=[`role`,`aria-label`],d={key:0,class:`s-ui-avatar__name`},f=(0,e.defineComponent)({inheritAttrs:!1,__name:`SAvatar`,props:{alt:{},color:{default:()=>r.TEAL},disabled:{type:Boolean,default:!1},initialLength:{default:1},name:{},shape:{default:()=>n.CIRCLE},showName:{type:Boolean,default:!0},size:{default:()=>t.SIZE_40},src:{}},setup(n){let r=(0,e.useAttrs)(),f=(0,e.ref)(!1),p=e=>typeof e==`number`||typeof e==`string`,m=(0,e.computed)(()=>{if(p(r.tabindex))return r.tabindex;if(p(r.tabIndex))return r.tabIndex}),h=(0,e.computed)(()=>p(r.tabindex)||p(r.tabIndex)),g=(0,e.computed)(()=>n.disabled?-1:h.value?m.value:0),_=(0,e.computed)(()=>({...r,tabindex:g.value})),v=(0,e.computed)(()=>[`s-ui-avatar--size-${n.size}`,`s-ui-avatar--shape-${n.shape}`,a(n.color),{"s-ui-avatar--disabled":n.disabled,"s-ui-avatar--photo":n.src&&!f.value}]),y=(0,e.computed)(()=>{if(i(n.color))return o(n.color)}),b=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(``)},x=(0,e.computed)(()=>n.name?b(n.name):``),S=(0,e.computed)(()=>n.alt?n.alt:n.name?n.name:x.value),C=(0,e.computed)(()=>x.value.slice(0,Math.max(n.initialLength,0))),w={[t.SIZE_80]:`s-ui-typography-label-16-medium`,[t.SIZE_40]:`s-ui-typography-label-14-medium`,[t.SIZE_32]:`s-ui-typography-label-12-medium`,[t.SIZE_24]:`s-ui-typography-label-12-medium`,[t.SIZE_20]:`s-ui-typography-label-12-medium`,[t.SIZE_16]:`s-ui-typography-label-10-medium`},T=(0,e.computed)(()=>w[n.size]),E=()=>{f.value=!0};return(0,e.watch)(()=>n.src,()=>{f.value=!1}),(t,r)=>((0,e.openBlock)(),(0,e.createElementBlock)(`span`,(0,e.mergeProps)(_.value,{class:[`s-ui-avatar`,v.value],style:y.value,"aria-disabled":n.disabled||void 0}),[(0,e.createElementVNode)(`span`,c,[n.src&&!f.value?((0,e.openBlock)(),(0,e.createElementBlock)(`img`,{key:0,class:`s-ui-avatar__image`,src:n.src,alt:S.value,onError:E},null,40,l)):((0,e.openBlock)(),(0,e.createElementBlock)(`span`,{key:1,class:(0,e.normalizeClass)([`s-ui-avatar__initials`,T.value]),role:n.alt?`img`:void 0,"aria-label":n.alt},(0,e.toDisplayString)(C.value),11,u))]),n.showName&&n.name?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,d,(0,e.toDisplayString)(n.name),1)):(0,e.createCommentVNode)(``,!0)],16,s))}});Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
@@ -1,87 +0,0 @@
1
- import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, mergeProps as a, normalizeClass as o, openBlock as s, ref as c, toDisplayString as l, useAttrs as u, watch as d } from "vue";
2
- //#region src/components/SAvatar/SAvatar.types.ts
3
- var f = /* @__PURE__ */ function(e) {
4
- return e.SIZE_80 = "80", e.SIZE_40 = "40", e.SIZE_32 = "32", e.SIZE_24 = "24", e.SIZE_20 = "20", e.SIZE_16 = "16", e;
5
- }({}), p = /* @__PURE__ */ function(e) {
6
- return e.CIRCLE = "circle", e.SQUARE = "square", e;
7
- }({}), m = /* @__PURE__ */ function(e) {
8
- return e.TEAL = "teal", e.CYAN = "cyan", e.INDIGO = "indigo", e.VIOLET = "violet", e.PINK = "pink", e.SURFACE = "surface", e;
9
- }({}), h = (e) => e.startsWith("#"), g = (e) => h(e) ? "s-ui-avatar--color-custom" : `s-ui-avatar--color-${e}`, _ = (e) => ({ "--s-ui-avatar-background": e }), v = ["aria-disabled"], y = { class: "s-ui-avatar__content" }, b = ["src", "alt"], x = ["role", "aria-label"], S = {
10
- key: 0,
11
- class: "s-ui-avatar__name"
12
- }, C = /* @__PURE__ */ i({
13
- inheritAttrs: !1,
14
- __name: "SAvatar",
15
- props: {
16
- alt: {},
17
- color: { default: () => m.TEAL },
18
- disabled: {
19
- type: Boolean,
20
- default: !1
21
- },
22
- initialLength: { default: 1 },
23
- name: {},
24
- shape: { default: () => p.CIRCLE },
25
- showName: {
26
- type: Boolean,
27
- default: !0
28
- },
29
- size: { default: () => f.SIZE_40 },
30
- src: {}
31
- },
32
- setup(i) {
33
- let p = u(), m = c(!1), C = (e) => typeof e == "number" || typeof e == "string", w = e(() => {
34
- if (C(p.tabindex)) return p.tabindex;
35
- if (C(p.tabIndex)) return p.tabIndex;
36
- }), T = e(() => C(p.tabindex) || C(p.tabIndex)), E = e(() => i.disabled ? -1 : T.value ? w.value : 0), D = e(() => ({
37
- ...p,
38
- tabindex: E.value
39
- })), O = e(() => [
40
- `s-ui-avatar--size-${i.size}`,
41
- `s-ui-avatar--shape-${i.shape}`,
42
- g(i.color),
43
- {
44
- "s-ui-avatar--disabled": i.disabled,
45
- "s-ui-avatar--photo": i.src && !m.value
46
- }
47
- ]), k = e(() => {
48
- if (h(i.color)) return _(i.color);
49
- }), A = (e) => {
50
- let t = e.split(/\s+/).filter(Boolean);
51
- if (t.length === 1) {
52
- let e = t[0];
53
- if (e) return e;
54
- }
55
- return t.map((e) => e.slice(0, 1)).join("");
56
- }, j = e(() => i.name ? A(i.name) : ""), M = e(() => i.alt ? i.alt : i.name ? i.name : j.value), N = e(() => j.value.slice(0, Math.max(i.initialLength, 0))), P = {
57
- [f.SIZE_80]: "s-ui-typography-label-16-medium",
58
- [f.SIZE_40]: "s-ui-typography-label-14-medium",
59
- [f.SIZE_32]: "s-ui-typography-label-12-medium",
60
- [f.SIZE_24]: "s-ui-typography-label-12-medium",
61
- [f.SIZE_20]: "s-ui-typography-label-12-medium",
62
- [f.SIZE_16]: "s-ui-typography-label-10-medium"
63
- }, F = e(() => P[i.size]), I = () => {
64
- m.value = !0;
65
- };
66
- return d(() => i.src, () => {
67
- m.value = !1;
68
- }), (e, c) => (s(), n("span", a(D.value, {
69
- class: ["s-ui-avatar", O.value],
70
- style: k.value,
71
- "aria-disabled": i.disabled || void 0
72
- }), [r("span", y, [i.src && !m.value ? (s(), n("img", {
73
- key: 0,
74
- class: "s-ui-avatar__image",
75
- src: i.src,
76
- alt: M.value,
77
- onError: I
78
- }, null, 40, b)) : (s(), n("span", {
79
- key: 1,
80
- class: o(["s-ui-avatar__initials", F.value]),
81
- role: i.alt ? "img" : void 0,
82
- "aria-label": i.alt
83
- }, l(N.value), 11, x))]), i.showName && i.name ? (s(), n("span", S, l(i.name), 1)) : t("", !0)], 16, v));
84
- }
85
- });
86
- //#endregion
87
- export { f as i, m as n, p as r, C as t };