@remit/ui 0.0.1 → 0.0.3
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/package.json +5 -5
- package/src/components/mail-action-toolbar.render.test.ts +2 -2
- package/src/components/mail-action-toolbar.tsx +2 -2
- package/src/components/mobile-message-action-bar.render.test.ts +2 -2
- package/src/components/mobile-message-action-bar.tsx +2 -2
- package/src/components/mobile-reading-pane.render.test.ts +1 -1
- package/src/components/nav-sidebar.render.test.ts +12 -0
- package/src/components/nav-sidebar.tsx +2 -2
- package/src/filter-presets.test.ts +8 -1
- package/src/filter-presets.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remit/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"src"
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
"lucide-react": "^0.468",
|
|
24
24
|
"react-resizable-panels": "^2.1.9",
|
|
25
25
|
"react-simple-pull-to-refresh": "^1.3.4",
|
|
26
|
-
"tailwind-merge": "^2"
|
|
26
|
+
"tailwind-merge": "^2",
|
|
27
|
+
"@types/dompurify": "*"
|
|
27
28
|
},
|
|
28
29
|
"peerDependencies": {
|
|
29
30
|
"react": "^19",
|
|
30
|
-
"react-dom": "^19"
|
|
31
|
+
"react-dom": "^19",
|
|
32
|
+
"@types/react": "^19"
|
|
31
33
|
},
|
|
32
34
|
"devDependencies": {
|
|
33
35
|
"@storybook/react": "^9",
|
|
34
|
-
"@types/dompurify": "*",
|
|
35
|
-
"@types/react": "^19",
|
|
36
36
|
"@types/react-dom": "^19",
|
|
37
37
|
"react": "^19",
|
|
38
38
|
"react-dom": "^19",
|
|
@@ -11,7 +11,7 @@ describe("MailActionToolbar", () => {
|
|
|
11
11
|
);
|
|
12
12
|
assert.match(html, /aria-label="Reply"/);
|
|
13
13
|
assert.match(html, /aria-label="Move to Trash"/);
|
|
14
|
-
assert.match(html, /aria-label="
|
|
14
|
+
assert.match(html, /aria-label="Star"/);
|
|
15
15
|
assert.match(html, /aria-label="Move to mailbox"/);
|
|
16
16
|
// No archive verb — Remit is IMAP-backed (move-to-folder is the equivalent).
|
|
17
17
|
assert.doesNotMatch(html, /aria-label="Archive"/);
|
|
@@ -27,7 +27,7 @@ describe("MailActionToolbar", () => {
|
|
|
27
27
|
assert.match(html, /aria-label="Forward"/);
|
|
28
28
|
assert.doesNotMatch(html, /aria-label="Archive"/);
|
|
29
29
|
assert.doesNotMatch(html, /aria-label="Move to Trash"/);
|
|
30
|
-
assert.doesNotMatch(html, /aria-label="
|
|
30
|
+
assert.doesNotMatch(html, /aria-label="Star"/);
|
|
31
31
|
assert.doesNotMatch(html, /aria-label="Move to mailbox"/);
|
|
32
32
|
});
|
|
33
33
|
|
|
@@ -81,7 +81,7 @@ export function MailActionToolbar({
|
|
|
81
81
|
replyAllTitle = "Reply all (a)",
|
|
82
82
|
forwardTitle = "Forward (f)",
|
|
83
83
|
deleteTitle = "Move to Trash (#)",
|
|
84
|
-
flagTitle = "
|
|
84
|
+
flagTitle = "Star (s)",
|
|
85
85
|
children,
|
|
86
86
|
className,
|
|
87
87
|
}: MailActionToolbarProps) {
|
|
@@ -158,7 +158,7 @@ export function MailActionToolbar({
|
|
|
158
158
|
/>
|
|
159
159
|
}
|
|
160
160
|
title={flagTitle}
|
|
161
|
-
aria-label="
|
|
161
|
+
aria-label="Star"
|
|
162
162
|
onClick={act("flag", onToggleStar)}
|
|
163
163
|
/>
|
|
164
164
|
</>
|
|
@@ -20,7 +20,7 @@ describe("MobileMessageActionBar", () => {
|
|
|
20
20
|
}),
|
|
21
21
|
}),
|
|
22
22
|
);
|
|
23
|
-
assert.equal(countMatches(html, 'aria-label="
|
|
23
|
+
assert.equal(countMatches(html, 'aria-label="Star"'), 1);
|
|
24
24
|
assert.equal(countMatches(html, 'aria-label="Move to folder"'), 1);
|
|
25
25
|
assert.equal(countMatches(html, 'aria-label="Move to Trash"'), 1);
|
|
26
26
|
assert.doesNotMatch(html, /aria-label="Archive"/);
|
|
@@ -30,7 +30,7 @@ describe("MobileMessageActionBar", () => {
|
|
|
30
30
|
const html = renderToString(
|
|
31
31
|
createElement(MobileMessageActionBar, { ...base, isStarred: true }),
|
|
32
32
|
);
|
|
33
|
-
assert.match(html, /aria-label="
|
|
33
|
+
assert.match(html, /aria-label="Unstar"/);
|
|
34
34
|
assert.match(html, /aria-pressed="true"/);
|
|
35
35
|
});
|
|
36
36
|
|
|
@@ -141,9 +141,9 @@ export function MobileMessageActionBar({
|
|
|
141
141
|
/>
|
|
142
142
|
}
|
|
143
143
|
onClick={act("star", onToggleStar)}
|
|
144
|
-
aria-label={isStarred ? "
|
|
144
|
+
aria-label={isStarred ? "Unstar" : "Star"}
|
|
145
145
|
aria-pressed={isStarred}
|
|
146
|
-
title={isStarred ? "
|
|
146
|
+
title={isStarred ? "Unstar" : "Star"}
|
|
147
147
|
className={TOUCH}
|
|
148
148
|
/>
|
|
149
149
|
{moveSlot}
|
|
@@ -87,7 +87,7 @@ describe("MobileReadingPane", () => {
|
|
|
87
87
|
// One expanded message ⇒ one Reply / Flag / Trash cluster; the two
|
|
88
88
|
// collapsed rows carry no bar.
|
|
89
89
|
assert.equal(countMatches(html, 'aria-label="Reply"'), 1);
|
|
90
|
-
assert.equal(countMatches(html, 'aria-label="
|
|
90
|
+
assert.equal(countMatches(html, 'aria-label="Star"'), 1);
|
|
91
91
|
assert.equal(countMatches(html, 'aria-label="Move to Trash"'), 1);
|
|
92
92
|
});
|
|
93
93
|
|
|
@@ -69,6 +69,18 @@ describe("NavSidebar", () => {
|
|
|
69
69
|
assert.match(html, /Daily brief/);
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
+
it("labels the \\Flagged virtual mailbox 'Starred'", () => {
|
|
73
|
+
const html = renderToString(
|
|
74
|
+
createElement(NavSidebar, {
|
|
75
|
+
accounts,
|
|
76
|
+
selectedNavId: "flagged",
|
|
77
|
+
onSelectNav: () => undefined,
|
|
78
|
+
}),
|
|
79
|
+
);
|
|
80
|
+
assert.match(html, /Starred/);
|
|
81
|
+
assert.doesNotMatch(html, /Flagged/);
|
|
82
|
+
});
|
|
83
|
+
|
|
72
84
|
it("renders system and custom mailbox names", () => {
|
|
73
85
|
const html = renderToString(
|
|
74
86
|
createElement(NavSidebar, {
|
|
@@ -580,8 +580,8 @@ export function NavSidebar({
|
|
|
580
580
|
navId="flagged"
|
|
581
581
|
linkComponent={linkComponent}
|
|
582
582
|
icon={<Star className="size-4" />}
|
|
583
|
-
label="
|
|
584
|
-
ariaLabel="
|
|
583
|
+
label="Starred"
|
|
584
|
+
ariaLabel="Starred"
|
|
585
585
|
active={selectedNavId === "flagged"}
|
|
586
586
|
onClick={() => onSelectNav?.("flagged")}
|
|
587
587
|
/>
|
|
@@ -60,13 +60,20 @@ describe("inboxFilterConfig", () => {
|
|
|
60
60
|
);
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
it("adds Has attachment to Unread and
|
|
63
|
+
it("adds Has attachment to Unread and Starred", () => {
|
|
64
64
|
assert.deepEqual(
|
|
65
65
|
inboxFilterConfig().filters.map((f) => f.id),
|
|
66
66
|
["unread", "flagged", "attachment"],
|
|
67
67
|
);
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
+
it("labels the IMAP \\Flagged filter 'Starred'", () => {
|
|
71
|
+
assert.deepEqual(
|
|
72
|
+
inboxFilterConfig().filters.map((f) => f.label),
|
|
73
|
+
["Unread", "Starred", "Has attachment"],
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
|
|
70
77
|
it("never offers an accounts source group", () => {
|
|
71
78
|
assert.equal(inboxFilterConfig().sources, undefined);
|
|
72
79
|
});
|
package/src/filter-presets.ts
CHANGED
|
@@ -43,7 +43,8 @@ const MESSAGE_CATEGORIES: FilterSheetCategory[] = [
|
|
|
43
43
|
];
|
|
44
44
|
|
|
45
45
|
const UNREAD: FilterSheetFilter = { id: "unread", label: "Unread" };
|
|
46
|
-
|
|
46
|
+
// `flagged` is the wire name (IMAP \Flagged); the user-facing label is "Starred".
|
|
47
|
+
const FLAGGED: FilterSheetFilter = { id: "flagged", label: "Starred" };
|
|
47
48
|
const HAS_ATTACHMENT: FilterSheetFilter = {
|
|
48
49
|
id: "attachment",
|
|
49
50
|
label: "Has attachment",
|