@rapidmx/web-client 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/apps/shared/components/admin/settings/BrandingForm.tsx +398 -385
  2. package/apps/shared/components/admin/settings/EncryptionPolicyForm.tsx +119 -112
  3. package/apps/shared/components/admin/settings/MailboxPolicyForm.tsx +198 -152
  4. package/apps/shared/components/admin/settings/PluginsManager.tsx +1288 -1235
  5. package/apps/shared/components/admin/settings/RetentionPolicyForm.tsx +9 -1
  6. package/apps/shared/components/admin/setup/EscrowSetupStep.tsx +288 -290
  7. package/apps/shared/components/admin/setup/SetupWizard.tsx +443 -416
  8. package/apps/shared/components/layout/AppShell.tsx +288 -288
  9. package/apps/shared/components/mail/ConversationList.tsx +225 -33
  10. package/apps/shared/components/mail/ConversationThreadPane.tsx +434 -216
  11. package/apps/shared/components/mail/MailListToolbar.tsx +265 -0
  12. package/apps/shared/components/mail/MailSelectionBar.tsx +222 -0
  13. package/apps/shared/components/mail/MenuButton.tsx +384 -0
  14. package/apps/shared/components/mail/MessageDetailPane.tsx +280 -215
  15. package/apps/shared/components/mail/MoveToFolderDialog.tsx +263 -0
  16. package/apps/shared/components/mail/compose/ComposeContext.tsx +29 -2
  17. package/apps/shared/components/mail/compose/ComposeWindow.tsx +1700 -1652
  18. package/apps/shared/components/mail/compose/RecipientInput.tsx +356 -0
  19. package/apps/shared/components/mail/compose/RichTextEditor.tsx +38 -3
  20. package/apps/shared/components/mail/compose/quotedBody.ts +100 -0
  21. package/apps/shared/components/mail/compose/recipients.ts +104 -0
  22. package/apps/shared/components/mail/labelMenu.tsx +278 -0
  23. package/apps/shared/components/mail/layout/MailShell.tsx +445 -420
  24. package/apps/shared/components/mail/listPreferences.ts +228 -0
  25. package/apps/shared/components/settings/layout/SettingsShell.tsx +0 -1
  26. package/apps/shared/styles/app.css +28 -5
  27. package/apps/www/index.tsx +1854 -1314
  28. package/apps/www/messages/[uid].tsx +5 -4
  29. package/dist/apps/shared/components/admin/settings/BrandingForm.d.ts +7 -3
  30. package/dist/apps/shared/components/admin/settings/BrandingForm.js +6 -5
  31. package/dist/apps/shared/components/admin/settings/EncryptionPolicyForm.d.ts +4 -1
  32. package/dist/apps/shared/components/admin/settings/EncryptionPolicyForm.js +2 -2
  33. package/dist/apps/shared/components/admin/settings/MailboxPolicyForm.d.ts +9 -2
  34. package/dist/apps/shared/components/admin/settings/MailboxPolicyForm.js +20 -4
  35. package/dist/apps/shared/components/admin/settings/PluginsManager.d.ts +8 -1
  36. package/dist/apps/shared/components/admin/settings/PluginsManager.js +33 -14
  37. package/dist/apps/shared/components/admin/settings/RetentionPolicyForm.d.ts +4 -1
  38. package/dist/apps/shared/components/admin/settings/RetentionPolicyForm.js +2 -2
  39. package/dist/apps/shared/components/admin/setup/EscrowSetupStep.js +1 -1
  40. package/dist/apps/shared/components/admin/setup/SetupWizard.js +14 -10
  41. package/dist/apps/shared/components/mail/ConversationList.d.ts +42 -6
  42. package/dist/apps/shared/components/mail/ConversationList.js +84 -10
  43. package/dist/apps/shared/components/mail/ConversationThreadPane.d.ts +52 -13
  44. package/dist/apps/shared/components/mail/ConversationThreadPane.js +217 -60
  45. package/dist/apps/shared/components/mail/MailListToolbar.d.ts +55 -0
  46. package/dist/apps/shared/components/mail/MailListToolbar.js +149 -0
  47. package/dist/apps/shared/components/mail/MailSelectionBar.d.ts +59 -0
  48. package/dist/apps/shared/components/mail/MailSelectionBar.js +48 -0
  49. package/dist/apps/shared/components/mail/MenuButton.d.ts +71 -0
  50. package/dist/apps/shared/components/mail/MenuButton.js +211 -0
  51. package/dist/apps/shared/components/mail/MessageDetailPane.d.ts +27 -19
  52. package/dist/apps/shared/components/mail/MessageDetailPane.js +126 -129
  53. package/dist/apps/shared/components/mail/MoveToFolderDialog.d.ts +57 -0
  54. package/dist/apps/shared/components/mail/MoveToFolderDialog.js +138 -0
  55. package/dist/apps/shared/components/mail/compose/ComposeContext.d.ts +16 -1
  56. package/dist/apps/shared/components/mail/compose/ComposeContext.js +3 -1
  57. package/dist/apps/shared/components/mail/compose/ComposeWindow.js +52 -20
  58. package/dist/apps/shared/components/mail/compose/RecipientInput.d.ts +36 -0
  59. package/dist/apps/shared/components/mail/compose/RecipientInput.js +203 -0
  60. package/dist/apps/shared/components/mail/compose/RichTextEditor.d.ts +10 -1
  61. package/dist/apps/shared/components/mail/compose/RichTextEditor.js +21 -3
  62. package/dist/apps/shared/components/mail/compose/quotedBody.d.ts +37 -0
  63. package/dist/apps/shared/components/mail/compose/quotedBody.js +85 -0
  64. package/dist/apps/shared/components/mail/compose/recipients.d.ts +24 -0
  65. package/dist/apps/shared/components/mail/compose/recipients.js +87 -0
  66. package/dist/apps/shared/components/mail/labelMenu.d.ts +97 -0
  67. package/dist/apps/shared/components/mail/labelMenu.js +134 -0
  68. package/dist/apps/shared/components/mail/layout/MailShell.d.ts +8 -0
  69. package/dist/apps/shared/components/mail/layout/MailShell.js +15 -3
  70. package/dist/apps/shared/components/mail/listPreferences.d.ts +101 -0
  71. package/dist/apps/shared/components/mail/listPreferences.js +186 -0
  72. package/dist/apps/shared/components/settings/layout/SettingsShell.js +0 -1
  73. package/dist/apps/shared/styles/app.css +28 -5
  74. package/dist/apps/www/index.js +506 -112
  75. package/dist/apps/www/messages/[uid].js +2 -3
  76. package/package.json +2 -2
  77. package/apps/www/settings/focused-inbox/index.tsx +0 -150
  78. package/dist/apps/www/settings/focused-inbox/index.d.ts +0 -4
  79. package/dist/apps/www/settings/focused-inbox/index.js +0 -71
