@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.
- package/CHANGELOG.md +12 -0
- package/dist/SAvatar-BS9Lu2eL.js +249 -0
- package/dist/SAvatar-BXABKIV0.cjs +1 -0
- package/dist/{SAvatarGroup-Cc4sBQjA.cjs → SAvatarGroup-CMa9KhUZ.cjs} +1 -1
- package/dist/{SAvatarGroup-Buja-Gw9.js → SAvatarGroup-wkXHy_tK.js} +1 -1
- package/dist/SBadge-BDxQJh6c.js +83 -0
- package/dist/SBadge-d1GOPFP-.cjs +1 -0
- package/dist/SButton-C-z_q5CG.cjs +1 -0
- package/dist/SButton-DnU_XZ1C.js +223 -0
- package/dist/{SInput-Bno-hQ-b.cjs → SInput-DYS84eMS.cjs} +1 -1
- package/dist/{SInput-W2257ZAC.js → SInput-iNlzBX5m.js} +1 -1
- package/dist/{SList-D-J6fBrQ.cjs → SList-CU2Sy9Md.cjs} +1 -1
- package/dist/{SList-9BpZD3aT.js → SList-C_S9ej45.js} +2 -2
- package/dist/{SListItem-BAWj5_pk.js → SListItem-BD7wvCNe.js} +11 -11
- package/dist/{SListItem-4OTUkahk.cjs → SListItem-BDkldLVt.cjs} +1 -1
- package/dist/{SSelect-DADK22v2.cjs → SSelect-CTxBjl2J.cjs} +1 -1
- package/dist/{SSelect-DFkWwUc1.js → SSelect-MzZwivEY.js} +70 -70
- package/dist/{STabs-DLFs7km7.cjs → STabs-C6QQnCZd.cjs} +1 -1
- package/dist/{STabs-Cfv9NIJe.js → STabs-Ce7tHq8T.js} +10 -10
- package/dist/{STag-ZPesEPB4.js → STag-CYoj7L-p.js} +8 -8
- package/dist/{STag-DlVk53Cn.cjs → STag-DVrSWByQ.cjs} +1 -1
- package/dist/{STagGroup-C3-hAyGi.js → STagGroup-B2-_OG3R.js} +1 -1
- package/dist/{STagGroup-C4qL3p57.cjs → STagGroup-BMyuxfVX.cjs} +1 -1
- package/dist/components/SAvatar/SAvatar.types.d.ts +2 -0
- package/dist/components/SAvatar/SAvatar.types.d.ts.map +1 -1
- package/dist/components/SAvatar/SAvatar.vue.d.ts.map +1 -1
- package/dist/components/SAvatar/utils/useAvatarBadge.d.ts +13 -0
- package/dist/components/SAvatar/utils/useAvatarBadge.d.ts.map +1 -0
- package/dist/components/SBadge/SBadge.types.d.ts +15 -0
- package/dist/components/SBadge/SBadge.types.d.ts.map +1 -1
- package/dist/components/SBadge/SBadge.vue.d.ts.map +1 -1
- package/dist/components/SBadge/index.d.ts +1 -1
- package/dist/components/SBadge/index.d.ts.map +1 -1
- package/dist/components/SButton/SButton.types.d.ts +7 -0
- package/dist/components/SButton/SButton.types.d.ts.map +1 -1
- package/dist/components/SButton/SButton.vue.d.ts.map +1 -1
- package/dist/components/SButton/utils/useButtonBadge.d.ts +21 -0
- package/dist/components/SButton/utils/useButtonBadge.d.ts.map +1 -0
- package/dist/components/SList/utils/resolveListItemFields.d.ts +1 -1
- package/dist/components/SList/utils/resolveListItemFields.d.ts.map +1 -1
- package/dist/entries/avatar-group.cjs +1 -1
- package/dist/entries/avatar-group.js +1 -1
- package/dist/entries/avatar.cjs +1 -1
- package/dist/entries/avatar.js +1 -1
- package/dist/entries/badge.cjs +1 -1
- package/dist/entries/badge.js +1 -1
- package/dist/entries/button.cjs +1 -1
- package/dist/entries/button.js +1 -1
- package/dist/entries/input.cjs +1 -1
- package/dist/entries/input.js +1 -1
- package/dist/entries/list-item.cjs +1 -1
- package/dist/entries/list-item.js +1 -1
- package/dist/entries/list.cjs +1 -1
- package/dist/entries/list.js +1 -1
- package/dist/entries/select.cjs +1 -1
- package/dist/entries/select.js +1 -1
- package/dist/entries/tabs.cjs +1 -1
- package/dist/entries/tabs.js +1 -1
- package/dist/entries/tag-group.cjs +1 -1
- package/dist/entries/tag-group.js +2 -2
- package/dist/entries/tag.cjs +1 -1
- package/dist/entries/tag.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +24 -24
- package/dist/uikit-components.css +1 -1
- package/package.json +3 -3
- package/dist/SAvatar-CRq0LG8U.cjs +0 -1
- package/dist/SAvatar-kB6E-fX6.js +0 -187
- package/dist/SBadge-BQFJFZtw.cjs +0 -1
- package/dist/SBadge-CcCknHTw.js +0 -43
- package/dist/SButton-CHxE2l-X.cjs +0 -1
- package/dist/SButton-D5yFE3W2.js +0 -156
- package/dist/components/SAvatar/SAvatarBadge.vue.d.ts +0 -5
- package/dist/components/SAvatar/SAvatarBadge.vue.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shtabapp/ui-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.30.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,8 +218,8 @@
|
|
|
218
218
|
},
|
|
219
219
|
"dependencies": {
|
|
220
220
|
"chart.js": "^4.5.0",
|
|
221
|
-
"@shtabapp/ui-kit-primitives": "^1.
|
|
222
|
-
"@shtabapp/ui-kit-tokens": "^1.
|
|
221
|
+
"@shtabapp/ui-kit-primitives": "^1.15.0",
|
|
222
|
+
"@shtabapp/ui-kit-tokens": "^1.15.0"
|
|
223
223
|
},
|
|
224
224
|
"devDependencies": {
|
|
225
225
|
"@storybook/vue3-vite": "^10.4.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e=require("vue"),t=require("@shtabapp/ui-kit-primitives");var n=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.8432%204.68368C17.1178%204.39139%2017.5777%204.37698%2017.87%204.65154C18.1623%204.92611%2018.1767%205.38606%2017.9022%205.67836L8.48261%2015.5803C8.34546%2015.7262%208.15429%2015.809%207.95407%2015.8091C7.75368%2015.8091%207.56183%2015.7263%207.42459%2015.5803L1.9671%209.77108C1.69255%209.47878%201.70696%209.01883%201.99925%208.74426C2.29155%208.4697%202.7515%208.48411%203.02607%208.7764L7.95313%2014.0221L16.8432%204.68368Z'%20fill='currentColor'/%3e%3cpath%20d='M16.5%204.36284C16.9523%203.88141%2017.7106%203.8557%2018.1923%204.30773C18.6737%204.76002%2018.6972%205.51837%2018.2451%206L8.82637%2015.9032C8.60063%2016.1428%208.2835%2016.2797%207.95383%2016.2798C7.62409%2016.2797%207.30753%2016.1439%207.08128%2015.9032L1.6233%2010.0939C1.17096%209.61231%201.19687%208.85401%201.6784%208.40166C2.15998%207.94983%202.91615%207.97328%203.36838%208.45447L7.95153%2013.3338L16.5%204.36284ZM17.5471%204.99428C17.4441%204.89817%2017.2832%204.90315%2017.1866%205.00576L8.29596%2014.3441C8.20723%2014.4386%208.08339%2014.4932%207.95383%2014.4934C7.824%2014.4934%207.69828%2014.4388%207.6094%2014.3441L2.68412%209.0974C2.58752%208.99469%202.4243%208.98983%202.32133%209.08592C2.21838%209.18263%202.21334%209.34572%202.30985%209.44871L7.76784%2015.258C7.81594%2015.3091%207.8831%2015.3383%207.95383%2015.3384C8.02411%2015.3383%208.09131%2015.3096%208.13982%2015.258L17.5585%205.35708C17.6312%205.27976%2017.6473%205.16832%2017.6068%205.07695L17.5471%204.99428Z'%20fill='currentColor'/%3e%3c/svg%3e`,r=`data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.7772%2010C16.7772%206.25708%2013.743%203.22282%2010%203.22282C8.33943%203.22282%206.81926%203.81952%205.64038%204.81123L15.3637%2014.1394C16.2492%2012.9939%2016.7772%2011.5597%2016.7772%2010ZM3.22278%2010C3.22278%2013.743%206.25705%2016.7773%2010%2016.7773C11.6605%2016.7773%2013.1798%2016.1796%2014.3587%2015.1879L4.63533%205.85977C3.74982%207.00522%203.22278%208.4403%203.22278%2010ZM18.2295%2010C18.2295%2012.2109%2017.3569%2014.2196%2015.9386%2015.6975C14.4418%2017.2572%2012.3337%2018.2295%2010%2018.2295C5.45498%2018.2295%201.77052%2014.5451%201.77052%2010C1.77052%207.78918%202.64314%205.78051%204.06142%204.30256C5.55821%202.74284%207.66627%201.77056%2010%201.77056C14.545%201.77056%2018.2295%205.45502%2018.2295%2010Z'%20fill='currentColor'/%3e%3cpath%20d='M17.7588%2010C17.7588%205.71474%2014.2853%202.24127%2010%202.24127C7.79957%202.24127%205.81142%203.15815%204.39964%204.62929C3.06266%206.02308%202.24124%207.9159%202.24124%2010C2.24124%2014.2853%205.7147%2017.7588%2010%2017.7588C12.2004%2017.7588%2014.1886%2016.8419%2015.6004%2015.3708C16.9373%2013.977%2017.7588%2012.0842%2017.7588%2010ZM4.9599%205.52021L14.6842%2014.8496L15.0608%2015.2101L14.6612%2015.5476C13.401%2016.6077%2011.7756%2017.2468%2010%2017.2468C5.99733%2017.2468%202.75328%2014.0027%202.75328%2010C2.75328%208.33248%203.31738%206.79777%204.26416%205.57302L4.58333%205.15741L4.9599%205.52021ZM16.3076%2010C16.3076%206.5168%2013.4832%203.69245%2010%203.69245C8.64349%203.69245%207.3891%204.12123%206.36057%204.84972L15.295%2013.4213C15.9342%2012.4354%2016.3076%2011.2627%2016.3076%2010ZM3.69242%2010C3.69242%2013.4833%206.51676%2016.3076%2010%2016.3076C11.3562%2016.3076%2012.6087%2015.8767%2013.6371%2015.1481L4.70273%206.57645C4.06363%207.56245%203.69242%208.737%203.69242%2010ZM17.2467%2010C17.2467%2011.6679%2016.6824%2013.2025%2015.7358%2014.4271L15.4167%2014.8404L4.93694%204.78773L5.33877%204.45249C6.59924%203.39218%208.22467%202.75332%2010%202.75332C14.0027%202.75332%2017.2467%205.99737%2017.2467%2010ZM18.7002%2010C18.7002%2012.337%2017.7766%2014.4609%2016.2777%2016.0229C14.696%2017.6712%2012.467%2018.7002%2010%2018.7002C5.19527%2018.7002%201.2998%2014.8048%201.2998%2010C1.2998%207.66305%202.22335%205.53918%203.72227%203.97718C5.30405%202.32889%207.53297%201.29984%2010%201.29984C14.8047%201.29984%2018.7002%205.19531%2018.7002%2010Z'%20fill='currentColor'/%3e%3c/svg%3e`,i=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}({}),a=function(e){return e.CIRCLE=`circle`,e.SQUARE=`square`,e}({}),o=function(e){return e.TEAL=`teal`,e.CYAN=`cyan`,e.INDIGO=`indigo`,e.VIOLET=`violet`,e.PINK=`pink`,e.SURFACE=`surface`,e}({}),s=function(e){return e.NEUTRAL=`neutral`,e.MAIN=`main`,e}({}),c=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}({}),l=function(e){return e.SMALL=`s`,e.MEDIUM=`m`,e.LARGE=`l`,e}({}),u={key:0,class:`s-ui-avatar-badge__dot`},d=16,f=(0,e.defineComponent)({__name:`SAvatarBadge`,props:{badge:{},size:{}},setup(i){let a=[c.DEFAULT,c.ONLINE,c.OFFLINE,c.RECENTLY,c.ERROR],o={[c.TRACK]:t.ESIconName.playFill,[c.CONTROLLER]:t.ESIconName.controlFill,[c.FAVORITE]:t.ESIconName.starFill,[c.PIN]:t.ESIconName.pinFill},s={[c.DONE]:n,[c.PRIVATE]:r},l=(0,e.computed)(()=>i.badge?[`s-ui-avatar-badge--size-${i.size}`,`s-ui-avatar-badge--type-${i.badge}`]:[]),f=(0,e.computed)(()=>i.badge?a.includes(i.badge):!1),p=(0,e.computed)(()=>i.badge&&s[i.badge]||``),m=(0,e.computed)(()=>p.value?{"--s-ui-avatar-badge-local-icon-url":`url("${p.value}")`}:{}),h=(0,e.computed)(()=>i.badge&&o[i.badge]||t.ESIconName.circleMiniFill);return(n,r)=>i.badge?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,{key:0,class:(0,e.normalizeClass)([`s-ui-avatar-badge`,l.value]),"aria-hidden":`true`},[f.value?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,u)):p.value?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,{key:1,class:`s-ui-avatar-badge__local-icon`,style:(0,e.normalizeStyle)(m.value)},null,4)):((0,e.openBlock)(),(0,e.createBlock)((0,e.unref)(t.SIcon),{key:2,class:`s-ui-avatar-badge__icon`,name:h.value,size:d},null,8,[`name`]))],2)):(0,e.createCommentVNode)(``,!0)}}),p=e=>e.startsWith(`#`),m=e=>p(e)?`s-ui-avatar--color-custom`:`s-ui-avatar--color-${e}`,h=e=>({"--s-ui-avatar-background":e}),g={[i.SIZE_80]:`s-ui-typography-heading-h3-semibold`,[i.SIZE_72]:`s-ui-typography-heading-h4-semibold`,[i.SIZE_64]:`s-ui-typography-heading-h4-semibold`,[i.SIZE_56]:`s-ui-typography-label-16-medium`,[i.SIZE_48]:`s-ui-typography-label-16-medium`,[i.SIZE_40]:`s-ui-typography-label-16-medium`,[i.SIZE_32]:`s-ui-typography-label-14-medium`,[i.SIZE_24]:`s-ui-typography-label-12-medium`,[i.SIZE_20]:`s-ui-typography-label-12-medium`,[i.SIZE_16]:`s-ui-typography-label-10-medium`},_={[i.SIZE_80]:40,[i.SIZE_72]:40,[i.SIZE_64]:40,[i.SIZE_56]:32,[i.SIZE_48]:32,[i.SIZE_40]:24,[i.SIZE_32]:24,[i.SIZE_24]:20,[i.SIZE_20]:16,[i.SIZE_16]:16},v={[i.SIZE_80]:l.LARGE,[i.SIZE_72]:l.LARGE,[i.SIZE_64]:l.MEDIUM,[i.SIZE_56]:l.MEDIUM,[i.SIZE_48]:l.SMALL,[i.SIZE_40]:l.SMALL,[i.SIZE_32]:l.SMALL,[i.SIZE_24]:l.SMALL,[i.SIZE_20]:l.SMALL,[i.SIZE_16]:l.SMALL},y=[`aria-disabled`],b={class:`s-ui-avatar__content`},x=[`src`,`alt`],S={key:1,class:`s-ui-avatar__icon`},C=[`role`,`aria-label`],w={key:0,class:`s-ui-avatar__name`},T=(0,e.defineComponent)({inheritAttrs:!1,__name:`SAvatar`,props:{alt:{},badge:{},bordered:{type:Boolean,default:!0},color:{default:()=>o.TEAL},disabled:{type:Boolean,default:!1},icon:{},iconBackground:{default:()=>s.NEUTRAL},initialLength:{default:1},name:{},shape:{default:()=>a.CIRCLE},showName:{type:Boolean,default:!0},size:{default:()=>i.SIZE_40},src:{}},setup(n){let r=(0,e.useAttrs)(),i=(0,e.ref)(!1),a=e=>typeof e==`number`||typeof e==`string`,o=(0,e.computed)(()=>{if(a(r.tabindex))return r.tabindex;if(a(r.tabIndex))return r.tabIndex}),s=(0,e.computed)(()=>a(r.tabindex)||a(r.tabIndex)),c=(0,e.computed)(()=>n.disabled?-1:s.value?o.value:0),l=(0,e.computed)(()=>({...r,tabindex:c.value})),u=(0,e.computed)(()=>[`s-ui-avatar--size-${n.size}`,`s-ui-avatar--shape-${n.shape}`,m(n.color),`s-ui-avatar--icon-background-${n.iconBackground}`,{"s-ui-avatar--bordered":n.bordered,"s-ui-avatar--disabled":n.disabled,"s-ui-avatar--icon":E.value,"s-ui-avatar--photo":T.value}]),d=(0,e.computed)(()=>{if(!E.value&&p(n.color))return h(n.color)}),T=(0,e.computed)(()=>!!(n.src&&!i.value)),E=(0,e.computed)(()=>!!(!T.value&&n.icon)),D=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(``)},O=(0,e.computed)(()=>n.name?D(n.name):``),k=(0,e.computed)(()=>n.alt?n.alt:n.name?n.name:O.value),A=(0,e.computed)(()=>{if(n.alt)return n.alt;if(n.name)return n.name}),j=(0,e.computed)(()=>O.value.slice(0,Math.max(n.initialLength,0))),M=(0,e.computed)(()=>g[n.size]),N=(0,e.computed)(()=>_[n.size]),P=(0,e.computed)(()=>v[n.size]),F=()=>{i.value=!0};return(0,e.watch)(()=>n.src,()=>{i.value=!1}),(r,a)=>((0,e.openBlock)(),(0,e.createElementBlock)(`span`,(0,e.mergeProps)(l.value,{class:[`s-ui-avatar`,u.value],style:d.value,"aria-disabled":n.disabled||void 0}),[(0,e.createElementVNode)(`span`,b,[n.src&&!i.value?((0,e.openBlock)(),(0,e.createElementBlock)(`img`,{key:0,class:`s-ui-avatar__image`,src:n.src,alt:k.value,onError:F},null,40,x)):n.icon?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,S,[(0,e.createVNode)((0,e.unref)(t.SIcon),{name:n.icon,size:N.value,"aria-label":A.value},null,8,[`name`,`size`,`aria-label`])])):((0,e.openBlock)(),(0,e.createElementBlock)(`span`,{key:2,class:(0,e.normalizeClass)([`s-ui-avatar__initials`,M.value]),role:n.alt?`img`:void 0,"aria-label":n.alt},(0,e.toDisplayString)(j.value),11,C)),(0,e.createVNode)(f,{badge:n.badge,size:P.value},null,8,[`badge`,`size`])]),n.showName&&n.name?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,w,(0,e.toDisplayString)(n.name),1)):(0,e.createCommentVNode)(``,!0)],16,y))}});Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return T}});
|
package/dist/SAvatar-kB6E-fX6.js
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, mergeProps as s, normalizeClass as c, normalizeStyle as l, openBlock as u, ref as d, toDisplayString as f, unref as p, useAttrs as m, watch as h } from "vue";
|
|
2
|
-
import { ESIconName as g, SIcon as _ } from "@shtabapp/ui-kit-primitives";
|
|
3
|
-
//#region src/components/SAvatar/icons/checkBold.svg
|
|
4
|
-
var v = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.8432%204.68368C17.1178%204.39139%2017.5777%204.37698%2017.87%204.65154C18.1623%204.92611%2018.1767%205.38606%2017.9022%205.67836L8.48261%2015.5803C8.34546%2015.7262%208.15429%2015.809%207.95407%2015.8091C7.75368%2015.8091%207.56183%2015.7263%207.42459%2015.5803L1.9671%209.77108C1.69255%209.47878%201.70696%209.01883%201.99925%208.74426C2.29155%208.4697%202.7515%208.48411%203.02607%208.7764L7.95313%2014.0221L16.8432%204.68368Z'%20fill='currentColor'/%3e%3cpath%20d='M16.5%204.36284C16.9523%203.88141%2017.7106%203.8557%2018.1923%204.30773C18.6737%204.76002%2018.6972%205.51837%2018.2451%206L8.82637%2015.9032C8.60063%2016.1428%208.2835%2016.2797%207.95383%2016.2798C7.62409%2016.2797%207.30753%2016.1439%207.08128%2015.9032L1.6233%2010.0939C1.17096%209.61231%201.19687%208.85401%201.6784%208.40166C2.15998%207.94983%202.91615%207.97328%203.36838%208.45447L7.95153%2013.3338L16.5%204.36284ZM17.5471%204.99428C17.4441%204.89817%2017.2832%204.90315%2017.1866%205.00576L8.29596%2014.3441C8.20723%2014.4386%208.08339%2014.4932%207.95383%2014.4934C7.824%2014.4934%207.69828%2014.4388%207.6094%2014.3441L2.68412%209.0974C2.58752%208.99469%202.4243%208.98983%202.32133%209.08592C2.21838%209.18263%202.21334%209.34572%202.30985%209.44871L7.76784%2015.258C7.81594%2015.3091%207.8831%2015.3383%207.95383%2015.3384C8.02411%2015.3383%208.09131%2015.3096%208.13982%2015.258L17.5585%205.35708C17.6312%205.27976%2017.6473%205.16832%2017.6068%205.07695L17.5471%204.99428Z'%20fill='currentColor'/%3e%3c/svg%3e", y = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.7772%2010C16.7772%206.25708%2013.743%203.22282%2010%203.22282C8.33943%203.22282%206.81926%203.81952%205.64038%204.81123L15.3637%2014.1394C16.2492%2012.9939%2016.7772%2011.5597%2016.7772%2010ZM3.22278%2010C3.22278%2013.743%206.25705%2016.7773%2010%2016.7773C11.6605%2016.7773%2013.1798%2016.1796%2014.3587%2015.1879L4.63533%205.85977C3.74982%207.00522%203.22278%208.4403%203.22278%2010ZM18.2295%2010C18.2295%2012.2109%2017.3569%2014.2196%2015.9386%2015.6975C14.4418%2017.2572%2012.3337%2018.2295%2010%2018.2295C5.45498%2018.2295%201.77052%2014.5451%201.77052%2010C1.77052%207.78918%202.64314%205.78051%204.06142%204.30256C5.55821%202.74284%207.66627%201.77056%2010%201.77056C14.545%201.77056%2018.2295%205.45502%2018.2295%2010Z'%20fill='currentColor'/%3e%3cpath%20d='M17.7588%2010C17.7588%205.71474%2014.2853%202.24127%2010%202.24127C7.79957%202.24127%205.81142%203.15815%204.39964%204.62929C3.06266%206.02308%202.24124%207.9159%202.24124%2010C2.24124%2014.2853%205.7147%2017.7588%2010%2017.7588C12.2004%2017.7588%2014.1886%2016.8419%2015.6004%2015.3708C16.9373%2013.977%2017.7588%2012.0842%2017.7588%2010ZM4.9599%205.52021L14.6842%2014.8496L15.0608%2015.2101L14.6612%2015.5476C13.401%2016.6077%2011.7756%2017.2468%2010%2017.2468C5.99733%2017.2468%202.75328%2014.0027%202.75328%2010C2.75328%208.33248%203.31738%206.79777%204.26416%205.57302L4.58333%205.15741L4.9599%205.52021ZM16.3076%2010C16.3076%206.5168%2013.4832%203.69245%2010%203.69245C8.64349%203.69245%207.3891%204.12123%206.36057%204.84972L15.295%2013.4213C15.9342%2012.4354%2016.3076%2011.2627%2016.3076%2010ZM3.69242%2010C3.69242%2013.4833%206.51676%2016.3076%2010%2016.3076C11.3562%2016.3076%2012.6087%2015.8767%2013.6371%2015.1481L4.70273%206.57645C4.06363%207.56245%203.69242%208.737%203.69242%2010ZM17.2467%2010C17.2467%2011.6679%2016.6824%2013.2025%2015.7358%2014.4271L15.4167%2014.8404L4.93694%204.78773L5.33877%204.45249C6.59924%203.39218%208.22467%202.75332%2010%202.75332C14.0027%202.75332%2017.2467%205.99737%2017.2467%2010ZM18.7002%2010C18.7002%2012.337%2017.7766%2014.4609%2016.2777%2016.0229C14.696%2017.6712%2012.467%2018.7002%2010%2018.7002C5.19527%2018.7002%201.2998%2014.8048%201.2998%2010C1.2998%207.66305%202.22335%205.53918%203.72227%203.97718C5.30405%202.32889%207.53297%201.29984%2010%201.29984C14.8047%201.29984%2018.7002%205.19531%2018.7002%2010Z'%20fill='currentColor'/%3e%3c/svg%3e", b = /* @__PURE__ */ function(e) {
|
|
5
|
-
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;
|
|
6
|
-
}({}), x = /* @__PURE__ */ function(e) {
|
|
7
|
-
return e.CIRCLE = "circle", e.SQUARE = "square", e;
|
|
8
|
-
}({}), S = /* @__PURE__ */ function(e) {
|
|
9
|
-
return e.TEAL = "teal", e.CYAN = "cyan", e.INDIGO = "indigo", e.VIOLET = "violet", e.PINK = "pink", e.SURFACE = "surface", e;
|
|
10
|
-
}({}), C = /* @__PURE__ */ function(e) {
|
|
11
|
-
return e.NEUTRAL = "neutral", e.MAIN = "main", e;
|
|
12
|
-
}({}), w = /* @__PURE__ */ function(e) {
|
|
13
|
-
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;
|
|
14
|
-
}({}), T = /* @__PURE__ */ function(e) {
|
|
15
|
-
return e.SMALL = "s", e.MEDIUM = "m", e.LARGE = "l", e;
|
|
16
|
-
}({}), E = {
|
|
17
|
-
key: 0,
|
|
18
|
-
class: "s-ui-avatar-badge__dot"
|
|
19
|
-
}, D = 16, O = /* @__PURE__ */ o({
|
|
20
|
-
__name: "SAvatarBadge",
|
|
21
|
-
props: {
|
|
22
|
-
badge: {},
|
|
23
|
-
size: {}
|
|
24
|
-
},
|
|
25
|
-
setup(i) {
|
|
26
|
-
let a = [
|
|
27
|
-
w.DEFAULT,
|
|
28
|
-
w.ONLINE,
|
|
29
|
-
w.OFFLINE,
|
|
30
|
-
w.RECENTLY,
|
|
31
|
-
w.ERROR
|
|
32
|
-
], o = {
|
|
33
|
-
[w.TRACK]: g.playFill,
|
|
34
|
-
[w.CONTROLLER]: g.controlFill,
|
|
35
|
-
[w.FAVORITE]: g.starFill,
|
|
36
|
-
[w.PIN]: g.pinFill
|
|
37
|
-
}, s = {
|
|
38
|
-
[w.DONE]: v,
|
|
39
|
-
[w.PRIVATE]: y
|
|
40
|
-
}, d = e(() => i.badge ? [`s-ui-avatar-badge--size-${i.size}`, `s-ui-avatar-badge--type-${i.badge}`] : []), f = e(() => i.badge ? a.includes(i.badge) : !1), m = e(() => i.badge && s[i.badge] || ""), h = e(() => m.value ? { "--s-ui-avatar-badge-local-icon-url": `url("${m.value}")` } : {}), b = e(() => i.badge && o[i.badge] || g.circleMiniFill);
|
|
41
|
-
return (e, a) => i.badge ? (u(), r("span", {
|
|
42
|
-
key: 0,
|
|
43
|
-
class: c(["s-ui-avatar-badge", d.value]),
|
|
44
|
-
"aria-hidden": "true"
|
|
45
|
-
}, [f.value ? (u(), r("span", E)) : m.value ? (u(), r("span", {
|
|
46
|
-
key: 1,
|
|
47
|
-
class: "s-ui-avatar-badge__local-icon",
|
|
48
|
-
style: l(h.value)
|
|
49
|
-
}, null, 4)) : (u(), t(p(_), {
|
|
50
|
-
key: 2,
|
|
51
|
-
class: "s-ui-avatar-badge__icon",
|
|
52
|
-
name: b.value,
|
|
53
|
-
size: D
|
|
54
|
-
}, null, 8, ["name"]))], 2)) : n("", !0);
|
|
55
|
-
}
|
|
56
|
-
}), k = (e) => e.startsWith("#"), A = (e) => k(e) ? "s-ui-avatar--color-custom" : `s-ui-avatar--color-${e}`, j = (e) => ({ "--s-ui-avatar-background": e }), M = {
|
|
57
|
-
[b.SIZE_80]: "s-ui-typography-heading-h3-semibold",
|
|
58
|
-
[b.SIZE_72]: "s-ui-typography-heading-h4-semibold",
|
|
59
|
-
[b.SIZE_64]: "s-ui-typography-heading-h4-semibold",
|
|
60
|
-
[b.SIZE_56]: "s-ui-typography-label-16-medium",
|
|
61
|
-
[b.SIZE_48]: "s-ui-typography-label-16-medium",
|
|
62
|
-
[b.SIZE_40]: "s-ui-typography-label-16-medium",
|
|
63
|
-
[b.SIZE_32]: "s-ui-typography-label-14-medium",
|
|
64
|
-
[b.SIZE_24]: "s-ui-typography-label-12-medium",
|
|
65
|
-
[b.SIZE_20]: "s-ui-typography-label-12-medium",
|
|
66
|
-
[b.SIZE_16]: "s-ui-typography-label-10-medium"
|
|
67
|
-
}, N = {
|
|
68
|
-
[b.SIZE_80]: 40,
|
|
69
|
-
[b.SIZE_72]: 40,
|
|
70
|
-
[b.SIZE_64]: 40,
|
|
71
|
-
[b.SIZE_56]: 32,
|
|
72
|
-
[b.SIZE_48]: 32,
|
|
73
|
-
[b.SIZE_40]: 24,
|
|
74
|
-
[b.SIZE_32]: 24,
|
|
75
|
-
[b.SIZE_24]: 20,
|
|
76
|
-
[b.SIZE_20]: 16,
|
|
77
|
-
[b.SIZE_16]: 16
|
|
78
|
-
}, P = {
|
|
79
|
-
[b.SIZE_80]: T.LARGE,
|
|
80
|
-
[b.SIZE_72]: T.LARGE,
|
|
81
|
-
[b.SIZE_64]: T.MEDIUM,
|
|
82
|
-
[b.SIZE_56]: T.MEDIUM,
|
|
83
|
-
[b.SIZE_48]: T.SMALL,
|
|
84
|
-
[b.SIZE_40]: T.SMALL,
|
|
85
|
-
[b.SIZE_32]: T.SMALL,
|
|
86
|
-
[b.SIZE_24]: T.SMALL,
|
|
87
|
-
[b.SIZE_20]: T.SMALL,
|
|
88
|
-
[b.SIZE_16]: T.SMALL
|
|
89
|
-
}, F = ["aria-disabled"], I = { class: "s-ui-avatar__content" }, L = ["src", "alt"], R = {
|
|
90
|
-
key: 1,
|
|
91
|
-
class: "s-ui-avatar__icon"
|
|
92
|
-
}, z = ["role", "aria-label"], B = {
|
|
93
|
-
key: 0,
|
|
94
|
-
class: "s-ui-avatar__name"
|
|
95
|
-
}, V = /* @__PURE__ */ o({
|
|
96
|
-
inheritAttrs: !1,
|
|
97
|
-
__name: "SAvatar",
|
|
98
|
-
props: {
|
|
99
|
-
alt: {},
|
|
100
|
-
badge: {},
|
|
101
|
-
bordered: {
|
|
102
|
-
type: Boolean,
|
|
103
|
-
default: !0
|
|
104
|
-
},
|
|
105
|
-
color: { default: () => S.TEAL },
|
|
106
|
-
disabled: {
|
|
107
|
-
type: Boolean,
|
|
108
|
-
default: !1
|
|
109
|
-
},
|
|
110
|
-
icon: {},
|
|
111
|
-
iconBackground: { default: () => C.NEUTRAL },
|
|
112
|
-
initialLength: { default: 1 },
|
|
113
|
-
name: {},
|
|
114
|
-
shape: { default: () => x.CIRCLE },
|
|
115
|
-
showName: {
|
|
116
|
-
type: Boolean,
|
|
117
|
-
default: !0
|
|
118
|
-
},
|
|
119
|
-
size: { default: () => b.SIZE_40 },
|
|
120
|
-
src: {}
|
|
121
|
-
},
|
|
122
|
-
setup(t) {
|
|
123
|
-
let o = m(), l = d(!1), g = (e) => typeof e == "number" || typeof e == "string", v = e(() => {
|
|
124
|
-
if (g(o.tabindex)) return o.tabindex;
|
|
125
|
-
if (g(o.tabIndex)) return o.tabIndex;
|
|
126
|
-
}), y = e(() => g(o.tabindex) || g(o.tabIndex)), b = e(() => t.disabled ? -1 : y.value ? v.value : 0), x = e(() => ({
|
|
127
|
-
...o,
|
|
128
|
-
tabindex: b.value
|
|
129
|
-
})), S = e(() => [
|
|
130
|
-
`s-ui-avatar--size-${t.size}`,
|
|
131
|
-
`s-ui-avatar--shape-${t.shape}`,
|
|
132
|
-
A(t.color),
|
|
133
|
-
`s-ui-avatar--icon-background-${t.iconBackground}`,
|
|
134
|
-
{
|
|
135
|
-
"s-ui-avatar--bordered": t.bordered,
|
|
136
|
-
"s-ui-avatar--disabled": t.disabled,
|
|
137
|
-
"s-ui-avatar--icon": T.value,
|
|
138
|
-
"s-ui-avatar--photo": w.value
|
|
139
|
-
}
|
|
140
|
-
]), C = e(() => {
|
|
141
|
-
if (!T.value && k(t.color)) return j(t.color);
|
|
142
|
-
}), w = e(() => !!(t.src && !l.value)), T = e(() => !!(!w.value && t.icon)), E = (e) => {
|
|
143
|
-
let t = e.split(/\s+/).filter(Boolean);
|
|
144
|
-
if (t.length === 1) {
|
|
145
|
-
let e = t[0];
|
|
146
|
-
if (e) return e;
|
|
147
|
-
}
|
|
148
|
-
return t.map((e) => e.slice(0, 1)).join("");
|
|
149
|
-
}, D = e(() => t.name ? E(t.name) : ""), V = e(() => t.alt ? t.alt : t.name ? t.name : D.value), H = e(() => {
|
|
150
|
-
if (t.alt) return t.alt;
|
|
151
|
-
if (t.name) return t.name;
|
|
152
|
-
}), U = e(() => D.value.slice(0, Math.max(t.initialLength, 0))), W = e(() => M[t.size]), G = e(() => N[t.size]), K = e(() => P[t.size]), q = () => {
|
|
153
|
-
l.value = !0;
|
|
154
|
-
};
|
|
155
|
-
return h(() => t.src, () => {
|
|
156
|
-
l.value = !1;
|
|
157
|
-
}), (e, o) => (u(), r("span", s(x.value, {
|
|
158
|
-
class: ["s-ui-avatar", S.value],
|
|
159
|
-
style: C.value,
|
|
160
|
-
"aria-disabled": t.disabled || void 0
|
|
161
|
-
}), [i("span", I, [t.src && !l.value ? (u(), r("img", {
|
|
162
|
-
key: 0,
|
|
163
|
-
class: "s-ui-avatar__image",
|
|
164
|
-
src: t.src,
|
|
165
|
-
alt: V.value,
|
|
166
|
-
onError: q
|
|
167
|
-
}, null, 40, L)) : t.icon ? (u(), r("span", R, [a(p(_), {
|
|
168
|
-
name: t.icon,
|
|
169
|
-
size: G.value,
|
|
170
|
-
"aria-label": H.value
|
|
171
|
-
}, null, 8, [
|
|
172
|
-
"name",
|
|
173
|
-
"size",
|
|
174
|
-
"aria-label"
|
|
175
|
-
])])) : (u(), r("span", {
|
|
176
|
-
key: 2,
|
|
177
|
-
class: c(["s-ui-avatar__initials", W.value]),
|
|
178
|
-
role: t.alt ? "img" : void 0,
|
|
179
|
-
"aria-label": t.alt
|
|
180
|
-
}, f(U.value), 11, z)), a(O, {
|
|
181
|
-
badge: t.badge,
|
|
182
|
-
size: K.value
|
|
183
|
-
}, null, 8, ["badge", "size"])]), t.showName && t.name ? (u(), r("span", B, f(t.name), 1)) : n("", !0)], 16, F));
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
//#endregion
|
|
187
|
-
export { x as a, C as i, w as n, b as o, S as r, V as t };
|
package/dist/SBadge-BQFJFZtw.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e=require("vue");var t=function(e){return e.DANGER=`danger`,e.MAIN=`main`,e.GRAY=`gray`,e.WHITE=`white`,e.DISABLED=`disabled`,e}({}),n=function(e){return e.TOP_END=`top-end`,e.TOP_START=`top-start`,e.BOTTOM_END=`bottom-end`,e.BOTTOM_START=`bottom-start`,e}({}),r={key:0,class:`s-ui-badge-anchor`},i=[`aria-label`],a={class:`s-ui-badge__label s-ui-typography-label-10-medium`},o=[`aria-label`],s={class:`s-ui-badge__label s-ui-typography-label-10-medium`},c=(0,e.defineComponent)({__name:`SBadge`,props:{color:{default:()=>t.DANGER},value:{default:0},max:{},label:{},placement:{default:()=>n.TOP_END},offsetX:{default:0},offsetY:{default:0}},setup(t){let n=(0,e.useSlots)(),c=(0,e.computed)(()=>t.max&&t.value>t.max?`${t.max}+`:String(t.value)),l=(0,e.computed)(()=>c.value.length===1),u=(0,e.computed)(()=>[`s-ui-badge--color-${t.color}`,{"s-ui-badge--single":l.value,[`s-ui-badge--placement-${t.placement}`]:!!n.default}]),d=(0,e.computed)(()=>{if(n.default)return{"--s-ui-badge-offset-x":`${t.offsetX}px`,"--s-ui-badge-offset-y":`${t.offsetY}px`}}),f=(0,e.computed)(()=>t.label?t.label:c.value);return(t,l)=>(0,e.unref)(n).default?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,r,[(0,e.renderSlot)(t.$slots,`default`),(0,e.createElementVNode)(`span`,{class:(0,e.normalizeClass)([`s-ui-badge s-ui-badge--anchored`,u.value]),style:(0,e.normalizeStyle)(d.value),"aria-label":f.value},[(0,e.createElementVNode)(`span`,a,(0,e.toDisplayString)(c.value),1)],14,i)])):((0,e.openBlock)(),(0,e.createElementBlock)(`span`,{key:1,class:(0,e.normalizeClass)([`s-ui-badge`,u.value]),"aria-label":f.value},[(0,e.createElementVNode)(`span`,s,(0,e.toDisplayString)(c.value),1)],10,o))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
|
package/dist/SBadge-CcCknHTw.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { computed as e, createElementBlock as t, createElementVNode as n, defineComponent as r, normalizeClass as i, normalizeStyle as a, openBlock as o, renderSlot as s, toDisplayString as c, unref as l, useSlots as u } from "vue";
|
|
2
|
-
//#region src/components/SBadge/SBadge.types.ts
|
|
3
|
-
var d = /* @__PURE__ */ function(e) {
|
|
4
|
-
return e.DANGER = "danger", e.MAIN = "main", e.GRAY = "gray", e.WHITE = "white", e.DISABLED = "disabled", e;
|
|
5
|
-
}({}), f = /* @__PURE__ */ function(e) {
|
|
6
|
-
return e.TOP_END = "top-end", e.TOP_START = "top-start", e.BOTTOM_END = "bottom-end", e.BOTTOM_START = "bottom-start", e;
|
|
7
|
-
}({}), p = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "s-ui-badge-anchor"
|
|
10
|
-
}, m = ["aria-label"], h = { class: "s-ui-badge__label s-ui-typography-label-10-medium" }, g = ["aria-label"], _ = { class: "s-ui-badge__label s-ui-typography-label-10-medium" }, v = /* @__PURE__ */ r({
|
|
11
|
-
__name: "SBadge",
|
|
12
|
-
props: {
|
|
13
|
-
color: { default: () => d.DANGER },
|
|
14
|
-
value: { default: 0 },
|
|
15
|
-
max: {},
|
|
16
|
-
label: {},
|
|
17
|
-
placement: { default: () => f.TOP_END },
|
|
18
|
-
offsetX: { default: 0 },
|
|
19
|
-
offsetY: { default: 0 }
|
|
20
|
-
},
|
|
21
|
-
setup(r) {
|
|
22
|
-
let d = u(), f = e(() => r.max && r.value > r.max ? `${r.max}+` : String(r.value)), v = e(() => f.value.length === 1), y = e(() => [`s-ui-badge--color-${r.color}`, {
|
|
23
|
-
"s-ui-badge--single": v.value,
|
|
24
|
-
[`s-ui-badge--placement-${r.placement}`]: !!d.default
|
|
25
|
-
}]), b = e(() => {
|
|
26
|
-
if (d.default) return {
|
|
27
|
-
"--s-ui-badge-offset-x": `${r.offsetX}px`,
|
|
28
|
-
"--s-ui-badge-offset-y": `${r.offsetY}px`
|
|
29
|
-
};
|
|
30
|
-
}), x = e(() => r.label ? r.label : f.value);
|
|
31
|
-
return (e, r) => l(d).default ? (o(), t("span", p, [s(e.$slots, "default"), n("span", {
|
|
32
|
-
class: i(["s-ui-badge s-ui-badge--anchored", y.value]),
|
|
33
|
-
style: a(b.value),
|
|
34
|
-
"aria-label": x.value
|
|
35
|
-
}, [n("span", h, c(f.value), 1)], 14, m)])) : (o(), t("span", {
|
|
36
|
-
key: 1,
|
|
37
|
-
class: i(["s-ui-badge", y.value]),
|
|
38
|
-
"aria-label": x.value
|
|
39
|
-
}, [n("span", _, c(f.value), 1)], 10, g));
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
//#endregion
|
|
43
|
-
export { d as n, f as r, v as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./SButton.types-UKroD-ev.cjs"),t=require("./context-kCi2xRHY.cjs"),n=require("./useSelectionGroup-TaektE-I.cjs"),r=require("./useSelectLink-DDdMmsJB.cjs"),i=require("./useLink-1LLWpdDZ.cjs");let a=require("vue"),o=require("@shtabapp/ui-kit-primitives");var s=[`aria-hidden`],c={key:0,class:`s-ui-button__spinner`,"aria-hidden":`true`},l=(0,a.defineComponent)({inheritAttrs:!1,__name:`SButton`,props:{appearance:{},disabled:{type:Boolean,default:!1},icon:{},iconLeft:{},iconRight:{},loading:{type:Boolean,default:!1},size:{},value:{},variant:{},link:{},exact:{type:Boolean,default:!1},replace:{type:Boolean,default:!1}},setup(l){let u=(0,a.inject)(t.t,null),d=(0,a.useAttrs)(),f=(0,a.computed)(()=>n.a(l.appearance,u?(0,a.toValue)(u.appearance):void 0,e.t.MAJOR)),p=(0,a.computed)(()=>n.a(l.variant,u?(0,a.toValue)(u.variant):void 0,e.r.MAIN)),m=(0,a.computed)(()=>n.a(l.size,u?(0,a.toValue)(u.size):void 0,e.n.MEDIUM)),h=(0,a.computed)(()=>l.disabled||!!(u&&(0,a.toValue)(u.disabled))),g=(0,a.useTemplateRef)(`buttonRootRef`),_=i.t(()=>l.link,()=>l.exact,()=>l.replace),v=_.linkPresentation;r.t({isRouterLink:_.isRouterLink,isActive:_.isActive,group:()=>u,value:()=>l.value});let y=(0,a.computed)(()=>{let e=v.value;return e.mode===`none`?`button`:e.rootTag}),b=(0,a.computed)(()=>y.value===`button`),x=(0,a.computed)(()=>h.value||l.loading),S=r.n({group:u,value:()=>l.value,el:g,disabled:h,interactive:()=>!x.value}),C=(0,a.computed)(()=>_.isRouterLink.value?_.isActive.value:S.isActive.value),w=(0,a.computed)(()=>[`s-ui-button`,`s-ui-button--tab-focus`,`s-ui-button--appearance-${f.value}`,`s-ui-button--variant-${p.value}`,`s-ui-button--size-${m.value}`,{"s-ui-button--disabled":h.value,"s-ui-button--loading":l.loading,"s-ui-button--icon-only":l.icon,"s-ui-button--active":C.value,"s-ui-button--link":v.value.mode!==`none`}]),T=(0,a.computed)(()=>({disabled:b.value?x.value:void 0,"aria-busy":l.loading?!0:void 0,"aria-pressed":S.ariaPressed.value,"aria-checked":S.ariaChecked.value,tabindex:S.tabIndex.value,...i.n(v.value,{replace:l.replace})})),E=(0,a.computed)(()=>({...T.value,...d})),D={[e.n.SMALL]:`s-ui-typography-label-12-medium`,[e.n.MEDIUM]:`s-ui-typography-label-14-medium`,[e.n.LARGE]:`s-ui-typography-label-16-medium`},O=(0,a.computed)(()=>D[m.value]),k={[e.n.SMALL]:16,[e.n.MEDIUM]:20,[e.n.LARGE]:24},A=(0,a.computed)(()=>k[m.value]),j=(0,a.computed)(()=>h.value||l.loading?!1:p.value===e.r.BILLING&&f.value!==e.t.MAJOR),M=(0,a.computed)(()=>p.value===e.r.BILLING&&f.value!==e.t.MAJOR),N=e=>{if(!x.value){if(_.isRouterLink.value&&(e.key===`Enter`||e.key===` `||e.key===`Spacebar`)){e.preventDefault(),_.navigate();return}S.handleKeydown(e)}},P=e=>{if(x.value){e.preventDefault(),e.stopPropagation();return}_.isRouterLink.value||S.handleClick()};return(e,t)=>((0,a.openBlock)(),(0,a.createBlock)((0,a.resolveDynamicComponent)(y.value),(0,a.mergeProps)({ref_key:`buttonRootRef`,ref:g,class:w.value},E.value,{onClick:P,onKeydown:N}),{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`span`,{class:`s-ui-button__inner`,"aria-hidden":l.loading?!0:void 0},[l.icon?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(o.SIcon),{key:0,name:l.icon,size:A.value,billing:j.value},null,8,[`name`,`size`,`billing`])):((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:1},[l.iconLeft?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(o.SIcon),{key:0,name:l.iconLeft,size:A.value,billing:j.value},null,8,[`name`,`size`,`billing`])):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`span`,{class:(0,a.normalizeClass)([`s-ui-button__label`,O.value])},[(0,a.renderSlot)(e.$slots,`default`)],2),l.iconRight?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(o.SIcon),{key:1,name:l.iconRight,size:A.value,billing:j.value},null,8,[`name`,`size`,`billing`])):(0,a.createCommentVNode)(``,!0)],64))],8,s),l.loading?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,c,[(0,a.createVNode)((0,a.unref)(o.SSpinner),{billing:M.value,size:A.value},null,8,[`billing`,`size`])])):(0,a.createCommentVNode)(``,!0)]),_:3},16,[`class`]))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
|
package/dist/SButton-D5yFE3W2.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./SButton.types-CpdHQtyx.js";
|
|
2
|
-
import { t as r } from "./context-C3WoLJS4.js";
|
|
3
|
-
import { a as i } from "./useSelectionGroup-cKj38lEN.js";
|
|
4
|
-
import { n as a, t as o } from "./useSelectLink-DClG5hGA.js";
|
|
5
|
-
import { n as s, t as c } from "./useLink-Com5VhOk.js";
|
|
6
|
-
import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createVNode as h, defineComponent as g, inject as _, mergeProps as v, normalizeClass as y, openBlock as b, renderSlot as x, resolveDynamicComponent as S, toValue as C, unref as w, useAttrs as T, useTemplateRef as E, withCtx as D } from "vue";
|
|
7
|
-
import { SIcon as O, SSpinner as k } from "@shtabapp/ui-kit-primitives";
|
|
8
|
-
//#region src/components/SButton/SButton.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var A = ["aria-hidden"], j = {
|
|
10
|
-
key: 0,
|
|
11
|
-
class: "s-ui-button__spinner",
|
|
12
|
-
"aria-hidden": "true"
|
|
13
|
-
}, M = /* @__PURE__ */ g({
|
|
14
|
-
inheritAttrs: !1,
|
|
15
|
-
__name: "SButton",
|
|
16
|
-
props: {
|
|
17
|
-
appearance: {},
|
|
18
|
-
disabled: {
|
|
19
|
-
type: Boolean,
|
|
20
|
-
default: !1
|
|
21
|
-
},
|
|
22
|
-
icon: {},
|
|
23
|
-
iconLeft: {},
|
|
24
|
-
iconRight: {},
|
|
25
|
-
loading: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
default: !1
|
|
28
|
-
},
|
|
29
|
-
size: {},
|
|
30
|
-
value: {},
|
|
31
|
-
variant: {},
|
|
32
|
-
link: {},
|
|
33
|
-
exact: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: !1
|
|
36
|
-
},
|
|
37
|
-
replace: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
default: !1
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
setup(g) {
|
|
43
|
-
let M = _(r, null), N = T(), P = u(() => i(g.appearance, M ? C(M.appearance) : void 0, n.MAJOR)), F = u(() => i(g.variant, M ? C(M.variant) : void 0, t.MAIN)), I = u(() => i(g.size, M ? C(M.size) : void 0, e.MEDIUM)), L = u(() => g.disabled || !!(M && C(M.disabled))), R = E("buttonRootRef"), z = c(() => g.link, () => g.exact, () => g.replace), B = z.linkPresentation;
|
|
44
|
-
o({
|
|
45
|
-
isRouterLink: z.isRouterLink,
|
|
46
|
-
isActive: z.isActive,
|
|
47
|
-
group: () => M,
|
|
48
|
-
value: () => g.value
|
|
49
|
-
});
|
|
50
|
-
let V = u(() => {
|
|
51
|
-
let e = B.value;
|
|
52
|
-
return e.mode === "none" ? "button" : e.rootTag;
|
|
53
|
-
}), H = u(() => V.value === "button"), U = u(() => L.value || g.loading), W = a({
|
|
54
|
-
group: M,
|
|
55
|
-
value: () => g.value,
|
|
56
|
-
el: R,
|
|
57
|
-
disabled: L,
|
|
58
|
-
interactive: () => !U.value
|
|
59
|
-
}), G = u(() => z.isRouterLink.value ? z.isActive.value : W.isActive.value), K = u(() => [
|
|
60
|
-
"s-ui-button",
|
|
61
|
-
"s-ui-button--tab-focus",
|
|
62
|
-
`s-ui-button--appearance-${P.value}`,
|
|
63
|
-
`s-ui-button--variant-${F.value}`,
|
|
64
|
-
`s-ui-button--size-${I.value}`,
|
|
65
|
-
{
|
|
66
|
-
"s-ui-button--disabled": L.value,
|
|
67
|
-
"s-ui-button--loading": g.loading,
|
|
68
|
-
"s-ui-button--icon-only": g.icon,
|
|
69
|
-
"s-ui-button--active": G.value,
|
|
70
|
-
"s-ui-button--link": B.value.mode !== "none"
|
|
71
|
-
}
|
|
72
|
-
]), q = u(() => ({
|
|
73
|
-
disabled: H.value ? U.value : void 0,
|
|
74
|
-
"aria-busy": g.loading ? !0 : void 0,
|
|
75
|
-
"aria-pressed": W.ariaPressed.value,
|
|
76
|
-
"aria-checked": W.ariaChecked.value,
|
|
77
|
-
tabindex: W.tabIndex.value,
|
|
78
|
-
...s(B.value, { replace: g.replace })
|
|
79
|
-
})), J = u(() => ({
|
|
80
|
-
...q.value,
|
|
81
|
-
...N
|
|
82
|
-
})), Y = {
|
|
83
|
-
[e.SMALL]: "s-ui-typography-label-12-medium",
|
|
84
|
-
[e.MEDIUM]: "s-ui-typography-label-14-medium",
|
|
85
|
-
[e.LARGE]: "s-ui-typography-label-16-medium"
|
|
86
|
-
}, X = u(() => Y[I.value]), Z = {
|
|
87
|
-
[e.SMALL]: 16,
|
|
88
|
-
[e.MEDIUM]: 20,
|
|
89
|
-
[e.LARGE]: 24
|
|
90
|
-
}, Q = u(() => Z[I.value]), $ = u(() => L.value || g.loading ? !1 : F.value === t.BILLING && P.value !== n.MAJOR), ee = u(() => F.value === t.BILLING && P.value !== n.MAJOR), te = (e) => {
|
|
91
|
-
if (!U.value) {
|
|
92
|
-
if (z.isRouterLink.value && (e.key === "Enter" || e.key === " " || e.key === "Spacebar")) {
|
|
93
|
-
e.preventDefault(), z.navigate();
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
W.handleKeydown(e);
|
|
97
|
-
}
|
|
98
|
-
}, ne = (e) => {
|
|
99
|
-
if (U.value) {
|
|
100
|
-
e.preventDefault(), e.stopPropagation();
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
z.isRouterLink.value || W.handleClick();
|
|
104
|
-
};
|
|
105
|
-
return (e, t) => (b(), d(S(V.value), v({
|
|
106
|
-
ref_key: "buttonRootRef",
|
|
107
|
-
ref: R,
|
|
108
|
-
class: K.value
|
|
109
|
-
}, J.value, {
|
|
110
|
-
onClick: ne,
|
|
111
|
-
onKeydown: te
|
|
112
|
-
}), {
|
|
113
|
-
default: D(() => [m("span", {
|
|
114
|
-
class: "s-ui-button__inner",
|
|
115
|
-
"aria-hidden": g.loading ? !0 : void 0
|
|
116
|
-
}, [g.icon ? (b(), d(w(O), {
|
|
117
|
-
key: 0,
|
|
118
|
-
name: g.icon,
|
|
119
|
-
size: Q.value,
|
|
120
|
-
billing: $.value
|
|
121
|
-
}, null, 8, [
|
|
122
|
-
"name",
|
|
123
|
-
"size",
|
|
124
|
-
"billing"
|
|
125
|
-
])) : (b(), p(l, { key: 1 }, [
|
|
126
|
-
g.iconLeft ? (b(), d(w(O), {
|
|
127
|
-
key: 0,
|
|
128
|
-
name: g.iconLeft,
|
|
129
|
-
size: Q.value,
|
|
130
|
-
billing: $.value
|
|
131
|
-
}, null, 8, [
|
|
132
|
-
"name",
|
|
133
|
-
"size",
|
|
134
|
-
"billing"
|
|
135
|
-
])) : f("", !0),
|
|
136
|
-
m("span", { class: y(["s-ui-button__label", X.value]) }, [x(e.$slots, "default")], 2),
|
|
137
|
-
g.iconRight ? (b(), d(w(O), {
|
|
138
|
-
key: 1,
|
|
139
|
-
name: g.iconRight,
|
|
140
|
-
size: Q.value,
|
|
141
|
-
billing: $.value
|
|
142
|
-
}, null, 8, [
|
|
143
|
-
"name",
|
|
144
|
-
"size",
|
|
145
|
-
"billing"
|
|
146
|
-
])) : f("", !0)
|
|
147
|
-
], 64))], 8, A), g.loading ? (b(), p("span", j, [h(w(k), {
|
|
148
|
-
billing: ee.value,
|
|
149
|
-
size: Q.value
|
|
150
|
-
}, null, 8, ["billing", "size"])])) : f("", !0)]),
|
|
151
|
-
_: 3
|
|
152
|
-
}, 16, ["class"]));
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
//#endregion
|
|
156
|
-
export { M as t };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type ISAvatarBadgeProps } from './SAvatar.types';
|
|
2
|
-
declare const __VLS_export: import("vue").DefineComponent<ISAvatarBadgeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ISAvatarBadgeProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
-
declare const _default: typeof __VLS_export;
|
|
4
|
-
export default _default;
|
|
5
|
-
//# sourceMappingURL=SAvatarBadge.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SAvatarBadge.vue.d.ts","sourceRoot":"","sources":["../../../src/components/SAvatar/SAvatarBadge.vue"],"names":[],"mappings":"AAsGA,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAmJxE,QAAA,MAAM,YAAY,gTAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|