@vezham/react 26.0.0-alpha.8 → 26.0.0-beta.1
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/dist/lib/components/command/index.js +2 -2
- package/dist/lib/components/menu/index.js +2 -2
- package/dist/lib/components/panel/footer/ai/message-actions.js +2 -2
- package/dist/lib/components/panel/footer/ai/mock-result.js +2 -2
- package/dist/lib/components/panel/footer/control-center/appearance.d.ts +2 -1
- package/dist/lib/components/panel/footer/control-center/appearance.d.ts.map +1 -1
- package/dist/lib/components/panel/footer/control-center/appearance.js +4 -3
- package/dist/lib/components/panel/footer/control-center/control-center.js +11 -8
- package/dist/lib/components/panel/footer/control-center/direction.d.ts +2 -1
- package/dist/lib/components/panel/footer/control-center/direction.d.ts.map +1 -1
- package/dist/lib/components/panel/footer/control-center/direction.js +6 -4
- package/dist/lib/components/panel/footer/control-center/editor.d.ts +3 -1
- package/dist/lib/components/panel/footer/control-center/editor.d.ts.map +1 -1
- package/dist/lib/components/panel/footer/control-center/editor.js +24 -6
- package/dist/lib/components/panel/footer/control-center/preview.d.ts +4 -2
- package/dist/lib/components/panel/footer/control-center/preview.d.ts.map +1 -1
- package/dist/lib/components/panel/footer/control-center/preview.js +4 -2
- package/dist/lib/components/panel/footer/control-center/tile.d.ts.map +1 -1
- package/dist/lib/components/panel/footer/control-center/tile.js +12 -7
- package/dist/lib/components/panel/footer/control-center/variant.d.ts +27 -0
- package/dist/lib/components/panel/footer/control-center/variant.d.ts.map +1 -1
- package/dist/lib/components/panel/footer/control-center/variant.js +30 -9
- package/dist/lib/components/panel/footer/index.d.ts.map +1 -1
- package/dist/lib/components/panel/footer/index.js +17 -11
- package/dist/lib/components/panel/footer/notification-center/index.js +2 -2
- package/dist/lib/components/panel/footer/notification-center/widget-tiles.d.ts +88 -3
- package/dist/lib/components/panel/footer/notification-center/widget-tiles.d.ts.map +1 -1
- package/dist/lib/components/panel/footer/notification-center/widget-tiles.js +63 -25
- package/dist/lib/components/panel/footer/user-menu.d.ts +8 -1
- package/dist/lib/components/panel/footer/user-menu.d.ts.map +1 -1
- package/dist/lib/components/panel/footer/user-menu.js +252 -142
- package/dist/lib/components/panel/header/application-menu-sheet.js +5 -5
- package/dist/lib/components/panel/header/bookmarks/bookmark-file-tree/index.js +1 -1
- package/dist/lib/components/panel/header/bookmarks/bookmark-file-tree/variants.js +1 -1
- package/dist/lib/components/panel/header/bookmarks/favorites/grid-list.js +2 -2
- package/dist/lib/components/panel/header/bookmarks/index.js +2 -1
- package/dist/lib/components/panel/header/bookmarks/shortcut-context-menu.js +2 -1
- package/dist/lib/components/panel/header/bookmarks/tree-data.js +2 -1
- package/dist/lib/components/panel/header/index.js +5 -5
- package/dist/lib/components/panel/header/storage/types.d.ts +1 -1
- package/dist/lib/components/panel/info-panel/container.module.js +4 -2
- package/dist/lib/components/panel/menu/index.js +2 -2
- package/dist/lib/components/panel/menu/types.d.ts +1 -1
- package/dist/lib/layouts/menu-layout/index-md.js +3 -3
- package/dist/lib/layouts/menu-layout/index-sm.js +2 -2
- package/dist/lib/layouts/section/index.d.ts.map +1 -1
- package/dist/lib/layouts/section/index.js +7 -7
- package/dist/lib/layouts/section/sidebar.js +2 -2
- package/dist/lib/layouts/section/toolbar-more-sheet.js +3 -3
- package/dist/lib/layouts/section/toolbar.js +4 -4
- package/dist/lib/pages/settings/index.d.ts.map +1 -1
- package/dist/lib/pages/settings/index.js +72 -27
- package/dist/lib/pages/settings/navigation.d.ts +1 -1
- package/dist/lib/pages/settings/navigation.d.ts.map +1 -1
- package/dist/lib/pages/settings/settings-content.js +1 -1
- package/dist/lib/pages/settings/tile-gallery.d.ts +6 -1
- package/dist/lib/pages/settings/tile-gallery.d.ts.map +1 -1
- package/dist/lib/pages/settings/tile-gallery.js +175 -100
- package/dist/lib/store/useBookmarks/index.js +2 -2
- package/dist/lib/store/useStorage/index.js +1 -1
- package/package.json +2 -2
|
@@ -3,8 +3,8 @@ import { MenuSheet } from "../../menu/sheet.js";
|
|
|
3
3
|
import { DEFAULT_STATUS_OPTION, STATUS_OPTIONS, STATUS_TIMING_OPTIONS, SUGGESTED_STATUS_OPTIONS, isColorStatus } from "./data.js";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { Avatar, Badge, Button, Dropdown, Separator, Tooltip, useMediaQuery } from "@vezham/react-v3";
|
|
6
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { AltArrowLeft, AltArrowRight, CheckRead, Logout2, Settings } from "@vezham/icons-react";
|
|
6
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { AltArrowLeft, AltArrowRight, Bell, CheckRead, Logout2, Settings, VezhamTamizhi } from "@vezham/icons-react";
|
|
8
8
|
//#region src/lib/components/panel/footer/user-menu.tsx
|
|
9
9
|
var StatusVisual = ({ status }) => {
|
|
10
10
|
if (isColorStatus(status.id)) return /* @__PURE__ */ jsx("span", { className: `h-2 w-2 rounded-full ${status.color ?? ""}` });
|
|
@@ -79,48 +79,104 @@ var useAccountSections = (user) => {
|
|
|
79
79
|
]
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
82
|
+
var AccountActions = ({ actions }) => {
|
|
83
|
+
if (actions.length === 0) return null;
|
|
84
|
+
return /* @__PURE__ */ jsx("div", {
|
|
85
|
+
className: "flex items-center justify-center gap-2",
|
|
86
|
+
role: "group",
|
|
87
|
+
"aria-label": "Account actions",
|
|
88
|
+
children: actions.map((action) => /* @__PURE__ */ jsxs(Tooltip, {
|
|
89
|
+
delay: 0,
|
|
90
|
+
children: [/* @__PURE__ */ jsx(Tooltip.Trigger, { children: /* @__PURE__ */ jsx(Button, {
|
|
91
|
+
"aria-label": action.label,
|
|
92
|
+
isIconOnly: true,
|
|
93
|
+
size: "lg",
|
|
94
|
+
variant: "ghost",
|
|
95
|
+
onPress: action.onPress,
|
|
96
|
+
children: action.icon
|
|
97
|
+
}) }), /* @__PURE__ */ jsx(Tooltip.Content, {
|
|
98
|
+
placement: "top",
|
|
99
|
+
children: action.label
|
|
100
|
+
})]
|
|
101
|
+
}, action.label))
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
var AccountIdentity = ({ user, currentStatus }) => /* @__PURE__ */ jsxs("div", {
|
|
105
|
+
className: "flex flex-col items-center gap-2 text-center",
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ jsxs(Badge.Anchor, { children: [/* @__PURE__ */ jsxs(Avatar, {
|
|
108
|
+
className: "size-20",
|
|
109
|
+
children: [user.avatar ? /* @__PURE__ */ jsx(Avatar.Image, {
|
|
110
|
+
src: user.avatar,
|
|
111
|
+
alt: user.name
|
|
112
|
+
}) : null, /* @__PURE__ */ jsx(Avatar.Fallback, {
|
|
113
|
+
className: "text-xl",
|
|
114
|
+
children: user.name?.[0]
|
|
115
|
+
})]
|
|
116
|
+
}), /* @__PURE__ */ jsx(Badge, {
|
|
117
|
+
placement: "bottom-right",
|
|
118
|
+
size: "sm",
|
|
119
|
+
className: "border-surface flex items-center justify-center border-2",
|
|
120
|
+
children: /* @__PURE__ */ jsx(StatusVisual, { status: currentStatus })
|
|
121
|
+
})] }),
|
|
122
|
+
/* @__PURE__ */ jsx("span", {
|
|
123
|
+
className: "text-base font-semibold",
|
|
124
|
+
children: user.name
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ jsxs("span", {
|
|
127
|
+
className: "text-muted flex items-center gap-1 text-sm",
|
|
128
|
+
children: [/* @__PURE__ */ jsx(StatusVisual, { status: currentStatus }), currentStatus.label]
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
});
|
|
132
|
+
var AccountSectionItems = ({ section, onBack }) => /* @__PURE__ */ jsxs("div", {
|
|
133
|
+
className: "flex flex-col gap-1",
|
|
134
|
+
children: [/* @__PURE__ */ jsxs(Button, {
|
|
135
|
+
variant: "ghost",
|
|
136
|
+
className: "h-auto min-h-11 w-full justify-start gap-3 px-3 py-2 text-start",
|
|
137
|
+
onPress: onBack,
|
|
138
|
+
"aria-label": "Back to account menu",
|
|
139
|
+
children: [/* @__PURE__ */ jsx(AltArrowLeft, {
|
|
140
|
+
size: 18,
|
|
141
|
+
"aria-hidden": "true"
|
|
142
|
+
}), section.title]
|
|
143
|
+
}), section.options.map((option) => /* @__PURE__ */ jsxs(Button, {
|
|
144
|
+
variant: "ghost",
|
|
145
|
+
className: `h-auto min-h-11 w-full justify-start gap-3 px-3 py-2 text-start ${option.id === "clear" ? "text-danger" : ""}`,
|
|
146
|
+
"aria-pressed": section.selected === option.id,
|
|
147
|
+
onPress: () => {
|
|
148
|
+
section.onSelect(option.id);
|
|
149
|
+
onBack();
|
|
150
|
+
},
|
|
151
|
+
children: [
|
|
152
|
+
option.visual,
|
|
153
|
+
/* @__PURE__ */ jsx("span", {
|
|
154
|
+
className: "min-w-0 flex-1 text-start",
|
|
155
|
+
children: option.label
|
|
156
|
+
}),
|
|
157
|
+
section.selected === option.id ? /* @__PURE__ */ jsx(CheckRead, {
|
|
158
|
+
size: 16,
|
|
159
|
+
"aria-hidden": "true"
|
|
160
|
+
}) : null
|
|
161
|
+
]
|
|
162
|
+
}, option.id))]
|
|
163
|
+
});
|
|
164
|
+
var AccountSheetContent = ({ user, currentStatus, actions, sections, onSection, onPreferences, onLogout }) => /* @__PURE__ */ jsxs("div", {
|
|
165
|
+
className: "flex flex-col items-center gap-5 py-2",
|
|
166
|
+
children: [
|
|
167
|
+
/* @__PURE__ */ jsx(AccountIdentity, {
|
|
168
|
+
user,
|
|
169
|
+
currentStatus
|
|
115
170
|
}),
|
|
116
|
-
/* @__PURE__ */ jsx(
|
|
117
|
-
|
|
118
|
-
|
|
171
|
+
/* @__PURE__ */ jsx(AccountActions, { actions }),
|
|
172
|
+
/* @__PURE__ */ jsx(Separator, { className: "self-stretch" }),
|
|
173
|
+
/* @__PURE__ */ jsxs("div", {
|
|
174
|
+
className: "flex w-full flex-col gap-1 p-2",
|
|
119
175
|
children: [
|
|
120
|
-
|
|
176
|
+
sections.map((item) => /* @__PURE__ */ jsxs(Button, {
|
|
121
177
|
variant: "ghost",
|
|
122
178
|
className: "h-auto min-h-11 w-full justify-start gap-3 px-3 py-2 text-start",
|
|
123
|
-
onPress: () =>
|
|
179
|
+
onPress: () => onSection(item.id),
|
|
124
180
|
children: [/* @__PURE__ */ jsx("span", {
|
|
125
181
|
className: "min-w-0 flex-1 truncate text-start",
|
|
126
182
|
children: item.label
|
|
@@ -133,10 +189,7 @@ var UserMenu = ({ user, onLogout, onProfile, onPreferences }) => {
|
|
|
133
189
|
/* @__PURE__ */ jsxs(Button, {
|
|
134
190
|
variant: "ghost",
|
|
135
191
|
className: "h-auto min-h-11 w-full justify-start gap-3 px-3 py-2 text-start",
|
|
136
|
-
onPress:
|
|
137
|
-
setOpen(false);
|
|
138
|
-
onPreferences?.();
|
|
139
|
-
},
|
|
192
|
+
onPress: onPreferences,
|
|
140
193
|
children: [/* @__PURE__ */ jsx(Settings, {
|
|
141
194
|
size: 18,
|
|
142
195
|
"aria-hidden": "true"
|
|
@@ -145,67 +198,7 @@ var UserMenu = ({ user, onLogout, onProfile, onPreferences }) => {
|
|
|
145
198
|
/* @__PURE__ */ jsxs(Button, {
|
|
146
199
|
variant: "ghost",
|
|
147
200
|
className: "text-danger h-auto min-h-11 w-full justify-start gap-3 px-3 py-2 text-start",
|
|
148
|
-
onPress:
|
|
149
|
-
setOpen(false);
|
|
150
|
-
onLogout();
|
|
151
|
-
},
|
|
152
|
-
children: [/* @__PURE__ */ jsx(Logout2, {
|
|
153
|
-
size: 18,
|
|
154
|
-
"aria-hidden": "true"
|
|
155
|
-
}), "Logout"]
|
|
156
|
-
})
|
|
157
|
-
]
|
|
158
|
-
}) : /* @__PURE__ */ jsxs(Dropdown.Menu, {
|
|
159
|
-
"aria-label": "Account actions",
|
|
160
|
-
children: [
|
|
161
|
-
accountSections.map((item) => /* @__PURE__ */ jsxs(Dropdown.SubmenuTrigger, { children: [/* @__PURE__ */ jsxs(Dropdown.Item, {
|
|
162
|
-
id: item.id,
|
|
163
|
-
textValue: item.label,
|
|
164
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
165
|
-
className: "min-w-0 flex-1 truncate",
|
|
166
|
-
children: item.label
|
|
167
|
-
}), /* @__PURE__ */ jsx(Dropdown.SubmenuIndicator, {})]
|
|
168
|
-
}), /* @__PURE__ */ jsx(Dropdown.Popover, {
|
|
169
|
-
className: "z-90 w-64 max-w-[calc(100vw-2rem)]",
|
|
170
|
-
children: /* @__PURE__ */ jsx(Dropdown.Menu, {
|
|
171
|
-
"aria-label": item.title,
|
|
172
|
-
selectionMode: "single",
|
|
173
|
-
selectedKeys: item.selected ? [item.selected] : [],
|
|
174
|
-
onAction: (key) => item.onSelect(String(key)),
|
|
175
|
-
children: item.options.map((option) => /* @__PURE__ */ jsxs(Dropdown.Item, {
|
|
176
|
-
id: option.id,
|
|
177
|
-
textValue: option.label,
|
|
178
|
-
className: option.id === "clear" ? "text-danger" : "",
|
|
179
|
-
children: [
|
|
180
|
-
option.visual,
|
|
181
|
-
/* @__PURE__ */ jsx("span", {
|
|
182
|
-
className: "min-w-0 flex-1",
|
|
183
|
-
children: option.label
|
|
184
|
-
}),
|
|
185
|
-
/* @__PURE__ */ jsx(Dropdown.ItemIndicator, {})
|
|
186
|
-
]
|
|
187
|
-
}, option.id))
|
|
188
|
-
})
|
|
189
|
-
})] }, item.id)),
|
|
190
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
191
|
-
/* @__PURE__ */ jsxs(Dropdown.Item, {
|
|
192
|
-
id: "preferences",
|
|
193
|
-
onAction: () => {
|
|
194
|
-
setOpen(false);
|
|
195
|
-
onPreferences?.();
|
|
196
|
-
},
|
|
197
|
-
children: [/* @__PURE__ */ jsx(Settings, {
|
|
198
|
-
size: 18,
|
|
199
|
-
"aria-hidden": "true"
|
|
200
|
-
}), "Preferences"]
|
|
201
|
-
}),
|
|
202
|
-
/* @__PURE__ */ jsxs(Dropdown.Item, {
|
|
203
|
-
id: "logout",
|
|
204
|
-
variant: "danger",
|
|
205
|
-
onAction: () => {
|
|
206
|
-
setOpen(false);
|
|
207
|
-
onLogout();
|
|
208
|
-
},
|
|
201
|
+
onPress: onLogout,
|
|
209
202
|
children: [/* @__PURE__ */ jsx(Logout2, {
|
|
210
203
|
size: 18,
|
|
211
204
|
"aria-hidden": "true"
|
|
@@ -213,11 +206,87 @@ var UserMenu = ({ user, onLogout, onProfile, onPreferences }) => {
|
|
|
213
206
|
})
|
|
214
207
|
]
|
|
215
208
|
})
|
|
216
|
-
]
|
|
217
|
-
|
|
209
|
+
]
|
|
210
|
+
});
|
|
211
|
+
var AccountDropdownContent = ({ user, currentStatus, sections, onProfile, onPreferences, onLogout }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
212
|
+
/* @__PURE__ */ jsxs("button", {
|
|
213
|
+
type: "button",
|
|
214
|
+
className: "hover:bg-default-100 flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left",
|
|
215
|
+
onClick: onProfile,
|
|
216
|
+
children: [/* @__PURE__ */ jsxs(Avatar, {
|
|
217
|
+
size: "sm",
|
|
218
|
+
children: [user.avatar ? /* @__PURE__ */ jsx(Avatar.Image, {
|
|
219
|
+
src: user.avatar,
|
|
220
|
+
alt: user.name
|
|
221
|
+
}) : null, /* @__PURE__ */ jsx(Avatar.Fallback, { children: user.name?.[0] })]
|
|
222
|
+
}), /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("span", {
|
|
223
|
+
className: "block font-medium",
|
|
224
|
+
children: user.name
|
|
225
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
226
|
+
className: "text-muted flex items-center gap-1 text-xs",
|
|
227
|
+
children: [/* @__PURE__ */ jsx(StatusVisual, { status: currentStatus }), currentStatus.label]
|
|
228
|
+
})] })]
|
|
229
|
+
}),
|
|
230
|
+
/* @__PURE__ */ jsx(Separator, {}),
|
|
231
|
+
/* @__PURE__ */ jsxs(Dropdown.Menu, {
|
|
232
|
+
"aria-label": "Account actions",
|
|
233
|
+
children: [
|
|
234
|
+
sections.map((item) => /* @__PURE__ */ jsxs(Dropdown.SubmenuTrigger, { children: [/* @__PURE__ */ jsxs(Dropdown.Item, {
|
|
235
|
+
id: item.id,
|
|
236
|
+
textValue: item.label,
|
|
237
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
238
|
+
className: "min-w-0 flex-1 truncate",
|
|
239
|
+
children: item.label
|
|
240
|
+
}), /* @__PURE__ */ jsx(Dropdown.SubmenuIndicator, {})]
|
|
241
|
+
}), /* @__PURE__ */ jsx(Dropdown.Popover, {
|
|
242
|
+
className: "z-90 w-64 max-w-[calc(100vw-2rem)]",
|
|
243
|
+
children: /* @__PURE__ */ jsx(Dropdown.Menu, {
|
|
244
|
+
"aria-label": item.title,
|
|
245
|
+
selectionMode: "single",
|
|
246
|
+
selectedKeys: item.selected ? [item.selected] : [],
|
|
247
|
+
onAction: (key) => item.onSelect(String(key)),
|
|
248
|
+
children: item.options.map((option) => /* @__PURE__ */ jsxs(Dropdown.Item, {
|
|
249
|
+
id: option.id,
|
|
250
|
+
textValue: option.label,
|
|
251
|
+
className: option.id === "clear" ? "text-danger" : "",
|
|
252
|
+
children: [
|
|
253
|
+
option.visual,
|
|
254
|
+
/* @__PURE__ */ jsx("span", {
|
|
255
|
+
className: "min-w-0 flex-1",
|
|
256
|
+
children: option.label
|
|
257
|
+
}),
|
|
258
|
+
/* @__PURE__ */ jsx(Dropdown.ItemIndicator, {})
|
|
259
|
+
]
|
|
260
|
+
}, option.id))
|
|
261
|
+
})
|
|
262
|
+
})] }, item.id)),
|
|
263
|
+
/* @__PURE__ */ jsx(Separator, {}),
|
|
264
|
+
/* @__PURE__ */ jsxs(Dropdown.Item, {
|
|
265
|
+
id: "preferences",
|
|
266
|
+
onAction: onPreferences,
|
|
267
|
+
children: [/* @__PURE__ */ jsx(Settings, {
|
|
268
|
+
size: 18,
|
|
269
|
+
"aria-hidden": "true"
|
|
270
|
+
}), "Preferences"]
|
|
271
|
+
}),
|
|
272
|
+
/* @__PURE__ */ jsxs(Dropdown.Item, {
|
|
273
|
+
id: "logout",
|
|
274
|
+
variant: "danger",
|
|
275
|
+
onAction: onLogout,
|
|
276
|
+
children: [/* @__PURE__ */ jsx(Logout2, {
|
|
277
|
+
size: 18,
|
|
278
|
+
"aria-hidden": "true"
|
|
279
|
+
}), "Logout"]
|
|
280
|
+
})
|
|
281
|
+
]
|
|
282
|
+
})
|
|
283
|
+
] });
|
|
284
|
+
var UserMenuTrigger = ({ small, bubble, user, currentStatus, tooltipText, onPress }) => {
|
|
285
|
+
const Trigger = small ? Button : Dropdown.Trigger;
|
|
286
|
+
return /* @__PURE__ */ jsxs(Tooltip, {
|
|
218
287
|
delay: 0,
|
|
219
288
|
children: [/* @__PURE__ */ jsx(Tooltip.Trigger, { children: /* @__PURE__ */ jsx(Trigger, {
|
|
220
|
-
onPress: small ?
|
|
289
|
+
onPress: small ? onPress : void 0,
|
|
221
290
|
"aria-label": `Open ${user.name || "user"} menu`,
|
|
222
291
|
className: `button button--ghost relative flex h-12 w-12 items-center justify-center ${bubble ? "rounded-full" : "rounded-xl"}`,
|
|
223
292
|
children: /* @__PURE__ */ jsxs(Badge.Anchor, { children: [/* @__PURE__ */ jsxs(Avatar, {
|
|
@@ -238,43 +307,77 @@ var UserMenu = ({ user, onLogout, onProfile, onPreferences }) => {
|
|
|
238
307
|
children: tooltipText
|
|
239
308
|
})]
|
|
240
309
|
});
|
|
241
|
-
|
|
310
|
+
};
|
|
311
|
+
var UserMenu = ({ user, onLogout, onProfile, onPreferences, showAI = false, showControlCenter = false, showNotifications = false, notificationCount = 0, onAI, onControlCenter, onNotifications }) => {
|
|
312
|
+
const small = useMediaQuery(APPLICATION_MENU_SHEET_MEDIA_QUERY, { initializeWithValue: false });
|
|
313
|
+
const bubble = useMediaQuery(ACCOUNT_BUBBLE_MEDIA_QUERY, { initializeWithValue: false });
|
|
314
|
+
const [open, setOpen] = useState(false);
|
|
315
|
+
const [section, setSection] = useState(null);
|
|
316
|
+
const { currentStatus, tooltipText, accountSections } = useAccountSections(user);
|
|
317
|
+
const activeSection = accountSections.find((item) => item.id === section);
|
|
318
|
+
const changeOpen = (value) => {
|
|
319
|
+
setOpen(value);
|
|
320
|
+
if (!value) setSection(null);
|
|
321
|
+
};
|
|
322
|
+
const closeAndRun = (action) => {
|
|
323
|
+
setOpen(false);
|
|
324
|
+
action?.();
|
|
325
|
+
};
|
|
326
|
+
const compactActions = [
|
|
327
|
+
showControlCenter ? {
|
|
328
|
+
label: "Control center",
|
|
329
|
+
icon: /* @__PURE__ */ jsx(Settings, {
|
|
330
|
+
size: 24,
|
|
331
|
+
"aria-hidden": "true"
|
|
332
|
+
}),
|
|
333
|
+
onPress: onControlCenter
|
|
334
|
+
} : null,
|
|
335
|
+
showNotifications ? {
|
|
336
|
+
label: "Notifications",
|
|
337
|
+
icon: /* @__PURE__ */ jsxs(Badge.Anchor, { children: [/* @__PURE__ */ jsx(Bell, {
|
|
338
|
+
size: 24,
|
|
339
|
+
"aria-hidden": "true"
|
|
340
|
+
}), notificationCount > 0 ? /* @__PURE__ */ jsx(Badge, {
|
|
341
|
+
content: String(notificationCount),
|
|
342
|
+
color: "danger",
|
|
343
|
+
size: "sm"
|
|
344
|
+
}) : null] }),
|
|
345
|
+
onPress: onNotifications
|
|
346
|
+
} : null,
|
|
347
|
+
showAI ? {
|
|
348
|
+
label: "Tamizhi AI",
|
|
349
|
+
icon: /* @__PURE__ */ jsx(VezhamTamizhi, {
|
|
350
|
+
size: 24,
|
|
351
|
+
"aria-hidden": "true"
|
|
352
|
+
}),
|
|
353
|
+
onPress: onAI
|
|
354
|
+
} : null
|
|
355
|
+
].filter((action) => action !== null);
|
|
356
|
+
const trigger = /* @__PURE__ */ jsx(UserMenuTrigger, {
|
|
357
|
+
small,
|
|
358
|
+
bubble,
|
|
359
|
+
user,
|
|
360
|
+
currentStatus,
|
|
361
|
+
tooltipText,
|
|
362
|
+
onPress: () => setOpen(true)
|
|
363
|
+
});
|
|
364
|
+
return small ? /* @__PURE__ */ jsxs(Fragment$1, { children: [trigger, /* @__PURE__ */ jsx(MenuSheet, {
|
|
242
365
|
title: "Account",
|
|
243
366
|
hideTitle: true,
|
|
244
367
|
isOpen: open,
|
|
245
368
|
onOpenChange: changeOpen,
|
|
246
|
-
children: activeSection ? /* @__PURE__ */
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
variant: "ghost",
|
|
259
|
-
className: `h-auto min-h-11 w-full justify-start gap-3 px-3 py-2 text-start ${option.id === "clear" ? "text-danger" : ""}`,
|
|
260
|
-
"aria-pressed": activeSection.selected === option.id,
|
|
261
|
-
onPress: () => {
|
|
262
|
-
activeSection.onSelect(option.id);
|
|
263
|
-
setSection(null);
|
|
264
|
-
},
|
|
265
|
-
children: [
|
|
266
|
-
option.visual,
|
|
267
|
-
/* @__PURE__ */ jsx("span", {
|
|
268
|
-
className: "min-w-0 flex-1 text-start",
|
|
269
|
-
children: option.label
|
|
270
|
-
}),
|
|
271
|
-
activeSection.selected === option.id && /* @__PURE__ */ jsx(CheckRead, {
|
|
272
|
-
size: 16,
|
|
273
|
-
"aria-hidden": "true"
|
|
274
|
-
})
|
|
275
|
-
]
|
|
276
|
-
}, option.id))]
|
|
277
|
-
}) : content
|
|
369
|
+
children: activeSection ? /* @__PURE__ */ jsx(AccountSectionItems, {
|
|
370
|
+
section: activeSection,
|
|
371
|
+
onBack: () => setSection(null)
|
|
372
|
+
}) : /* @__PURE__ */ jsx(AccountSheetContent, {
|
|
373
|
+
user,
|
|
374
|
+
currentStatus,
|
|
375
|
+
actions: compactActions,
|
|
376
|
+
sections: accountSections,
|
|
377
|
+
onSection: setSection,
|
|
378
|
+
onPreferences: () => closeAndRun(onPreferences),
|
|
379
|
+
onLogout: () => closeAndRun(onLogout)
|
|
380
|
+
})
|
|
278
381
|
})] }) : /* @__PURE__ */ jsxs(Dropdown, {
|
|
279
382
|
isOpen: open,
|
|
280
383
|
onOpenChange: changeOpen,
|
|
@@ -282,7 +385,14 @@ var UserMenu = ({ user, onLogout, onProfile, onPreferences }) => {
|
|
|
282
385
|
placement: bubble ? "bottom end" : "right",
|
|
283
386
|
offset: 8,
|
|
284
387
|
className: "w-72 max-w-[calc(100vw-2rem)]",
|
|
285
|
-
children:
|
|
388
|
+
children: /* @__PURE__ */ jsx(AccountDropdownContent, {
|
|
389
|
+
user,
|
|
390
|
+
currentStatus,
|
|
391
|
+
sections: accountSections,
|
|
392
|
+
onProfile: () => closeAndRun(onProfile),
|
|
393
|
+
onPreferences: () => closeAndRun(onPreferences),
|
|
394
|
+
onLogout: () => closeAndRun(onLogout)
|
|
395
|
+
})
|
|
286
396
|
})]
|
|
287
397
|
});
|
|
288
398
|
};
|
|
@@ -5,7 +5,7 @@ import { MenuSheet } from "../../menu/sheet.js";
|
|
|
5
5
|
import { ShortcutKey } from "../../shortcut-key/index.js";
|
|
6
6
|
import { useState } from "react";
|
|
7
7
|
import { Button, Label, Separator } from "@vezham/react-v3";
|
|
8
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { AltArrowLeft, AltArrowRight, Archive, Bookmark, SidebarMinimalistic } from "@vezham/icons-react";
|
|
10
10
|
//#region src/lib/components/panel/header/application-menu-sheet.tsx
|
|
11
11
|
var actionClass = "h-auto min-h-11 w-full justify-start gap-3 rounded-lg px-3 py-2 text-start";
|
|
@@ -30,7 +30,7 @@ var ApplicationMenuSheet = ({ isOpen, onOpenChange, trigger, onClose, onSearch,
|
|
|
30
30
|
trigger,
|
|
31
31
|
children: /* @__PURE__ */ jsx("div", {
|
|
32
32
|
className: "flex flex-col gap-1",
|
|
33
|
-
children: menu ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Button, {
|
|
33
|
+
children: menu ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Button, {
|
|
34
34
|
variant: "ghost",
|
|
35
35
|
className: actionClass,
|
|
36
36
|
"aria-label": "Back to application menu",
|
|
@@ -65,14 +65,14 @@ var ApplicationMenuSheet = ({ isOpen, onOpenChange, trigger, onClose, onSearch,
|
|
|
65
65
|
})
|
|
66
66
|
]
|
|
67
67
|
}, action.key))]
|
|
68
|
-
}, group.map((action) => action.key).join(":")))] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
}, group.map((action) => action.key).join(":")))] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
69
69
|
/* @__PURE__ */ jsx(Button, {
|
|
70
70
|
variant: "ghost",
|
|
71
71
|
className: actionClass,
|
|
72
72
|
onPress: close,
|
|
73
73
|
children: "Back to home"
|
|
74
74
|
}),
|
|
75
|
-
showHistoryNavigation && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Button, {
|
|
75
|
+
showHistoryNavigation && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Button, {
|
|
76
76
|
variant: "ghost",
|
|
77
77
|
className: actionClass,
|
|
78
78
|
"aria-label": "Back",
|
|
@@ -134,7 +134,7 @@ var ApplicationMenuSheet = ({ isOpen, onOpenChange, trigger, onClose, onSearch,
|
|
|
134
134
|
/* @__PURE__ */ jsx(ShortcutKey, { shortcut: "⌘ S" })
|
|
135
135
|
]
|
|
136
136
|
}),
|
|
137
|
-
showMenuUtilities && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Separator, { className: "my-1" }), /* @__PURE__ */ jsxs(Button, {
|
|
137
|
+
showMenuUtilities && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Separator, { className: "my-1" }), /* @__PURE__ */ jsxs(Button, {
|
|
138
138
|
variant: "ghost",
|
|
139
139
|
className: actionClass,
|
|
140
140
|
"aria-label": "Open command palette",
|
|
@@ -97,7 +97,7 @@ var BookmarkFileTree = ({ items, defaultExpandedKeys, getFileTreeProps, getBookm
|
|
|
97
97
|
type: item.kind,
|
|
98
98
|
item
|
|
99
99
|
});
|
|
100
|
-
setSelectedKeys(new Set([item.id]));
|
|
100
|
+
setSelectedKeys(/* @__PURE__ */ new Set([item.id]));
|
|
101
101
|
};
|
|
102
102
|
const handleAreaContextMenu = () => {
|
|
103
103
|
setContextTarget({ type: "area" });
|
|
@@ -212,7 +212,7 @@ var insertTreeItemsOnTarget = (items, targetId, movedItems, existingIds) => {
|
|
|
212
212
|
var moveTreeItemToFolder = (items, movedId, targetFolderId) => {
|
|
213
213
|
if (targetFolderId && movedId === targetFolderId) return { items };
|
|
214
214
|
const movedItems = [];
|
|
215
|
-
const itemsWithoutMoved = removeTreeItems(items, new Set([movedId]), movedItems);
|
|
215
|
+
const itemsWithoutMoved = removeTreeItems(items, /* @__PURE__ */ new Set([movedId]), movedItems);
|
|
216
216
|
if (!movedItems.length) return { items };
|
|
217
217
|
if (!targetFolderId) return { items: normalizeBookmarkGroups([...itemsWithoutMoved, ...movedItems]) };
|
|
218
218
|
if (!findTreeItem(itemsWithoutMoved, targetFolderId)) return { items };
|
|
@@ -4,7 +4,7 @@ import { ShortcutContextMenu } from "../shortcut-context-menu.js";
|
|
|
4
4
|
import { tva } from "./variant.js";
|
|
5
5
|
import { useMemo } from "react";
|
|
6
6
|
import { Avatar, cn } from "@vezham/react-v3";
|
|
7
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { Button as Button$1, GridList, GridListItem } from "react-aria-components";
|
|
9
9
|
//#region src/lib/components/panel/header/bookmarks/favorites/grid-list.tsx
|
|
10
10
|
var FavoriteGridList = ({ items = sampleFavorites, onAction, onRemove, onReorder, dragAndDropHooks, classNames, ...variantProps }) => {
|
|
@@ -35,7 +35,7 @@ var FavoriteGridList = ({ items = sampleFavorites, onAction, onRemove, onReorder
|
|
|
35
35
|
"data-shortcut-id": item.id,
|
|
36
36
|
id: item.id,
|
|
37
37
|
textValue: item.name,
|
|
38
|
-
children: ({ allowsDragging }) => /* @__PURE__ */ jsxs(Fragment, { children: [allowsDragging && /* @__PURE__ */ jsx(Button$1, {
|
|
38
|
+
children: ({ allowsDragging }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [allowsDragging && /* @__PURE__ */ jsx(Button$1, {
|
|
39
39
|
"aria-label": `Drag ${item.name}`,
|
|
40
40
|
className: slots.dragButton({ class: classNames?.dragButton }),
|
|
41
41
|
slot: "drag"
|
|
@@ -137,7 +137,8 @@ var BookmarksContent = forwardRef((props, ref) => {
|
|
|
137
137
|
setFolderModalOpen(false);
|
|
138
138
|
};
|
|
139
139
|
const handleBookmarkMove = (id, targetFolderId) => {
|
|
140
|
-
|
|
140
|
+
const result = moveTreeItemToFolder(activeBookmarkTreeItems, id, targetFolderId);
|
|
141
|
+
handleBookmarkTreeChange(result.items);
|
|
141
142
|
};
|
|
142
143
|
return /* @__PURE__ */ jsxs(Component, {
|
|
143
144
|
className: "h-full min-h-0",
|
|
@@ -7,7 +7,8 @@ import { ContextMenu } from "@vezham/react-pro-v3";
|
|
|
7
7
|
var ShortcutContextMenu = ({ children, items, kind, onRemove }) => {
|
|
8
8
|
const [targetId, setTargetId] = useState(null);
|
|
9
9
|
const rememberTarget = (target) => {
|
|
10
|
-
|
|
10
|
+
const element = target instanceof Element ? target.closest("[data-shortcut-id]") : null;
|
|
11
|
+
setTargetId(element?.dataset.shortcutId ?? null);
|
|
11
12
|
};
|
|
12
13
|
const target = items.find((item) => item.id === targetId);
|
|
13
14
|
const label = kind === "favorite" ? "Remove Favorite" : "Unpin";
|
|
@@ -64,7 +64,8 @@ var bookmarksToTreeItems = (bookmarks) => {
|
|
|
64
64
|
bookmark.children?.forEach((child) => appendBookmark(child, folderPath));
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
const folderPath = parentPath.length ? parentPath : getFolderPathFromBookmark(bookmark);
|
|
68
|
+
ensureFolder(folderPath).push(createBookmarkTreeNode(bookmark, idCounts));
|
|
68
69
|
};
|
|
69
70
|
bookmarks.forEach((bookmark) => appendBookmark(bookmark));
|
|
70
71
|
return treeItems;
|
|
@@ -9,7 +9,7 @@ import { BookmarksTrigger } from "./bookmarks/index.js";
|
|
|
9
9
|
import { StorageTrigger } from "./storage/index.js";
|
|
10
10
|
import { useCallback, useState } from "react";
|
|
11
11
|
import { Avatar, Button, Dropdown, Label, Separator, Surface, Tooltip, useMediaQuery } from "@vezham/react-v3";
|
|
12
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { AltArrowDown, Archive, Bookmark, Magnifier, SidebarMinimalistic } from "@vezham/icons-react";
|
|
14
14
|
//#region src/lib/components/panel/header/index.tsx
|
|
15
15
|
var Header = ({ users, showSearch = false, showBookamarks = false, showStorage = false, onAvatarClick, onSearchClick, isDockHidden = false, onToggleDock, isSidebarOpen = false, onToggleSidebar, extraActions, className, compact = false, hideSeparator = false, showMenuUtilities = true }) => {
|
|
@@ -95,7 +95,7 @@ var Header = ({ users, showSearch = false, showBookamarks = false, showStorage =
|
|
|
95
95
|
})]
|
|
96
96
|
})]
|
|
97
97
|
});
|
|
98
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Surface, {
|
|
98
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Surface, {
|
|
99
99
|
variant: "transparent",
|
|
100
100
|
className: `flex flex-row items-center gap-1 md:flex-col md:gap-3 ${className ?? ""}`,
|
|
101
101
|
"data-vx": "header",
|
|
@@ -190,7 +190,7 @@ var HeaderApplicationMenuContent = ({ onClose, onSearch, navigationLabel, onTogg
|
|
|
190
190
|
onPress: onClose,
|
|
191
191
|
children: /* @__PURE__ */ jsx(Label, { children: "Back to home" })
|
|
192
192
|
}),
|
|
193
|
-
showHistoryNavigation && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Dropdown.Item, {
|
|
193
|
+
showHistoryNavigation && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Dropdown.Item, {
|
|
194
194
|
id: "back",
|
|
195
195
|
textValue: "Back",
|
|
196
196
|
"aria-keyshortcuts": "Meta+ArrowLeft",
|
|
@@ -252,7 +252,7 @@ var HeaderApplicationMenuContent = ({ onClose, onSearch, navigationLabel, onTogg
|
|
|
252
252
|
})
|
|
253
253
|
]
|
|
254
254
|
}),
|
|
255
|
-
showMenuUtilities && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Separator, {}), /* @__PURE__ */ jsxs(Dropdown.Item, {
|
|
255
|
+
showMenuUtilities && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Separator, {}), /* @__PURE__ */ jsxs(Dropdown.Item, {
|
|
256
256
|
id: "search",
|
|
257
257
|
textValue: "Search",
|
|
258
258
|
"aria-label": "Open command palette",
|
|
@@ -319,7 +319,7 @@ var HeaderApplicationMenuContent = ({ onClose, onSearch, navigationLabel, onTogg
|
|
|
319
319
|
};
|
|
320
320
|
var HeaderPanelMenuItems = ({ showBookamarks, showStorage, onClose }) => {
|
|
321
321
|
const { toggleInfoPanel, activeInfoPanel, isOpen } = useInfoPanel();
|
|
322
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [showBookamarks && /* @__PURE__ */ jsxs(Dropdown.Item, {
|
|
322
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [showBookamarks && /* @__PURE__ */ jsxs(Dropdown.Item, {
|
|
323
323
|
id: "bookmarks",
|
|
324
324
|
textValue: "Bookmarks",
|
|
325
325
|
"aria-label": "Bookmarks",
|
|
@@ -341,7 +341,7 @@ declare const useProps: (originalProps: Props) => {
|
|
|
341
341
|
variant?: "dark" | "light" | "default" | "glass" | undefined;
|
|
342
342
|
} & import('tailwind-variants').ClassProp<import('tailwind-variants').ClassValue>) | undefined) => string;
|
|
343
343
|
};
|
|
344
|
-
classNames: Partial<Record<"tabs" | "base" | "search_input" | "search_input_wrapper" | "search_icon" | "empty_container" | "empty_icon" | "empty_title" | "empty_description" | "item" | "tabs_list_container" | "tabs_list" | "tab_archive" | "tab_trash" | "tab_indicator" | "
|
|
344
|
+
classNames: Partial<Record<"tabs" | "base" | "container" | "search_input" | "search_input_wrapper" | "search_icon" | "empty_container" | "empty_icon" | "empty_title" | "empty_description" | "item" | "tabs_list_container" | "tabs_list" | "tab_archive" | "tab_trash" | "tab_indicator" | "actions_bar" | "actions_bar_with_gap" | "clear_all_button" | "restore_all_button" | "items_container" | "date_group" | "date_header" | "date_label" | "date_divider" | "items_list" | "item_favicon" | "item_fallback_icon" | "item_content" | "item_title" | "item_url" | "item_actions" | "unarchive_button" | "restore_button" | "delete_button" | "delete_permanent_button" | "action_icon" | "action_icon_success" | "action_icon_danger" | "action_icon_default", string>> | undefined;
|
|
345
345
|
children: ReactNode;
|
|
346
346
|
getTabsProps: () => {
|
|
347
347
|
className: string;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
//#region src/lib/components/panel/info-panel/container.module.css
|
|
2
|
+
var panel = "_panel_inr1p_1";
|
|
1
3
|
var container_module_default = {
|
|
2
|
-
panel
|
|
4
|
+
panel,
|
|
3
5
|
"panel-enter": "_panel-enter_inr1p_1",
|
|
4
6
|
"panel-exit": "_panel-exit_inr1p_1",
|
|
5
7
|
"panel-reduced": "_panel-reduced_inr1p_1"
|
|
6
8
|
};
|
|
7
9
|
//#endregion
|
|
8
|
-
export { container_module_default as default };
|
|
10
|
+
export { container_module_default as default, panel };
|