@@ -0,0 +1,384 @@
1
+ ///////////////////////////////////////////////////////////////////////////////
2
+ // Copyright (C) 2026 Jean-Philippe Steinmetz
3
+ // SPDX-License-Identifier: MPL-2.0
4
+ ///////////////////////////////////////////////////////////////////////////////
5
+ import React, { ReactNode, useEffect, useRef, useState } from "react";
6
+ import { HiCheck, HiChevronDown, HiChevronLeft, HiChevronRight, HiMinus } from "react-icons/hi2";
7
+ import PopoverPortal from "@rapidmx/react-shared/components/overlays/PopoverPortal.js";
8
+
9
+ /** What every row has. `checked` turns it into a radio/checkbox item (the caller says which via `role`) and
10
+ * draws the checkmark column; without it the row is a plain command. */
11
+ interface MenuItemBase {
12
+ key: string;
13
+ label: string;
14
+ /** A one-line explanation under the label, for an item whose effect isn't obvious from its name. */
15
+ description?: string;
16
+ role?: "menuitem" | "menuitemradio" | "menuitemcheckbox";
17
+ /** `"mixed"` is ARIA's third checkbox state - some of the things this row acts on have it and some
18
+ * don't, which is what a label applied to only part of a multi-message selection looks like. */
19
+ checked?: boolean | "mixed";
20
+ /** A colour swatch before the label - a label's own colour. */
21
+ swatchColor?: string;
22
+ disabled?: boolean;
23
+ /** Leaves the menu open after choosing this row, for a multi-select list where several rows are ticked
24
+ * before one command commits them all. */
25
+ keepOpen?: boolean;
26
+ }
27
+
28
+ /** A row that does something when chosen. */
29
+ export interface MenuCommandSpec extends MenuItemBase {
30
+ onSelect: () => void;
31
+ submenu?: never;
32
+ }
33
+
34
+ /** A row that opens a submenu instead: choosing it replaces the menu's contents with these sections, under
35
+ * a Back row. One level deep, which is all any menu here needs - so it has nothing of its own to do. */
36
+ export interface MenuSubmenuSpec extends MenuItemBase {
37
+ submenu: MenuSectionSpec[];
38
+ onSelect?: never;
39
+ }
40
+
41
+ export type MenuItemSpec = MenuCommandSpec | MenuSubmenuSpec;
42
+
43
+ /** A labelled group of items. Groups after the first are drawn with a separator above them. */
44
+ export interface MenuSectionSpec {
45
+ key: string;
46
+ label?: string;
47
+ /** A short note under the group's items - e.g. why some of them are unavailable right now. */
48
+ note?: string;
49
+ items: MenuItemSpec[];
50
+ }
51
+
52
+ // `PopoverPortal` positions a fixed-size box (it has no auto-height mode), so the menu's height is
53
+ // computed from its own contents rather than measured - from whichever level is *shown*, so a submenu
54
+ // isn't left standing in the parent menu's taller box. These are the exact heights the classes below
55
+ // render at, so the box is never short enough to clip its last row: an item is `h-9`, a group label
56
+ // `h-6`, a note as many `leading-4` lines as it wraps to, a separator a 1px rule inside `my-1`, and the
57
+ // list itself `py-1`.
58
+ const ITEM_HEIGHT = 36;
59
+ const ITEM_DESCRIPTION_HEIGHT = 16;
60
+ const GROUP_LABEL_HEIGHT = 24;
61
+ const NOTE_LINE_HEIGHT = 16;
62
+ const NOTE_PADDING = 4;
63
+ /** A note wraps, so its height depends on how much of it fits a line: `text-xs` averages a little over 6px
64
+ * a character, and the note sits inside the list's `px-3`. Rounded so the estimate is never *under* the
65
+ * lines the browser actually draws - a box a few pixels too tall shows blank space, one too short clips. */
66
+ const NOTE_CHAR_WIDTH = 6.4;
67
+ const NOTE_PADDING_X = 24;
68
+ const SEPARATOR_HEIGHT = 9;
69
+ const LIST_PADDING = 8;
70
+ const MENU_MAX_HEIGHT = 460;
71
+ const DEFAULT_MENU_WIDTH = 248;
72
+
73
+ /** How tall `note` renders at `width`, wrapped. */
74
+ function noteHeight(note: string, width: number): number {
75
+ const charsPerLine = Math.max(1, Math.floor((width - NOTE_PADDING_X) / NOTE_CHAR_WIDTH));
76
+ return Math.ceil(note.length / charsPerLine) * NOTE_LINE_HEIGHT + NOTE_PADDING;
77
+ }
78
+
79
+ /** The height `PopoverPortal` is asked for - exact for a short menu, capped (the list scrolls) for a long one. */
80
+ export function menuHeight(sections: MenuSectionSpec[], width: number = DEFAULT_MENU_WIDTH): number {
81
+ let height = LIST_PADDING;
82
+ sections.forEach((section, index) => {
83
+ if (index > 0) {
84
+ height += SEPARATOR_HEIGHT;
85
+ }
86
+ if (section.label) {
87
+ height += GROUP_LABEL_HEIGHT;
88
+ }
89
+ for (const item of section.items) {
90
+ height += ITEM_HEIGHT + (item.description ? ITEM_DESCRIPTION_HEIGHT : 0);
91
+ }
92
+ if (section.note) {
93
+ height += noteHeight(section.note, width);
94
+ }
95
+ });
96
+ return Math.min(height, MENU_MAX_HEIGHT);
97
+ }
98
+
99
+ export interface MenuButtonProps {
100
+ /** The trigger's visible label. */
101
+ label: ReactNode;
102
+ /** The trigger's accessible name, which also names the menu itself - includes the current selection
103
+ * where there is one ("Filter: Unread"), so the button says what it's set to, not just what it does. */
104
+ "aria-label": string;
105
+ icon?: ReactNode;
106
+ disabled?: boolean;
107
+ title?: string;
108
+ sections: MenuSectionSpec[];
109
+ width?: number;
110
+ /** Extra classes for the trigger, on top of the shared toolbar-button styling. */
111
+ className?: string;
112
+ /** Told whenever the menu opens or closes - how a caller resets a draft it keeps for the menu's own
113
+ * multi-select rows (see `useLabelDraft()`). */
114
+ onOpenChange?: (open: boolean) => void;
115
+ }
116
+
117
+ /**
118
+ * A toolbar button that opens an ARIA menu: `role="menu"` rows with checkmarks for the current choice,
119
+ * full keyboard support (Enter/Space or Arrow Down to open, arrows/Home/End to move with wrap, Enter/Space
120
+ * to choose, Escape or Tab to close with focus returning to the trigger) and a click outside to dismiss.
121
+ *
122
+ * Rendered through `PopoverPortal` rather than as an absolutely-positioned child: the mail list toolbar
123
+ * lives inside the list's own `overflow-y-auto` scroll container, which clips an absolute popup however
124
+ * high its `z-index` - the same reason Compose's own pickers portal out (see `PopoverPortal`'s own doc
125
+ * comment). The portal supplies the positioning, the outside-click dismissal and the box; the menu
126
+ * semantics, roving focus and keyboard handling are this component's own.
127
+ */
128
+ export default function MenuButton({
129
+ label,
130
+ icon,
131
+ disabled,
132
+ title,
133
+ sections,
134
+ width = DEFAULT_MENU_WIDTH,
135
+ className = "",
136
+ "aria-label": ariaLabel,
137
+ onOpenChange,
138
+ }: MenuButtonProps) {
139
+ const [open, setOpen] = useState(false);
140
+ const [activeIndex, setActiveIndex] = useState(0);
141
+ // The key of the item whose submenu is showing, or `null` at the top level. Held as a key, not as the
142
+ // item itself, because `sections` is rebuilt on every render.
143
+ const [submenuKey, setSubmenuKey] = useState<string | null>(null);
144
+ const triggerRef = useRef<HTMLButtonElement>(null);
145
+ const itemRefs = useRef<(HTMLButtonElement | null)[]>([]);
146
+ // State, not a ref: `PopoverPortal` renders nothing at all until its own positioning effect has run, so
147
+ // the rows don't exist yet when this component's effects first fire. Keying the focus effect on the
148
+ // menu node itself makes it run again once they do.
149
+ const [menuNode, setMenuNode] = useState<HTMLDivElement | null>(null);
150
+
151
+ const openSubmenu = sections
152
+ .flatMap((section) => section.items)
153
+ .find((item): item is MenuSubmenuSpec => item.key === submenuKey && !!item.submenu);
154
+ /** The row that leaves a submenu again - synthesized rather than asked of the caller, so every submenu
155
+ * has the same way back however it was built. */
156
+ const backItem: MenuCommandSpec = {
157
+ key: "__back",
158
+ label: `Back to ${ariaLabel}`,
159
+ keepOpen: true,
160
+ onSelect: () => leaveSubmenu(),
161
+ };
162
+ const shownSections: MenuSectionSpec[] = openSubmenu
163
+ ? [{ key: "__back", items: [backItem] }, ...openSubmenu.submenu]
164
+ : sections;
165
+ const items = shownSections.flatMap((section) => section.items);
166
+ const enabledIndexes = items.map((item, index) => (item.disabled ? -1 : index)).filter((index) => index !== -1);
167
+
168
+ /** The row focus starts on: the current choice where there is one, else the first row that can take focus. */
169
+ function initialActiveIndex(within: MenuItemSpec[]): number {
170
+ const checked = within.findIndex((item) => item.checked === true && !item.disabled);
171
+ const enabled = within.map((item, index) => (item.disabled ? -1 : index)).filter((index) => index !== -1);
172
+ return checked === -1 ? (enabled[0] ?? 0) : checked;
173
+ }
174
+
175
+ function openMenu() {
176
+ setSubmenuKey(null);
177
+ setActiveIndex(initialActiveIndex(sections.flatMap((section) => section.items)));
178
+ setOpen(true);
179
+ onOpenChange?.(true);
180
+ }
181
+
182
+ function closeMenu(returnFocus: boolean) {
183
+ setOpen(false);
184
+ setSubmenuKey(null);
185
+ onOpenChange?.(false);
186
+ if (returnFocus) {
187
+ triggerRef.current?.focus();
188
+ }
189
+ }
190
+
191
+ function enterSubmenu(item: MenuSubmenuSpec) {
192
+ setSubmenuKey(item.key);
193
+ // Past the Back row, onto the first row of the submenu itself.
194
+ setActiveIndex(1 + initialActiveIndex(item.submenu.flatMap((section) => section.items)));
195
+ }
196
+
197
+ function leaveSubmenu() {
198
+ // Back on the row the submenu was opened from.
199
+ const parentIndex = sections.flatMap((section) => section.items).findIndex((item) => item.key === submenuKey);
200
+ setSubmenuKey(null);
201
+ setActiveIndex(parentIndex);
202
+ }
203
+
204
+ /** What a row does when it is chosen: open its submenu, or run it and close unless it asked to stay. */
205
+ function selectItem(item: MenuItemSpec) {
206
+ if (item.submenu) {
207
+ enterSubmenu(item);
208
+ return;
209
+ }
210
+ item.onSelect();
211
+ if (!item.keepOpen) {
212
+ closeMenu(true);
213
+ }
214
+ }
215
+
216
+ // Roving focus: only the active row is tabbable, and it takes DOM focus whenever it changes, so the
217
+ // arrow keys move the screen reader's cursor too rather than only a visual highlight.
218
+ useEffect(() => {
219
+ if (open && menuNode) {
220
+ // A disabled row can't take focus, so a menu with nothing enabled focuses its own container -
221
+ // otherwise the keys it handles would go to whatever had focus before it opened.
222
+ if (enabledIndexes.length === 0) {
223
+ menuNode.focus();
224
+ } else {
225
+ itemRefs.current[activeIndex]?.focus();
226
+ }
227
+ }
228
+ // `submenuKey` too: drilling in or out can land on the same index in the other level's list, and
229
+ // the row that index *means* is a different button, which the effect must move focus to.
230
+ }, [open, activeIndex, submenuKey, menuNode]);
231
+
232
+ function moveActive(delta: number) {
233
+ if (enabledIndexes.length === 0) {
234
+ return;
235
+ }
236
+ const position = enabledIndexes.indexOf(activeIndex);
237
+ setActiveIndex(enabledIndexes[(position + delta + enabledIndexes.length) % enabledIndexes.length]);
238
+ }
239
+
240
+ function handleMenuKeyDown(e: React.KeyboardEvent) {
241
+ if (e.key === "ArrowDown") {
242
+ e.preventDefault();
243
+ moveActive(1);
244
+ } else if (e.key === "ArrowUp") {
245
+ e.preventDefault();
246
+ moveActive(-1);
247
+ } else if (e.key === "Home") {
248
+ e.preventDefault();
249
+ setActiveIndex(enabledIndexes[0] ?? 0);
250
+ } else if (e.key === "End") {
251
+ e.preventDefault();
252
+ setActiveIndex(enabledIndexes[enabledIndexes.length - 1] ?? 0);
253
+ } else if (e.key === "ArrowRight" && items[activeIndex]?.submenu) {
254
+ e.preventDefault();
255
+ enterSubmenu(items[activeIndex]);
256
+ } else if ((e.key === "ArrowLeft" || e.key === "Escape") && openSubmenu) {
257
+ // ARIA's own submenu behaviour: Escape leaves the submenu for its parent menu rather than
258
+ // dismissing the whole thing.
259
+ e.preventDefault();
260
+ leaveSubmenu();
261
+ } else if (e.key === "Escape" || e.key === "Tab") {
262
+ e.preventDefault();
263
+ closeMenu(true);
264
+ }
265
+ }
266
+
267
+ function handleTriggerKeyDown(e: React.KeyboardEvent) {
268
+ if (!open && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
269
+ e.preventDefault();
270
+ openMenu();
271
+ }
272
+ }
273
+
274
+ let itemIndex = -1;
275
+
276
+ return (
277
+ <>
278
+ <button
279
+ ref={triggerRef}
280
+ type="button"
281
+ aria-haspopup="menu"
282
+ aria-expanded={open}
283
+ aria-label={ariaLabel}
284
+ title={title}
285
+ disabled={disabled}
286
+ onClick={() => (open ? closeMenu(false) : openMenu())}
287
+ onKeyDown={handleTriggerKeyDown}
288
+ className={[
289
+ // `min-w-0` so a long label ("Filter: Has attachments") truncates instead of pushing
290
+ // whatever sits beside it in the toolbar off the edge of a 384px list column.
291
+ "inline-flex min-w-0 items-center gap-1 px-2 py-1 rounded-md text-sm text-text hover:bg-surface-alt disabled:opacity-50 disabled:hover:bg-transparent",
292
+ className,
293
+ ].join(" ")}
294
+ >
295
+ {icon}
296
+ <span className="truncate">{label}</span>
297
+ <HiChevronDown size={14} aria-hidden="true" className="shrink-0 text-text-muted" />
298
+ </button>
299
+ {open && (
300
+ <PopoverPortal
301
+ anchorRef={triggerRef}
302
+ onClose={() => closeMenu(false)}
303
+ width={width}
304
+ height={menuHeight(shownSections, width)}
305
+ aria-label={ariaLabel}
306
+ >
307
+ <div
308
+ ref={setMenuNode}
309
+ role="menu"
310
+ tabIndex={-1}
311
+ aria-label={ariaLabel}
312
+ onKeyDown={handleMenuKeyDown}
313
+ className="flex-1 overflow-y-auto py-1"
314
+ >
315
+ {shownSections.map((section, sectionIndex) => (
316
+ <div key={section.key} role="group" aria-label={section.label} className={sectionIndex > 0 ? "border-t border-border mt-1 pt-1" : ""}>
317
+ {section.label && (
318
+ <div aria-hidden="true" className="h-6 flex items-center px-3 text-xs font-semibold uppercase tracking-wide text-text-muted">
319
+ {section.label}
320
+ </div>
321
+ )}
322
+ {section.items.map((item) => {
323
+ itemIndex += 1;
324
+ const index = itemIndex;
325
+ const role = item.role ?? "menuitem";
326
+ return (
327
+ <button
328
+ key={item.key}
329
+ ref={(node) => {
330
+ itemRefs.current[index] = node;
331
+ }}
332
+ type="button"
333
+ role={role}
334
+ disabled={item.disabled}
335
+ tabIndex={index === activeIndex ? 0 : -1}
336
+ {...(role === "menuitem"
337
+ ? {}
338
+ : { "aria-checked": item.checked === "mixed" ? ("mixed" as const) : !!item.checked })}
339
+ {...(item.submenu ? { "aria-haspopup": "menu" as const, "aria-expanded": false } : {})}
340
+ onClick={() => selectItem(item)}
341
+ className="w-full flex items-start gap-2 px-3 py-2 text-left text-sm text-text hover:bg-surface-alt disabled:opacity-50 disabled:hover:bg-transparent"
342
+ >
343
+ <span className="w-4 shrink-0 flex justify-center pt-0.5">
344
+ {item.key === "__back" && (
345
+ <HiChevronLeft size={14} aria-hidden="true" className="text-text-muted" />
346
+ )}
347
+ {item.checked === "mixed" ? (
348
+ <HiMinus size={14} aria-hidden="true" className="text-primary-dark" />
349
+ ) : (
350
+ item.checked && <HiCheck size={14} aria-hidden="true" className="text-primary-dark" />
351
+ )}
352
+ </span>
353
+ <span className="min-w-0 flex-1">
354
+ <span className="flex h-5 items-center gap-1.5">
355
+ {item.swatchColor && (
356
+ <span
357
+ aria-hidden="true"
358
+ className="w-2.5 h-2.5 rounded-full shrink-0"
359
+ style={{ backgroundColor: item.swatchColor }}
360
+ />
361
+ )}
362
+ <span className="truncate">{item.label}</span>
363
+ </span>
364
+ {item.description && (
365
+ <span className="block h-4 text-xs leading-4 text-text-muted truncate font-normal">
366
+ {item.description}
367
+ </span>
368
+ )}
369
+ </span>
370
+ {item.submenu && (
371
+ <HiChevronRight size={14} aria-hidden="true" className="shrink-0 mt-0.5 text-text-muted" />
372
+ )}
373
+ </button>
374
+ );
375
+ })}
376
+ {section.note && <p className="px-3 py-1 text-xs leading-4 text-text-muted">{section.note}</p>}
377
+ </div>
378
+ ))}
379
+ </div>
380
+ </PopoverPortal>
381
+ )}
382
+ </>
383
+ );
384
+ }