@oneb/ui-vue 0.0.8 → 0.0.10

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.
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),h=require("./common/index.cjs"),g={title:{type:String},stick:{type:String,default:"right"}},k={variant:{type:String,default:"primary"},label:{type:String},icon:{type:[Function,Object]}},y=["data-opened"],w={key:0,class:"text-sm text-secondary-content px-3 py-2 text-left"},f=e.defineComponent({__name:"OneDropdown",props:g,emits:["open"],setup(d,{emit:l}){const a=d,c=e.ref(!1),n=e.ref(null),r=()=>{c.value=!c.value,c.value&&l("open")};e.provide("OneDropdown",{onToggle:r});const t=e.computed(()=>{const o=n.value!=null&&n.value.offsetLeft<270;return n.value!=null&&n.value.offsetTop+270>window.innerHeight?"up"+(o?"-right":"-left"):"down"+(o?"-right":"-left")}),s=e.computed(()=>{const o=["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 t.value==="up"?o.push("bottom-1 mb-10"):t.value==="down"?o.push("top-1 mt-10"):t.value==="up-right"?o.push("left-0 bottom-1 mb-10"):t.value==="down-right"&&o.push("left-0 top-1 mt-10"),a.stick==="right"?o.push("right-0"):a.stick==="left"&&o.push("left-0"),o});return(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:"relative inline-block",ref_key:"menuRef",ref:n,"data-opened":c.value},[e.renderSlot(o.$slots,"button",e.normalizeProps(e.guardReactiveProps({onToggle:r,isExpanded:c.value}))),c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed top-0 left-0 w-screen h-screen z-10",onClick:r})):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(()=>[c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["menu",s.value]),role:"menu","aria-orientation":"vertical",tabindex:"-1"},[o.title?(e.openBlock(),e.createElementBlock("div",w,e.toDisplayString(o.title),1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"menu",e.normalizeProps(e.guardReactiveProps({onToggle:r})))],2)):e.createCommentVNode("",!0)]),_:3})],8,y))}}),v=["onClick"],p=e.defineComponent({__name:"OneDropdownItem",props:k,emits:["click"],setup(d,{emit:l}){const a=d,c=e.inject("OneDropdown"),n=()=>{c!==void 0&&c.onToggle(),l("click")},r=e.computed(()=>{const t=[];return a.variant==="secondary"?t.push("text-secondary-content hover:bg-secondary-body-hover"):a.variant==="danger"?t.push("text-danger-content hover:bg-danger-10"):a.variant==="warning"?t.push("text-warning-content hover:bg-warning-10"):a.variant==="info"?t.push("text-info-content hover:bg-info-10"):t.push("hover:bg-secondary-body-hover"),t});return(t,s)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap",r.value]),onClick:e.withModifiers(n,["prevent"])},[t.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon),{key:0,class:"w-4 h-4"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.label),1)],10,v))}});function x(d,l){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 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})])}function b(d,l){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 _={user:{type:Object,required:!0},menu:{type:Array,default:()=>[]},iconSize:{type:String,default:"34"},accountLabel:{type:String,default:"Account"},logoutLabel:{type:String,default:"Logout"},onAccount:{type:Function},onLogout:{type:Function}},C={workspace:{type:Object,required:!0},apps:{type:Array,required:!0},iconSize:{type:String,default:"24"},appsTitle:{type:String,default:"Apps"},changeLabel:{type:String,default:"Change"},onChange:{type:Function},onApp:{type:Function}},V=["onClick"],E={class:"space-y-2 text-center py-6",style:{width:"240px"}},N={class:"text-sm text-secondary-content"},B={class:"px-2"},S=e.defineComponent({__name:"OneUserMenu",props:_,setup(d){const l=d,a=e.computed(()=>{var r;return(r=l.menu)==null?void 0:r.map(t=>{let s={label:t.label};t.icon!=null&&(s={...s,icon:t.icon});const o=typeof t.click=="function"?t.click:()=>{};return{key:t.label,args:s,click:o}})}),c=()=>{typeof l.onAccount=="function"&&l.onAccount()},n=()=>{typeof l.onLogout=="function"&&l.onLogout()};return(r,t)=>(e.openBlock(),e.createBlock(f,{stick:"right"},{button:e.withCtx(({onToggle:s,isExpanded:o})=>{var i,u;return[e.createElementVNode("button",{onClick:s,class:e.normalizeClass(["p-1 rounded-full hover:bg-secondary-10",[o?"bg-secondary-25":""]])},[e.createVNode(h.OneAvatar,{text:((i=r.user)==null?void 0:i.name)||"",size:r.iconSize,src:(u=r.user)==null?void 0:u.photo_url,rounded:!0},null,8,["text","size","src"])],10,V)]}),menu:e.withCtx(()=>{var s,o,i,u;return[e.createElementVNode("div",E,[e.createElementVNode("div",null,[e.createVNode(h.OneAvatar,{text:((s=r.user)==null?void 0:s.name)||"",size:80,src:(o=r.user)==null?void 0:o.photo_url,rounded:!0,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",null,[e.createElementVNode("div",null,e.toDisplayString((i=r.user)==null?void 0:i.name),1),e.createElementVNode("div",N,e.toDisplayString((u=r.user)==null?void 0:u.email),1)])]),e.createElementVNode("div",B,[e.createVNode(p,{icon:e.unref(x),label:r.accountLabel,class:"rounded",onClick:c},null,8,["icon","label"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,m=>(e.openBlock(),e.createBlock(p,e.mergeProps({key:m.key},m.args,{onClick:m.click}),null,16,["onClick"]))),128)),e.createVNode(p,{icon:e.unref(b),label:r.logoutLabel,class:"rounded",onClick:n},null,8,["icon","label"])])]}),_:1}))}});function z(d,l){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"})])}const $=["onClick"],A={class:"space-x-2 flex items-center px-3 py-2",style:{width:"300px"}},L={class:"flex-shrink-0"},D={class:"w-full text-left"},O={class:"flex-shrink-0"},P={class:"px-3 py-2 border-t border-secondary-stroke"},M={class:"text-secondary-content text-left pb-1 text-sm"},j={class:"grid grid-cols-3 gap-1"},F=["onClick"],T={class:"block bg-white mx-auto flex-shrink-0 border border-secondary-stroke p-1 rounded-lg"},q={class:"w-full overflow-hidden text-ellipsis whitespace-nowrap text-center text-sm mt-1"},R=e.defineComponent({__name:"OneBrowserMenu",props:C,setup(d){const l=d,a=()=>{typeof l.onChange=="function"&&l.onChange()},c=n=>{typeof l.onApp=="function"&&l.onApp(n)};return(n,r)=>(e.openBlock(),e.createBlock(f,{stick:"right"},{button:e.withCtx(({onToggle:t,isExpanded:s})=>[e.createElementVNode("button",{onClick:t,class:e.normalizeClass(["p-1 rounded-md hover:bg-secondary-10",[s?"bg-secondary-25":""]])},[e.createVNode(e.unref(z),{class:"text-secondary-base",style:e.normalizeStyle(`width: ${n.iconSize}px; height: ${n.iconSize}px`)},null,8,["style"])],10,$)]),menu:e.withCtx(()=>{var t,s,o;return[e.createElementVNode("div",A,[e.createElementVNode("div",L,[e.createVNode(h.OneAvatar,{text:((t=n.workspace)==null?void 0:t.name)||"",src:(s=n.workspace)==null?void 0:s.photo_url,size:44,rounded:!1,class:"mx-auto"},null,8,["text","src"])]),e.createElementVNode("div",D,e.toDisplayString((o=n.workspace)==null?void 0:o.name),1),e.createElementVNode("div",O,[e.createElementVNode("button",{class:"text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",onClick:a},e.toDisplayString(n.changeLabel),1)])]),e.createElementVNode("div",P,[e.createElementVNode("div",M,e.toDisplayString(n.appsTitle),1),e.createElementVNode("div",j,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.apps,i=>(e.openBlock(),e.createElementBlock("button",{key:i.id,onClick:u=>c(i),class:"p-1.5 flex flex-col items-center justify-center rounded hover:bg-secondary-10",style:{width:"88px",height:"88px"}},[e.createElementVNode("span",T,[e.createVNode(h.OneAvatar,{text:i.name,src:i.photo_url,size:44,rounded:!1},null,8,["text","src"])]),e.createElementVNode("span",q,e.toDisplayString(i.name),1)],8,F))),128))])])]}),_:1}))}});exports._sfc_main=f;exports._sfc_main$1=p;exports._sfc_main$2=S;exports._sfc_main$3=R;
@@ -0,0 +1,446 @@
1
+ import { defineComponent as x, ref as $, provide as B, computed as w, openBlock as l, createElementBlock as d, renderSlot as z, normalizeProps as A, guardReactiveProps as L, createCommentVNode as m, createVNode as h, Transition as P, withCtx as y, normalizeClass as b, toDisplayString as f, inject as D, withModifiers as F, createBlock as v, resolveDynamicComponent as T, createElementVNode as e, unref as S, Fragment as O, renderList as M, mergeProps as V, normalizeStyle as E } from "vue";
2
+ import { OneAvatar as k } from "./common/index.js";
3
+ const q = {
4
+ title: {
5
+ type: String
6
+ },
7
+ stick: {
8
+ type: String,
9
+ default: "right"
10
+ }
11
+ }, H = {
12
+ variant: {
13
+ type: String,
14
+ default: "primary"
15
+ },
16
+ label: {
17
+ type: String
18
+ },
19
+ icon: {
20
+ type: [Function, Object]
21
+ }
22
+ }, I = ["data-opened"], N = {
23
+ key: 0,
24
+ class: "text-sm text-secondary-content px-3 py-2 text-left"
25
+ }, j = /* @__PURE__ */ x({
26
+ __name: "OneDropdown",
27
+ props: q,
28
+ emits: ["open"],
29
+ setup(p, { emit: s }) {
30
+ const u = p, c = $(!1), o = $(null), r = () => {
31
+ c.value = !c.value, c.value && s("open");
32
+ };
33
+ B("OneDropdown", {
34
+ onToggle: r
35
+ });
36
+ const t = w(() => {
37
+ const n = o.value != null && o.value.offsetLeft < 270;
38
+ return o.value != null && o.value.offsetTop + 270 > window.innerHeight ? "up" + (n ? "-right" : "-left") : "down" + (n ? "-right" : "-left");
39
+ }), i = w(() => {
40
+ const n = [
41
+ "absolute z-10 w-fit rounded-md bg-white",
42
+ "py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",
43
+ "overflow-auto max-h-[540px] min-w-[150px] max-w-[540px]"
44
+ ];
45
+ return t.value === "up" ? n.push("bottom-1 mb-10") : t.value === "down" ? n.push("top-1 mt-10") : t.value === "up-right" ? n.push("left-0 bottom-1 mb-10") : t.value === "down-right" && n.push("left-0 top-1 mt-10"), u.stick === "right" ? n.push("right-0") : u.stick === "left" && n.push("left-0"), n;
46
+ });
47
+ return (n, a) => (l(), d("div", {
48
+ class: "relative inline-block",
49
+ ref_key: "menuRef",
50
+ ref: o,
51
+ "data-opened": c.value
52
+ }, [
53
+ z(n.$slots, "button", A(L({ onToggle: r, isExpanded: c.value }))),
54
+ c.value ? (l(), d("div", {
55
+ key: 0,
56
+ class: "fixed top-0 left-0 w-screen h-screen z-10",
57
+ onClick: r
58
+ })) : m("", !0),
59
+ h(P, {
60
+ "enter-active-class": "transition ease-out duration-100",
61
+ "enter-from-class": "transform opacity-0 scale-95",
62
+ "enter-to-class": "transform opacity-100 scale-100",
63
+ "leave-active-class": "transition ease-in duration-75",
64
+ "leave-from-class": "transform opacity-100 scale-100",
65
+ "leave-to-class": "transform opacity-0 scale-95"
66
+ }, {
67
+ default: y(() => [
68
+ c.value ? (l(), d("div", {
69
+ key: 0,
70
+ class: b(["menu", i.value]),
71
+ role: "menu",
72
+ "aria-orientation": "vertical",
73
+ tabindex: "-1"
74
+ }, [
75
+ n.title ? (l(), d("div", N, f(n.title), 1)) : m("", !0),
76
+ z(n.$slots, "menu", A(L({ onToggle: r })))
77
+ ], 2)) : m("", !0)
78
+ ]),
79
+ _: 3
80
+ })
81
+ ], 8, I));
82
+ }
83
+ }), R = ["onClick"], C = /* @__PURE__ */ x({
84
+ __name: "OneDropdownItem",
85
+ props: H,
86
+ emits: ["click"],
87
+ setup(p, { emit: s }) {
88
+ const u = p, c = D("OneDropdown"), o = () => {
89
+ c !== void 0 && c.onToggle(), s("click");
90
+ }, r = w(() => {
91
+ const t = [];
92
+ return u.variant === "secondary" ? t.push("text-secondary-content hover:bg-secondary-body-hover") : u.variant === "danger" ? t.push("text-danger-content hover:bg-danger-10") : u.variant === "warning" ? t.push("text-warning-content hover:bg-warning-10") : u.variant === "info" ? t.push("text-info-content hover:bg-info-10") : t.push("hover:bg-secondary-body-hover"), t;
93
+ });
94
+ return (t, i) => (l(), d("button", {
95
+ class: b(["px-3 py-1.5 flex items-center space-x-3 w-full whitespace-nowrap", r.value]),
96
+ onClick: F(o, ["prevent"])
97
+ }, [
98
+ t.icon ? (l(), v(T(t.icon), {
99
+ key: 0,
100
+ class: "w-4 h-4"
101
+ })) : m("", !0),
102
+ e("span", null, f(t.label), 1)
103
+ ], 10, R));
104
+ }
105
+ });
106
+ function U(p, s) {
107
+ return l(), d("svg", {
108
+ xmlns: "http://www.w3.org/2000/svg",
109
+ fill: "none",
110
+ viewBox: "0 0 24 24",
111
+ "stroke-width": "1.8",
112
+ stroke: "currentColor",
113
+ "aria-hidden": "true"
114
+ }, [
115
+ e("path", {
116
+ "stroke-linecap": "round",
117
+ "stroke-linejoin": "round",
118
+ d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"
119
+ })
120
+ ]);
121
+ }
122
+ function G(p, s) {
123
+ return l(), d("svg", {
124
+ xmlns: "http://www.w3.org/2000/svg",
125
+ fill: "none",
126
+ viewBox: "0 0 24 24",
127
+ "stroke-width": "1.8",
128
+ stroke: "currentColor",
129
+ "aria-hidden": "true"
130
+ }, [
131
+ e("path", {
132
+ "stroke-linecap": "round",
133
+ "stroke-linejoin": "round",
134
+ 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"
135
+ })
136
+ ]);
137
+ }
138
+ const J = {
139
+ user: {
140
+ type: Object,
141
+ required: !0
142
+ },
143
+ menu: {
144
+ type: Array,
145
+ default: () => []
146
+ },
147
+ iconSize: {
148
+ type: String,
149
+ default: "34"
150
+ },
151
+ accountLabel: {
152
+ type: String,
153
+ default: "Account"
154
+ },
155
+ logoutLabel: {
156
+ type: String,
157
+ default: "Logout"
158
+ },
159
+ onAccount: {
160
+ type: Function
161
+ },
162
+ onLogout: {
163
+ type: Function
164
+ }
165
+ }, K = {
166
+ workspace: {
167
+ type: Object,
168
+ required: !0
169
+ },
170
+ apps: {
171
+ type: Array,
172
+ required: !0
173
+ },
174
+ iconSize: {
175
+ type: String,
176
+ default: "24"
177
+ },
178
+ appsTitle: {
179
+ type: String,
180
+ default: "Apps"
181
+ },
182
+ changeLabel: {
183
+ type: String,
184
+ default: "Change"
185
+ },
186
+ onChange: {
187
+ type: Function
188
+ },
189
+ onApp: {
190
+ type: Function
191
+ }
192
+ }, Q = ["onClick"], W = {
193
+ class: "space-y-2 text-center py-6",
194
+ style: { width: "240px" }
195
+ }, X = { class: "text-sm text-secondary-content" }, Y = { class: "px-2" }, he = /* @__PURE__ */ x({
196
+ __name: "OneUserMenu",
197
+ props: J,
198
+ setup(p) {
199
+ const s = p, u = w(() => {
200
+ var r;
201
+ return (r = s.menu) == null ? void 0 : r.map((t) => {
202
+ let i = { label: t.label };
203
+ t.icon != null && (i = { ...i, icon: t.icon });
204
+ const n = typeof t.click == "function" ? t.click : () => {
205
+ };
206
+ return {
207
+ key: t.label,
208
+ args: i,
209
+ click: n
210
+ };
211
+ });
212
+ }), c = () => {
213
+ typeof s.onAccount == "function" && s.onAccount();
214
+ }, o = () => {
215
+ typeof s.onLogout == "function" && s.onLogout();
216
+ };
217
+ return (r, t) => (l(), v(j, { stick: "right" }, {
218
+ button: y(({ onToggle: i, isExpanded: n }) => {
219
+ var a, g;
220
+ return [
221
+ e("button", {
222
+ onClick: i,
223
+ class: b(["p-1 rounded-full hover:bg-secondary-10", [n ? "bg-secondary-25" : ""]])
224
+ }, [
225
+ h(k, {
226
+ text: ((a = r.user) == null ? void 0 : a.name) || "",
227
+ size: r.iconSize,
228
+ src: (g = r.user) == null ? void 0 : g.photo_url,
229
+ rounded: !0
230
+ }, null, 8, ["text", "size", "src"])
231
+ ], 10, Q)
232
+ ];
233
+ }),
234
+ menu: y(() => {
235
+ var i, n, a, g;
236
+ return [
237
+ e("div", W, [
238
+ e("div", null, [
239
+ h(k, {
240
+ text: ((i = r.user) == null ? void 0 : i.name) || "",
241
+ size: 80,
242
+ src: (n = r.user) == null ? void 0 : n.photo_url,
243
+ rounded: !0,
244
+ class: "mx-auto"
245
+ }, null, 8, ["text", "src"])
246
+ ]),
247
+ e("div", null, [
248
+ e("div", null, f((a = r.user) == null ? void 0 : a.name), 1),
249
+ e("div", X, f((g = r.user) == null ? void 0 : g.email), 1)
250
+ ])
251
+ ]),
252
+ e("div", Y, [
253
+ h(C, {
254
+ icon: S(U),
255
+ label: r.accountLabel,
256
+ class: "rounded",
257
+ onClick: c
258
+ }, null, 8, ["icon", "label"]),
259
+ (l(!0), d(O, null, M(u.value, (_) => (l(), v(C, V({
260
+ key: _.key
261
+ }, _.args, {
262
+ onClick: _.click
263
+ }), null, 16, ["onClick"]))), 128)),
264
+ h(C, {
265
+ icon: S(G),
266
+ label: r.logoutLabel,
267
+ class: "rounded",
268
+ onClick: o
269
+ }, null, 8, ["icon", "label"])
270
+ ])
271
+ ];
272
+ }),
273
+ _: 1
274
+ }));
275
+ }
276
+ });
277
+ function Z(p, s) {
278
+ return l(), d("svg", {
279
+ xmlns: "http://www.w3.org/2000/svg",
280
+ fill: "none",
281
+ viewBox: "0 0 24 24",
282
+ "stroke-width": "1.8",
283
+ stroke: "currentColor",
284
+ "aria-hidden": "true"
285
+ }, [
286
+ e("rect", {
287
+ width: "2.94",
288
+ height: "2.94",
289
+ x: "17.16",
290
+ y: "3.9",
291
+ fill: "currentColor",
292
+ "stroke-width": "1.8",
293
+ rx: "1.1"
294
+ }),
295
+ e("rect", {
296
+ width: "2.94",
297
+ height: "2.94",
298
+ x: "10.53",
299
+ y: "3.9",
300
+ fill: "currentColor",
301
+ "stroke-width": "1.8",
302
+ rx: "1.1"
303
+ }),
304
+ e("rect", {
305
+ width: "2.94",
306
+ height: "2.94",
307
+ x: "3.9",
308
+ y: "3.9",
309
+ fill: "currentColor",
310
+ "stroke-width": "1.8",
311
+ rx: "1.1"
312
+ }),
313
+ e("rect", {
314
+ width: "2.94",
315
+ height: "2.94",
316
+ x: "17.16",
317
+ y: "10.53",
318
+ fill: "currentColor",
319
+ "stroke-width": "1.8",
320
+ rx: "1.1"
321
+ }),
322
+ e("rect", {
323
+ width: "2.94",
324
+ height: "2.94",
325
+ x: "10.53",
326
+ y: "10.53",
327
+ fill: "currentColor",
328
+ "stroke-width": "1.8",
329
+ rx: "1.1"
330
+ }),
331
+ e("rect", {
332
+ width: "2.94",
333
+ height: "2.94",
334
+ x: "3.9",
335
+ y: "10.53",
336
+ fill: "currentColor",
337
+ "stroke-width": "1.8",
338
+ rx: "1.1"
339
+ }),
340
+ e("rect", {
341
+ width: "2.94",
342
+ height: "2.94",
343
+ x: "17.16",
344
+ y: "17.16",
345
+ fill: "currentColor",
346
+ "stroke-width": "1.8",
347
+ rx: "1.1"
348
+ }),
349
+ e("rect", {
350
+ width: "2.94",
351
+ height: "2.94",
352
+ x: "10.53",
353
+ y: "17.16",
354
+ fill: "currentColor",
355
+ "stroke-width": "1.8",
356
+ rx: "1.1"
357
+ }),
358
+ e("rect", {
359
+ width: "2.94",
360
+ height: "2.94",
361
+ x: "3.9",
362
+ y: "17.16",
363
+ fill: "currentColor",
364
+ "stroke-width": "1.8",
365
+ rx: "1.1"
366
+ })
367
+ ]);
368
+ }
369
+ const ee = ["onClick"], te = {
370
+ class: "space-x-2 flex items-center px-3 py-2",
371
+ style: { width: "300px" }
372
+ }, ne = { class: "flex-shrink-0" }, oe = { class: "w-full text-left" }, re = { class: "flex-shrink-0" }, se = { class: "px-3 py-2 border-t border-secondary-stroke" }, ie = { class: "text-secondary-content text-left pb-1 text-sm" }, le = { class: "grid grid-cols-3 gap-1" }, ce = ["onClick"], ae = { class: "block bg-white mx-auto flex-shrink-0 border border-secondary-stroke p-1 rounded-lg" }, ue = { class: "w-full overflow-hidden text-ellipsis whitespace-nowrap text-center text-sm mt-1" }, fe = /* @__PURE__ */ x({
373
+ __name: "OneBrowserMenu",
374
+ props: K,
375
+ setup(p) {
376
+ const s = p, u = () => {
377
+ typeof s.onChange == "function" && s.onChange();
378
+ }, c = (o) => {
379
+ typeof s.onApp == "function" && s.onApp(o);
380
+ };
381
+ return (o, r) => (l(), v(j, { stick: "right" }, {
382
+ button: y(({ onToggle: t, isExpanded: i }) => [
383
+ e("button", {
384
+ onClick: t,
385
+ class: b(["p-1 rounded-md hover:bg-secondary-10", [i ? "bg-secondary-25" : ""]])
386
+ }, [
387
+ h(S(Z), {
388
+ class: "text-secondary-base",
389
+ style: E(`width: ${o.iconSize}px; height: ${o.iconSize}px`)
390
+ }, null, 8, ["style"])
391
+ ], 10, ee)
392
+ ]),
393
+ menu: y(() => {
394
+ var t, i, n;
395
+ return [
396
+ e("div", te, [
397
+ e("div", ne, [
398
+ h(k, {
399
+ text: ((t = o.workspace) == null ? void 0 : t.name) || "",
400
+ src: (i = o.workspace) == null ? void 0 : i.photo_url,
401
+ size: 44,
402
+ rounded: !1,
403
+ class: "mx-auto"
404
+ }, null, 8, ["text", "src"])
405
+ ]),
406
+ e("div", oe, f((n = o.workspace) == null ? void 0 : n.name), 1),
407
+ e("div", re, [
408
+ e("button", {
409
+ class: "text-sm border border-secondary-stroke rounded px-2 py-0.5 text-secondary-content hover:text-primary-content",
410
+ onClick: u
411
+ }, f(o.changeLabel), 1)
412
+ ])
413
+ ]),
414
+ e("div", se, [
415
+ e("div", ie, f(o.appsTitle), 1),
416
+ e("div", le, [
417
+ (l(!0), d(O, null, M(o.apps, (a) => (l(), d("button", {
418
+ key: a.id,
419
+ onClick: (g) => c(a),
420
+ class: "p-1.5 flex flex-col items-center justify-center rounded hover:bg-secondary-10",
421
+ style: { width: "88px", height: "88px" }
422
+ }, [
423
+ e("span", ae, [
424
+ h(k, {
425
+ text: a.name,
426
+ src: a.photo_url,
427
+ size: 44,
428
+ rounded: !1
429
+ }, null, 8, ["text", "src"])
430
+ ]),
431
+ e("span", ue, f(a.name), 1)
432
+ ], 8, ce))), 128))
433
+ ])
434
+ ])
435
+ ];
436
+ }),
437
+ _: 1
438
+ }));
439
+ }
440
+ });
441
+ export {
442
+ j as _,
443
+ C as a,
444
+ he as b,
445
+ fe as c
446
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../_plugin-vue_export-helper-f246444f.cjs"),n={},s={class:"mb-4 bg-white border border-block rounded"};function c(r,t){return e.openBlock(),e.createElementBlock("div",s,[e.renderSlot(r.$slots,"default")])}const d=o._export_sfc(n,[["render",c]]),l={},a={class:"p-3"};function i(r,t){return e.openBlock(),e.createElementBlock("div",a,[e.renderSlot(r.$slots,"default")])}const _=o._export_sfc(l,[["render",i]]),p={title:{type:String,required:!1},description:{type:String,required:!1}},u={class:"p-3 bg-gray-50 rounded-t flex items-center justify-between space-x-3 border-b border-secondary-stroke"},f={class:"w-full"},m={key:0,class:"text-lg font-medium"},k={key:1,class:"text-xs text-gray-700 pt-2"},b={class:"flex items-center space-x-2"},y=e.defineComponent({__name:"OneCardHeader",props:p,setup(r){return(t,C)=>(e.openBlock(),e.createElementBlock("div",u,[e.createElementVNode("div",f,[t.title?(e.openBlock(),e.createElementBlock("p",m,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("p",k,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",b,[e.renderSlot(t.$slots,"default")])]))}}),g={},B={class:"p-3 bg-gray-50 rounded-b border-t border-secondary-stroke"};function h(r,t){return e.openBlock(),e.createElementBlock("div",B,[e.renderSlot(r.$slots,"default")])}const $=o._export_sfc(g,[["render",h]]);exports.OneCard=d;exports.OneCardBody=_;exports.OneCardFooter=$;exports.OneCardHeader=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../_plugin-vue_export-helper-f246444f.cjs"),n={},s={class:"mb-4 bg-white border border-block rounded"};function c(r,t){return e.openBlock(),e.createElementBlock("div",s,[e.renderSlot(r.$slots,"default")])}const d=o._export_sfc(n,[["render",c]]),l={},a={class:"p-3 xl:p-6 space-y-3 xl:space-y-4"};function i(r,t){return e.openBlock(),e.createElementBlock("div",a,[e.renderSlot(r.$slots,"default")])}const _=o._export_sfc(l,[["render",i]]),p={title:{type:String,required:!1},description:{type:String,required:!1}},u={class:"p-3 bg-gray-50 rounded-t flex items-center justify-between space-x-3 border-b border-secondary-stroke"},f={class:"w-full"},m={key:0,class:"text-lg font-medium"},y={key:1,class:"text-xs text-gray-700 pt-2"},k={class:"flex items-center space-x-2"},b=e.defineComponent({__name:"OneCardHeader",props:p,setup(r){return(t,C)=>(e.openBlock(),e.createElementBlock("div",u,[e.createElementVNode("div",f,[t.title?(e.openBlock(),e.createElementBlock("p",m,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("p",y,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",k,[e.renderSlot(t.$slots,"default")])]))}}),h={},B={class:"p-3 xl:p-6 rounded-b border-t border-secondary-stroke"},x={class:"flex items-center justify-end space-x-3"};function $(r,t){return e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("div",x,[e.renderSlot(r.$slots,"default")])])}const g=o._export_sfc(h,[["render",$]]);exports.OneCard=d;exports.OneCardBody=_;exports.OneCardFooter=g;exports.OneCardHeader=b;
@@ -1,18 +1,18 @@
1
- import { openBlock as r, createElementBlock as s, renderSlot as o, defineComponent as i, createElementVNode as d, toDisplayString as c, createCommentVNode as a } from "vue";
2
- import { _ as n } from "../_plugin-vue_export-helper-dad06003.js";
1
+ import { openBlock as s, createElementBlock as r, renderSlot as o, defineComponent as i, createElementVNode as n, toDisplayString as d, createCommentVNode as a } from "vue";
2
+ import { _ as c } from "../_plugin-vue_export-helper-dad06003.js";
3
3
  const _ = {}, l = { class: "mb-4 bg-white border border-block rounded" };
