@remit/ui 0.0.111 → 0.0.112
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
CHANGED
|
@@ -203,6 +203,27 @@ export const ExpandedRowComposed: StoryObj<typeof ExpandedMessage> = {
|
|
|
203
203
|
),
|
|
204
204
|
};
|
|
205
205
|
|
|
206
|
+
/** The chevron beside the sender is the disclosure control, not a picture of
|
|
207
|
+
* one: press it to put the message away and press the row to bring it back.
|
|
208
|
+
* Reclaiming the space a long message takes is what a reader aims at it for. */
|
|
209
|
+
export const RowDisclosure: StoryObj<typeof ExpandedMessage> = {
|
|
210
|
+
render: function RowDisclosureRender() {
|
|
211
|
+
const [expanded, setExpanded] = useState(true);
|
|
212
|
+
return (
|
|
213
|
+
<div className="max-w-3xl border border-line">
|
|
214
|
+
{expanded ? (
|
|
215
|
+
<ExpandedMessage
|
|
216
|
+
message={row}
|
|
217
|
+
onHeaderClick={() => setExpanded(false)}
|
|
218
|
+
/>
|
|
219
|
+
) : (
|
|
220
|
+
<CollapsedMessage message={row} onClick={() => setExpanded(true)} />
|
|
221
|
+
)}
|
|
222
|
+
</div>
|
|
223
|
+
);
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
|
|
206
227
|
/** The app owns the fetch and hands the row its state back; so does this. */
|
|
207
228
|
const ThreadAttachments = () => {
|
|
208
229
|
const [rows, setRows] = useState<AttachmentItem[]>([
|
|
@@ -184,7 +184,23 @@ export function ExpandedMessage({
|
|
|
184
184
|
)}
|
|
185
185
|
>
|
|
186
186
|
<div className="flex items-start gap-3">
|
|
187
|
-
|
|
187
|
+
{/* The chevron is the disclosure control, not a picture of one: it is
|
|
188
|
+
what a reader aims at to put a message away, so it carries the
|
|
189
|
+
collapse itself rather than sitting beside the sender block that
|
|
190
|
+
does. */}
|
|
191
|
+
{onHeaderClick ? (
|
|
192
|
+
<button
|
|
193
|
+
type="button"
|
|
194
|
+
onClick={onHeaderClick}
|
|
195
|
+
aria-expanded={true}
|
|
196
|
+
aria-label="Collapse message"
|
|
197
|
+
className="mt-1 shrink-0 text-fg-subtle transition-colors hover:text-fg"
|
|
198
|
+
>
|
|
199
|
+
<ChevronDown className="size-3.5" />
|
|
200
|
+
</button>
|
|
201
|
+
) : (
|
|
202
|
+
<ChevronDown className="mt-1 size-3.5 shrink-0 text-fg-subtle" />
|
|
203
|
+
)}
|
|
188
204
|
<Avatar name={message.fromName} email={message.fromEmail} size="md" />
|
|
189
205
|
<div className="min-w-0 flex-1">
|
|
190
206
|
{onHeaderClick ? (
|