// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import React, { useState } from 'react';
import Flex from '../Flex';
import Roster from './';
import RosterGroup from './RosterGroup';
import RosterCell from './RosterCell';
import RosterHeader from './RosterHeader';
import IconButton from '../Button/IconButton';
import SignalStrength from '../icons/SignalStrength';
import Cog from '../icons/Cog';
export default {
title: 'UI Components/Roster',
component: Roster,
parameters: {
layout: 'fullscreen',
},
};
const Menu = () => (
<>
Message user
Kick user
>
);
const HeaderMenu = () => (
<>
Some menu action
Some other menu action
>
);
const commonHiddenArgTypes = {
tabIndex: { table: { disable: true } },
onFocus: { table: { disable: true } },
onBlur: { table: { disable: true } },
};
export const _Roster = () => {
const [search, setSearch] = useState('');
const handleSearch = (e) => setSearch(e.target.value);
return (
alert('Closing')}
searchValue={search}
onSearch={handleSearch}
menu={}
a11yMenuLabel="Roster options"
/>
}
a11yMenuLabel="Contact options"
/>
}
a11yMenuLabel="Contact options"
/>
);
};
_Roster.story = 'Roster';
export const _RosterGroup = (args) => {
return (
);
};
_RosterGroup.argTypes = {
title: { control: 'text', table: { disable: false } },
badge: { control: 'number' },
...commonHiddenArgTypes,
};
_RosterGroup.args = {
title: 'Left',
badge: 2,
};
_RosterGroup.story = 'RosterGroup';
export const _RosterHeader = (args) => {
const [search, setSearch] = useState('');
const handleSearch = (e) => setSearch(e.target.value);
return (
alert('Closing')}
searchValue={search}
onSearch={handleSearch}
menu={}
/>
);
};
_RosterHeader.argTypes = {
title: { control: 'text', table: { disable: false } },
badge: { control: 'number' },
...commonHiddenArgTypes,
};
_RosterHeader.args = {
title: 'Present',
badge: 4,
};
_RosterHeader.story = 'RosterHeader';
export const _RosterHeaderWithNavigationIcon = (args) => {
const [search, setSearch] = useState('');
const handleSearch = (e) => setSearch(e.target.value);
return (
alert('Closing')}
searchValue={search}
onSearch={handleSearch}
menu={}
/>
);
};
_RosterHeaderWithNavigationIcon.argTypes = {
title: { control: 'text', table: { disable: false } },
badge: { control: 'number' },
...commonHiddenArgTypes
};
_RosterHeaderWithNavigationIcon.args = {
title: 'Present',
badge: 4,
};
_RosterHeaderWithNavigationIcon.story = 'RosterHeaderWithNavigationIcon';
export const _RosterHeaderWithCustomElements = (args) => {
const [search, setSearch] = useState('');
const handleSearch = (e) => setSearch(e.target.value);
return (
alert('Closing')}
searchValue={search}
onSearch={handleSearch}
menu={}
>
} />
} />
);
};
_RosterHeaderWithCustomElements.argTypes = {
title: { control: 'text', table: { disable: false } },
badge: { control: 'number' },
...commonHiddenArgTypes
};
_RosterHeaderWithCustomElements.args = {
title: 'Present',
badge: 4,
};
_RosterHeaderWithCustomElements.story = '_RosterHeaderWithCustomElements';
export const _RosterCell = (args) => {
return (
}
/>
);
};
_RosterCell.argTypes = {
name: { control: 'text' },
subtitle: { control: 'text' },
runningLate: { control: 'text' },
muted: { control: 'boolean' },
videoEnabled: { control: 'boolean' },
sharingContent: { control: 'boolean' },
poorConnection: { control: 'boolean' },
micPosition: { control: 'select', options: ['grouped', 'leading'] },
...commonHiddenArgTypes
};
_RosterCell.args = {
name: 'Stanley Hudson',
subtitle: 'Bagel savant',
runningLate: '',
muted: false,
videoEnabled: false,
sharingContent: false,
poorConnection: false,
micPosition: 'grouped',
};
_RosterCell.story = 'RosterCell';