@oneb/ui-vue 0.0.81 → 0.0.82

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.
@@ -77,11 +77,18 @@ export type TermsType = {
77
77
  };
78
78
  export type SidebarItemType = {
79
79
  label: string;
80
+ labelTop: string;
80
81
  route?: string | Record<string, any>;
81
82
  routeName?: string;
82
83
  href?: string;
83
84
  exact?: boolean;
84
85
  icon?: FunctionalComponent | Component;
86
+ subItemsVisible?: boolean;
87
+ subItems?: Array<{
88
+ label: string;
89
+ routeName?: string;
90
+ icon?: FunctionalComponent | Component;
91
+ }>;
85
92
  };
86
93
  export type SidebarLangItemType = {
87
94
  label: any;
@@ -98,6 +105,26 @@ export declare const sidebarProps: {
98
105
  app: {
99
106
  type: PropType<AppType>;
100
107
  };
108
+ minimizedWidth: {
109
+ type: StringConstructor;
110
+ default: string;
111
+ };
112
+ width: {
113
+ type: StringConstructor;
114
+ default: string;
115
+ };
116
+ minimized: {
117
+ type: BooleanConstructor;
118
+ default: boolean;
119
+ };
120
+ hoverable: {
121
+ type: BooleanConstructor;
122
+ default: boolean;
123
+ };
124
+ modelValue: {
125
+ type: BooleanConstructor;
126
+ default: boolean;
127
+ };
101
128
  news: {
102
129
  type: PropType<NewsType>;
103
130
  };
@@ -126,6 +153,10 @@ export declare const sidebarLinkProps: {
126
153
  type: StringConstructor;
127
154
  required: boolean;
128
155
  };
156
+ labelTop: {
157
+ type: StringConstructor;
158
+ required: boolean;
159
+ };
129
160
  icon: {
130
161
  type: PropType<any>;
131
162
  };
@@ -138,6 +169,18 @@ export declare const sidebarLinkProps: {
138
169
  type: BooleanConstructor;
139
170
  default: boolean;
140
171
  };
172
+ subItemsVisible: {
173
+ type: BooleanConstructor;
174
+ default: boolean;
175
+ };
176
+ subItems: {
177
+ type: PropType<{
178
+ label: string;
179
+ routeName?: string;
180
+ icon?: FunctionalComponent | Component;
181
+ }[]>;
182
+ required: boolean;
183
+ };
141
184
  };
142
185
  export declare const mainLayoutProps: {
143
186
  sidebarItems: {
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .text9[data-v-4936d4e4]{font-size:9px}.h-browser[data-v-4936d4e4]{height:calc(100% - 75px)}.dropdown[data-v-b50c1a4c]{position:absolute;background:white;border:1px solid #ccc;border-radius:5px;padding:10px;bottom:100%;left:0}.tooltip[data-v-b50c1a4c]{position:relative}.tooltip-text[data-v-b50c1a4c]{visibility:hidden;background-color:#000;color:#fff;text-align:center;padding:5px;border-radius:6px;position:absolute;z-index:1;bottom:125%;left:50%;transform:translate(-50%);opacity:0;transition:opacity .3s}.tooltip:hover .tooltip-text[data-v-b50c1a4c]{visibility:visible;opacity:1}.module-border-wrap[data-v-907ec8fc]{border-radius:14px;position:relative;background:linear-gradient(to right,#e1a508,#e04040);padding:1px}@keyframes one-sp-ico-rot{to{transform:rotate(360deg)}}@keyframes one-sp-ico-dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}
1
+ .text9[data-v-4936d4e4]{font-size:9px}.h-browser[data-v-4936d4e4]{height:calc(100% - 75px)}.dropdown[data-v-6e5db3d6]{position:absolute;background:white;border:1px solid #ccc;border-radius:5px;padding:10px;bottom:100%;left:0}.tooltip[data-v-6e5db3d6]{position:relative}.tooltip-text[data-v-6e5db3d6]{visibility:hidden;background-color:#000;color:#fff;text-align:center;padding:5px;border-radius:6px;position:absolute;z-index:1;bottom:125%;left:50%;transform:translate(-50%);opacity:0;transition:opacity .3s}.tooltip:hover .tooltip-text[data-v-6e5db3d6]{visibility:visible;opacity:1}.cont[data-v-6e5db3d6]{display:flex;flex-direction:column;height:100vh;justify-content:space-between}.overflow-y-auto[data-v-6e5db3d6]::-webkit-scrollbar{width:2px}.overflow-y-auto[data-v-6e5db3d6]::-webkit-scrollbar-track{background-color:#f1f1f1;border-radius:10px}.overflow-y-auto[data-v-6e5db3d6]::-webkit-scrollbar-thumb{background-color:#888;border-radius:10px}.overflow-y-auto[data-v-6e5db3d6]::-webkit-scrollbar-thumb:hover{background-color:#555}.module-border-wrap[data-v-7641e45b]{border-radius:14px;position:relative;background:linear-gradient(to right,#e1a508,#e04040);padding:1px}@keyframes one-sp-ico-rot{to{transform:rotate(360deg)}}@keyframes one-sp-ico-dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneb/ui-vue",
3
- "version": "0.0.81",
3
+ "version": "0.0.82",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),f=require("./common/index.cjs"),B=require("./XMarkIcon-f94baa4c.cjs"),C=require("./index-176aeb3b.cjs"),N=require("./_plugin-vue_export-helper-f246444f.cjs"),S={title:{type:String},stick:{type:String,default:"right"}},A={variant:{type:String,default:"primary"},label:{type:String},icon:{type:[Function,Object]}},$=["data-opened"],z={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},x=e.defineComponent({__name:"OneDropdown",props:S,emits:["open","close"],setup(c,{emit:r}){const i=e.ref(!1),l=e.ref(null),a=r,n=c,s=()=>{i.value=!i.value,i.value?a("open"):a("close")};e.provide("OneDropdown",{onToggle:s});const o=e.computed(()=>{const t=l.value!=null&&l.value.getBoundingClientRect.x<270;return l.value!=null&&l.value.getBoundingClientRect().top+270>window.innerHeight?"up"+(t?"-right":"-left"):"down"+(t?"-right":"-left")}),u=e.computed(()=>{const t=["absolute z-10 w-fit rounded-md bg-white","py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none","overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"];return o.value.startsWith("up")?t.push("bottom-1 mb-10"):o.value.startsWith("down")&&t.push("top-1 mt-10"),n.stick==="right"?t.push("right-0"):n.stick==="left"&&t.push("left-0"),t});return(t,p)=>(e.openBlock(),e.createElementBlock("div",{class:"relative inline-block",ref_key:"menuRef",ref:l,"data-opened":i.value},[e.renderSlot(t.$slots,"button",e.normalizeProps(e.guardReactiveProps({onToggle:s,isExpanded:i.value}))),i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:s})):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["menu",u.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1"},[t.title?(e.openBlock(),e.createElementBlock("div",z,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"menu",e.normalizeProps(e.guardReactiveProps({onToggle:s})))],2)):e.createCommentVNode("",!0)]),_:3})],8,$))}}),k=e.defineComponent({__name:"OneDropdownItem",props:A,emits:["click"],setup(c,{emit:r}){const i=r,l=c,a=e.inject("OneDropdown"),n=()=>{a!==void 0&&a.onToggle(),i("click")},s=e.computed(()=>{const o=[];return l.variant==="secondary"?o.push("text-secondary-content hover:bg-secondary-body-hover"):l.variant==="danger"?o.push("text-danger-content hover:bg-danger-10"):l.variant==="warning"?o.push("text-warning-content hover:bg-warning-10"):l.variant==="info"?o.push("text-info-content hover:bg-info-10"):o.push("hover:bg-secondary-body-hover"),o});return(o,u)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap",s.value]),onClick:e.withModifiers(n,["prevent"])},[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"w-4 h-4"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(o.label),1)],2))}});function D(c,r){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})])}const O={user:{type:Object,required:!0},menu:{type:Array,default:()=>[]},iconSize:{type:String,default:"34"},app:{type:Object},accountLabel:{type:String,default:"Account"},logoutLabel:{type:String,default:"Logout"},versionLabel:{type:String,default:""},onAccount:{type:Function},onLogout:{type:Function}},_={workspace:{type:Object,required:!0},workspaces:{type:Array},apps:{type:Array,required:!0},iconSize:{type:String,default:"24"},appsTitle:{type:String,default:"Ваші додатки"},changeLabel:{type:String,default:"Керувати робочими просторами"},onChange:{type:Function},onApp:{type:Function}},L=["onClick"],F={class:"flex flex-col items-center pt-5 pb-2 h-full"},j={class:"flex flex-col px-10 py-1 mt-2 text-center"},M={class:"self-center text-base font-medium tracking-wide text-black"},P={class:"mt-1 text-xs leading-5 text-blue-500 font-light"},q={class:"text-left w-full mt-5 px-3"},I=e.createElementVNode("div",{class:"space-y-2 text-center",style:{width:"240px"}},null,-1),R={class:"-mb-2 flex-shrink-0 mt-auto pt-6 text-[8px] leading-3 text-gray-400"},T=e.defineComponent({__name:"OneUserMenu",props:O,setup(c){const r=c,i=e.computed(()=>{var n;return(n=r.menu)==null?void 0:n.map(s=>{let o={label:s.label};s.icon!=null&&(o={...o,icon:s.icon});const u=typeof s.click=="function"?s.click:()=>{};return{key:s.label,args:o,click:u}})}),l=()=>{typeof r.onAccount=="function"&&r.onAccount()},a=()=>{typeof r.onLogout=="function"&&r.onLogout()};return(n,s)=>(e.openBlock(),e.createBlock(x,{stick:"right"},{button:e.withCtx(({onToggle:o,isExpanded:u})=>{var t,p;return[e.createElementVNode("button",{onClick:o,class:e.normalizeClass(["p-1 rounded-full hover:bg-secondary-10",[u?"bg-secondary-25":""]])},[e.createVNode(f.OneAvatar,{text:((t=n.user)==null?void 0:t.name)||"",size:n.iconSize,src:(p=n.user)==null?void 0:p.photo_url,rounded:!0},null,8,["text","size","src"])],10,L)]}),menu:e.withCtx(()=>{var o,u,t,p,h;return[e.createElementVNode("div",F,[e.createVNode(f.OneAvatar,{text:((o=n.user)==null?void 0:o.name)||"",size:80,src:(u=n.user)==null?void 0:u.photo_url,rounded:!0,class:"mx-auto"},null,8,["text","src"]),e.createElementVNode("div",j,[e.createElementVNode("div",M,e.toDisplayString((t=n.user)==null?void 0:t.name),1),e.createElementVNode("div",P,e.toDisplayString((p=n.user)==null?void 0:p.email),1)]),typeof r.onAccount=="function"?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:l,class:"cursor-pointer justify-center px-8 py-2 mt-3 text-xs font-semibold tracking-wide leading-5 text-gray-600 border border-solid bg-neutral-100 border-slate-200 rounded-[50px] hover:bg-neutral-200"},e.toDisplayString(n.accountLabel),1)):e.createCommentVNode("",!0),e.createElementVNode("div",q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,m=>(e.openBlock(),e.createBlock(k,e.mergeProps({key:m.key,ref_for:!0},m.args,{onClick:m.click}),null,16,["onClick"]))),128)),typeof n.onLogout=="function"?(e.openBlock(),e.createBlock(k,{key:0,icon:e.unref(D),label:n.logoutLabel,class:"rounded py-3",onClick:a},null,8,["icon","label"])):e.createCommentVNode("",!0)]),I,e.createElementVNode("div",R,e.toDisplayString((h=n.app)==null?void 0:h.version),1)])]}),_:1}))}});function b(c,r){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"3.9",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"10.53",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"17.16",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"10.53",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"}),e.createElementVNode("rect",{width:"2.94",height:"2.94",x:"3.9",y:"17.16",fill:"currentColor","stroke-width":"1.8",rx:"1.1"})])}function H(c,r){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})])}function W(c,r){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 15.75l7.5-7.5 7.5 7.5"})])}function E(c,r){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.8",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})])}const U=c=>(e.pushScopeId("data-v-4936d4e4"),c=c(),e.popScopeId(),c),X=["data-opened"],G={key:1,class:"absolute top-0 right-0 h-screen overflow-y-auto max-w-96 bg-white px-3 z-10"},J={class:"flex justify-between items-center pt-3 mb-3"},K={class:"font-semibold text-xl px-3"},Q={class:"grid"},Y={class:"rounded-lg m-3 border"},Z={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},ee={class:"flex justify-between relative"},te={class:"flex items-center justify-between w-full text-left text-sm font-semibold"},oe={key:0},ne={class:"text-xs font-semibold"},re=U(()=>e.createElementVNode("hr",null,null,-1)),le={class:"px-3 py-2"},se={class:"text-secondary-content text-left pb-1 text-xs uppercase"},ce={class:"overflow-auto max-h-full"},ae={key:0,class:"space-y-2"},ie=["onClick"],de={class:"flex"},ue={class:"border border-secondary-stroke rounded-2xl w-14 h-14 md:w-14 md:h-14 flex items-center justify-center"},pe={class:"pl-2"},me={class:"text-sm mt-1 font-semibold"},he={class:"text9 mt-1"},fe={key:1,class:"mt-2 w-full bg-[#FAFAFA] hover:bg-secondary-10 p-2 rounded-lg mb-5 text-xs hidden"},ke=e.defineComponent({__name:"OneBrowserMenu",props:_,emits:["open","close"],setup(c,{emit:r}){const i=r,l=c,a=e.ref(!1),n=()=>{a.value=!a.value,a.value?i("open"):i("close")},s=e.ref(!1);e.computed(()=>s.value?W:H);const o=()=>{typeof l.onChange=="function"&&l.onChange()},u=t=>{typeof l.onApp=="function"&&l.onApp(t)};return(t,p)=>{var h,m,g,v,y,w;return e.openBlock(),e.createElementBlock("div",{"data-opened":a.value},[e.createElementVNode("button",{onClick:n,class:e.normalizeClass(["p-1 w-[44px] h-[44px] rounded-md hover:bg-secondary-10",{"bg-secondary-10":a.value}])},[e.createVNode(e.unref(b),{class:"text-secondary-base w-full p-1 hover:text-blue-600 m-auto"})],2),a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10 bg-black/10",onClick:n})):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("div",J,[e.createElementVNode("div",K,e.toDisplayString((h=t.workspace)==null?void 0:h.title),1),e.createVNode(e.unref(B.render),{class:"w-6 cursor-pointer",onClick:n})]),e.createElementVNode("div",Q,[e.createElementVNode("div",Y,[e.createElementVNode("div",Z,[e.createElementVNode("div",ee,[e.createVNode(f.OneAvatar,{text:((m=t.workspace)==null?void 0:m.name)||"",src:(g=t.workspace)==null?void 0:g.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",te,e.toDisplayString((v=t.workspace)==null?void 0:v.name),1)]),s.value?(e.openBlock(),e.createElementBlock("div",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.workspaces,d=>(e.openBlock(),e.createElementBlock("div",{key:d.name,class:"flex items-center space-x-3 border-t px-5 py-2 hover:bg-secondary-10"},[e.createVNode(f.OneAvatar,{text:d.name,src:d.photo_url,size:30,rounded:!1},null,8,["text","src"]),e.createElementVNode("span",ne,e.toDisplayString(d.name),1)]))),128))])):e.createCommentVNode("",!0),re,e.createElementVNode("div",{onClick:o,class:"text-center py-2 cursor-pointer",style:{"font-size":"10px"}},e.toDisplayString((y=t.workspace)==null?void 0:y.changeLabel),1)])]),e.createElementVNode("div",le,[e.createElementVNode("div",se,e.toDisplayString((w=t.workspace)==null?void 0:w.appsLabel),1),e.createElementVNode("div",ce,[t.apps&&t.apps.length?(e.openBlock(),e.createElementBlock("div",ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.apps,d=>(e.openBlock(),e.createElementBlock("div",{key:d.id,onClick:V=>u(d),class:"flex justify-between items-center rounded-lg hover:bg-secondary-10 p-2 bg-[#FAFAFA] cursor-pointer"},[e.createElementVNode("div",de,[e.createElementVNode("div",ue,[e.createVNode(f.OneAvatar,{text:d.name,src:d.photo_url,size:44,rounded:!1},null,8,["text","src"])]),e.createElementVNode("div",pe,[e.createElementVNode("p",me,e.toDisplayString(d.name),1),e.createElementVNode("p",he,e.toDisplayString(d==null?void 0:d.short),1)])]),e.createElementVNode("div",null,[e.createVNode(C._sfc_main,{variant:"touch",icon:e.unref(E),onClick:V=>u(d)},null,8,["icon","onClick"])])],8,ie))),128))])):e.createCommentVNode("",!0),t.apps&&t.apps.length?(e.openBlock(),e.createElementBlock("button",fe,e.toDisplayString("Дивитися всі"))):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],8,X)}}});const ge=N._export_sfc(ke,[["__scopeId","data-v-4936d4e4"]]);exports.OneBrowserMenu=ge;exports._sfc_main=x;exports._sfc_main$1=k;exports._sfc_main$2=T;exports.browserMenuProps=_;exports.render=E;exports.render$1=b;
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),g=require("./_plugin-vue_export-helper-f246444f.cjs");const h={},v={class:"spinner",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{animation:"one-sp-ico-rot 2.7s linear infinite"}},y=e.createElementVNode("circle",{style:{"stroke-linecap":"round",animation:"one-sp-ico-dash 1.7s ease-in-out infinite"},class:"opacity-75",cx:"12",cy:"12",r:"8",fill:"none",stroke:"currentColor","stroke-width":"2"},null,-1),f=[y];function k(l,i){return e.openBlock(),e.createElementBlock("svg",v,f)}const c=g._export_sfc(h,[["render",k]]),w={variant:{type:String,default:"primary"},size:{type:String,default:"md"},label:{type:String},labelClass:{type:String,default:""},icon:{type:[Function,Object]},isLoading:{type:Boolean},isSubmit:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},active:{type:Boolean,default:!1},iconClass:{type:[String,Array]},iconAfter:{type:[Function,Object,String]}},C=["relative inline-flex","border","items-center justify-center","font-medium whitespace-nowrap","disabled:opacity-50 disabled:cursor-default","focus:outline-none focus:ring-2","transition-colors duration-200"],x={sm:["px-2 py-1 text-sm"],md:["px-3 py-2"],lg:["px-4 py-3"]},B={primary:["rounded-md border-transparent bg-primary-base disabled:bg-primary-hover text-sm text-white hover:bg-primary-hover focus:ring-primary-glow"],secondary:["rounded-md border-primary-stroke bg-primary-body disabled:bg-primary-body-hover text-black text-sm hover:bg-primary-body-hover focus:ring-tertiary-glow"],info:["rounded-md border-transparent bg-info-base disabled:bg-info-hover text-white text-sm hover:bg-info-hover focus:ring-info-glow"],success:["rounded-md border-transparent bg-success-base disabled:bg-success-hover text-white text-sm hover:bg-success-hover focus:ring-success-glow"],warning:["rounded-md border-transparent bg-warning-base disabled:bg-warning-hover text-white text-sm hover:bg-warning-hover focus:ring-warning-glow"],danger:["rounded-md border-transparent bg-danger-base disabled:bg-danger-hover text-white text-sm hover:bg-danger-hover focus:ring-danger-glow"],touch:["rounded-full border-transparent text-black hover:bg-primary-body-hover hover:shadow p-3 text-sm focus:ring-tertiary-glow"],link:["rounded-md border-transparent items-center text-info-base hover:text-info-hover text-sm"],none:["rounded-md border-transparent text-gray-500"],mini:["rounded-full border-transparent bg-[#FAFAFA] text-sm hover:text-green-500 disabled:text-[#525B66] focus:ring-2"]},_=(l="primary",i="md")=>{const n=[];return n.push(...C),n.push(...B[l]??[]),l!=="touch"&&n.push(...x[i]??[]),n},S=["disabled","title","type"],z=e.defineComponent({__name:"OneButton",props:w,emits:["click"],setup(l,{emit:i}){const n=i,s=l,u=()=>{n("click")},o=e.computed(()=>s.icon),r=e.computed(()=>s.iconAfter),d=e.computed(()=>{const t=_(s.variant,s.size);return s.variant==="touch"&&s.active&&t.push("bg-primary-body-active"),t}),p=e.computed(()=>s.disabled||s.isLoading),m=e.computed(()=>s.label&&s.label.length>0&&s.variant!=="touch"),b=e.computed(()=>{const t=["inline-block text-ellipsis overflow-hidden"];return o.value!=null&&t.push("ml-2"),r.value!=null&&t.push("mr-2"),s.labelClass!=null&&t.push(s.labelClass),t}),a=e.computed(()=>{const t=[];return s.size==="sm"?t.push("w-3 h-3"):s.size==="lg"?t.push("w-5 h-5"):t.push("w-4 h-4"),typeof s.iconClass=="string"?t.push(s.iconClass):s.iconClass instanceof Array&&t.push(...s.iconClass),t});return(t,L)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(d.value),disabled:p.value,title:t.label,type:t.isSubmit?"submit":"button",onClick:e.withModifiers(u,["stop"])},[o.value!=null&&t.isLoading?(e.openBlock(),e.createBlock(c,{key:0,class:e.normalizeClass(a.value)},null,8,["class"])):typeof o.value=="string"?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(a.value)},e.toDisplayString(o.value),3)):o.value!=null?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{key:2,class:e.normalizeClass(a.value)},null,8,["class"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(b.value)},e.toDisplayString(t.label),3)):e.createCommentVNode("",!0),r.value!=null&&t.isLoading?(e.openBlock(),e.createBlock(c,{key:4,class:e.normalizeClass(a.value)},null,8,["class"])):typeof r.value=="string"?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(a.value)},e.toDisplayString(r.value),3)):r.value!=null?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:6,class:e.normalizeClass(a.value)},null,8,["class"])):e.createCommentVNode("",!0)],10,S))}});exports.SpinnerIcon=c;exports._sfc_main=z;