4
4
  function p(t, e) {
5
- return r(), s("div", l, [
5
+ return s(), r("div", l, [
6
6
  o(t.$slots, "default")
7
7
  ]);
8
8
  }
9
- const B = /* @__PURE__ */ n(_, [["render", p]]), f = {}, u = { class: "p-3" };
9
+ const H = /* @__PURE__ */ c(_, [["render", p]]), f = {}, u = { class: "p-3 xl:p-6 space-y-3 xl:space-y-4" };
10
10
  function m(t, e) {
11
- return r(), s("div", u, [
11
+ return s(), r("div", u, [
12
12
  o(t.$slots, "default")
13
13
  ]);
14
14
  }
15
- const H = /* @__PURE__ */ n(f, [["render", m]]), b = {
15
+ const j = /* @__PURE__ */ c(f, [["render", m]]), h = {
16
16
  title: {
17
17
  type: String,
18
18
  required: !1
@@ -21,36 +21,38 @@ const H = /* @__PURE__ */ n(f, [["render", m]]), b = {
21
21
  type: String,
22
22
  required: !1
23
23
  }
24
- }, h = { class: "p-3 bg-gray-50 rounded-t flex items-center justify-between space-x-3 border-b border-secondary-stroke" }, y = { class: "w-full" }, $ = {
24
+ }, y = { class: "p-3 bg-gray-50 rounded-t flex items-center justify-between space-x-3 border-b border-secondary-stroke" }, b = { class: "w-full" }, $ = {
25
25
  key: 0,
26
26
  class: "text-lg font-medium"
27
- }, g = {
27
+ }, x = {
28
28
  key: 1,
29
29
  class: "text-xs text-gray-700 pt-2"
30
- }, k = { class: "flex items-center space-x-2" }, q = /* @__PURE__ */ i({
30
+ }, g = { class: "flex items-center space-x-2" }, q = /* @__PURE__ */ i({
31
31
  __name: "OneCardHeader",
32
- props: b,
32
+ props: h,
33
33
  setup(t) {
34
- return (e, O) => (r(), s("div", h, [
35
- d("div", y, [
36
- e.title ? (r(), s("p", $, c(e.title), 1)) : a("", !0),
37
- e.description ? (r(), s("p", g, c(e.description), 1)) : a("", !0)
34
+ return (e, S) => (s(), r("div", y, [
35
+ n("div", b, [
36
+ e.title ? (s(), r("p", $, d(e.title), 1)) : a("", !0),
37
+ e.description ? (s(), r("p", x, d(e.description), 1)) : a("", !0)
38
38
  ]),
39
- d("div", k, [
39
+ n("div", g, [
40
40
  o(e.$slots, "default")
41
41
  ])
42
42
  ]));
43
43
  }
44
- }), C = {}, v = { class: "p-3 bg-gray-50 rounded-b border-t border-secondary-stroke" };
45
- function x(t, e) {
46
- return r(), s("div", v, [
47
- o(t.$slots, "default")
44
+ }), k = {}, v = { class: "p-3 xl:p-6 rounded-b border-t border-secondary-stroke" }, C = { class: "flex items-center justify-end space-x-3" };
45
+ function O(t, e) {
46
+ return s(), r("div", v, [
47
+ n("div", C, [
48
+ o(t.$slots, "default")
49
+ ])
48
50
  ]);
49
51
  }
50
- const E = /* @__PURE__ */ n(C, [["render", x]]);
52
+ const E = /* @__PURE__ */ c(k, [["render", O]]);
51
53
  export {
52
- B as OneCard,
53
- H as OneCardBody,
54
+ H as OneCard,
55
+ j as OneCardBody,
54
56
  E as OneCardFooter,
55
57
  q as OneCardHeader
56
58
  };
@@ -0,0 +1,21 @@
1
+ import type { ExtractPropTypes } from "vue";
2
+ export declare const avatarProps: {
3
+ size: {
4
+ type: PropType<string | number>;
5
+ default: string;
6
+ };
7
+ rounded: {
8
+ type: BooleanConstructor;
9
+ default: boolean;
10
+ };
11
+ text: {
12
+ type: StringConstructor;
13
+ required: boolean;
14
+ default: string;
15
+ };
16
+ src: {
17
+ type: PropType<string>;
18
+ required: boolean;
19
+ };
20
+ };
21
+ export type AvatarProps = ExtractPropTypes<typeof avatarProps>;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p={size:{type:[String,Number],default:"50"},rounded:{type:Boolean,default:!1},text:{type:String,required:!1,default:""},src:{type:[String,null],required:!1}},m=["src"],y=e.defineComponent({__name:"OneAvatar",props:p,setup(s){const t=s,n=e.computed(()=>{const r=t.text.trim().split(" ");return r.length<2?t.text.slice(0,2).toUpperCase():r.map(l=>l.slice(0,1)).join("").toUpperCase()}),a=e.computed(()=>({fill:"rgba(255, 255, 255, .75)",fontSize:`${Number(t.size)*.4}px`})),c=e.computed(()=>{const r=t.text.split("").map(o=>o.charCodeAt(0)).reduce((o,d)=>o+d,0),u=`hsl(${360/26*r}, 68%, 48%)`;return{width:`${t.size}px`,height:`${t.size}px`,borderRadius:t.rounded?"100%":"9%",background:u}}),i=e.computed(()=>({width:`${t.size}px`,height:`${t.size}px`,borderRadius:t.rounded?"100%":"9%"}));return(r,l)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(i.value),class:"overflow-hidden"},[r.src?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.src,alt:"",class:"w-full h-full"},null,8,m)):(e.openBlock(),e.createElementBlock("svg",{key:1,style:e.normalizeStyle(c.value),class:"block"},[n.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:"50%",y:"50%","text-anchor":"middle","dominant-baseline":"central",class:"font-light",style:e.normalizeStyle(a.value)},e.toDisplayString(n.value),5)):e.createCommentVNode("",!0)],4))],4))}});exports.OneAvatar=y;
@@ -0,0 +1,2 @@
1
+ export { default as OneAvatar } from './OneAvatar.vue';
2
+ export type { AvatarProps } from './avatar';
@@ -0,0 +1,72 @@
1
+ import { defineComponent as f, computed as r, openBlock as s, createElementBlock as n, normalizeStyle as a, toDisplayString as y, createCommentVNode as g } from "vue";
2
+ const x = {
3
+ size: {
4
+ type: [String, Number],
5
+ default: "50"
6
+ },
7
+ rounded: {
8
+ type: Boolean,
9
+ default: !1
10
+ },
11
+ text: {
12
+ type: String,
13
+ required: !1,
14
+ default: ""
15
+ },
16
+ src: {
17
+ type: [String, null],
18
+ required: !1
19
+ }
20
+ }, v = ["src"], S = /* @__PURE__ */ f({
21
+ __name: "OneAvatar",
22
+ props: x,
23
+ setup(c) {
24
+ const e = c, i = r(() => {
25
+ const t = e.text.trim().split(" ");
26
+ return t.length < 2 ? e.text.slice(0, 2).toUpperCase() : t.map((l) => l.slice(0, 1)).join("").toUpperCase();
27
+ }), u = r(() => ({
28
+ fill: "rgba(255, 255, 255, .75)",
29
+ fontSize: `${Number(e.size) * 0.4}px`
30
+ })), d = r(() => {
31
+ const t = e.text.split("").map((o) => o.charCodeAt(0)).reduce((o, h) => o + h, 0), m = `hsl(${360 / 26 * t}, 68%, 48%)`;
32
+ return {
33
+ width: `${e.size}px`,
34
+ height: `${e.size}px`,
35
+ borderRadius: e.rounded ? "100%" : "9%",
36
+ background: m
37
+ };
38
+ }), p = r(() => ({
39
+ width: `${e.size}px`,
40
+ height: `${e.size}px`,
41
+ borderRadius: e.rounded ? "100%" : "9%"
42
+ }));
43
+ return (t, l) => (s(), n("div", {
44
+ style: a(p.value),
45
+ class: "overflow-hidden"
46
+ }, [
47
+ t.src ? (s(), n("img", {
48
+ key: 0,
49
+ src: t.src,
50
+ alt: "",
51
+ class: "w-full h-full"
52
+ }, null, 8, v)) : (s(), n("svg", {
53
+ key: 1,
54
+ style: a(d.value),
55
+ class: "block"
56
+ }, [
57
+ i.value ? (s(), n("text", {
58
+ key: 0,
59
+ x: "50%",
60
+ y: "50%",
61
+ "text-anchor": "middle",
62
+ "dominant-baseline": "central",
63
+ class: "font-light",
64
+ style: a(u.value)
65
+ }, y(i.value), 5)) : g("", !0)
66
+ ], 4))
67
+ ], 4));
68
+ }
69
+ });
70
+ export {
71
+ S as OneAvatar
72
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-f88ecb85.cjs");require("vue");require("../_plugin-vue_export-helper-f246444f.cjs");exports.OneBrowserMenu=e._sfc_main$3;exports.OneDropdown=e._sfc_main;exports.OneDropdownDivider=e.OneDropdownDivider;exports.OneDropdownItem=e._sfc_main$1;exports.OneUserMenu=e._sfc_main$2;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../OneBrowserMenu.vue_vue_type_script_setup_true_lang-4c394828.cjs"),r=require("vue"),n=require("../_plugin-vue_export-helper-f246444f.cjs");require("../common/index.cjs");const o={},t={class:"border-t border-secondary-stroke my-1"};function _(s,i){return r.openBlock(),r.createElementBlock("div",t)}const c=n._export_sfc(o,[["render",_]]);exports.OneBrowserMenu=e._sfc_main$3;exports.OneDropdown=e._sfc_main;exports.OneDropdownItem=e._sfc_main$1;exports.OneUserMenu=e._sfc_main$2;exports.OneDropdownDivider=c;