-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathRoomListItemAccessibilityWrapper.stories.tsx
More file actions
67 lines (61 loc) · 1.71 KB
/
RoomListItemAccessibilityWrapper.stories.tsx
File metadata and controls
67 lines (61 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* Copyright 2026 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
import React from "react";
import { fn } from "storybook/test";
import type { Meta, StoryObj } from "@storybook/react-vite";
import { RoomListItemAccessibilityWrapper } from "./RoomListItemAccessibilityWrapper";
import { createMockRoomItemViewModel, renderAvatar } from "../../story-mocks";
const meta = {
title: "Room List/RoomListItemAccessibilityWrapper",
component: RoomListItemAccessibilityWrapper,
tags: ["autodocs"],
args: {
roomIndex: 0,
roomIndexInSection: 0,
roomCount: 10,
onFocus: fn(),
isFirstItem: false,
isLastItem: false,
renderAvatar,
isSelected: false,
isFocused: false,
vm: createMockRoomItemViewModel("!room:server", "Room name", 0),
},
decorators: [
(Story) => (
<div style={{ width: "320px", padding: "8px" }}>
<Story />
</div>
),
],
} satisfies Meta<typeof RoomListItemAccessibilityWrapper>;
export default meta;
type Story = StoryObj<typeof meta>;
export const FlatList: Story = {
args: {
isInFlatList: true,
},
decorators: [
(Story) => (
<div role="listbox" aria-label="Room list">
<Story />
</div>
),
],
};
export const Sections: Story = {
args: {
isInFlatList: false,
},
decorators: [
(Story) => (
<div role="treegrid" aria-label="Room list" aria-rowcount={10}>
<Story />
</div>
),
],
};