Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .storybook/main.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const { dirname, resolve } = require('node:path');

const getAbsolutePath = (packageName) =>
dirname(require.resolve(`${packageName}/package.json`));
const getAbsolutePath = (packageName) => dirname(require.resolve(`${packageName}/package.json`));

/** @type {import('@storybook/react-vite').StorybookConfig} */
const config = {
Expand Down
4 changes: 2 additions & 2 deletions lib/atom/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { Avatar as RadixAvatar } from '@radix-ui/themes';
import type { IAvatarProps } from './types';
import styles from './Avatar.module.css';

const Avatar = ({ name, pfp }: IAvatarProps) => {
const Avatar = ({ name, pfp, size = '3' }: IAvatarProps) => {
const fallback = name ? name.charAt(0).toUpperCase() : undefined;

return (
<RadixAvatar
radius="full"
color="blue"
size="3"
size={size}
fallback={<>{fallback}</>}
src={pfp}
alt={pfp ? `${name}'s Avatar` : undefined}
Expand Down
3 changes: 3 additions & 0 deletions lib/atom/Avatar/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import type { AvatarProps } from '@radix-ui/themes';

export interface IAvatarProps {
name: string;
pfp?: string;
size?: AvatarProps['size'];
}
4 changes: 4 additions & 0 deletions lib/atom/ContentWrapper/ContentWrapper.styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
border-radius: var(--radius-5);
border: 1px solid var(--gray-6);
}

.content {
height: 100%;
}
Comment thread
kyleknighted marked this conversation as resolved.
14 changes: 11 additions & 3 deletions lib/atom/ContentWrapper/ContentWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import { Box } from '@radix-ui/themes';
import cn from 'classnames';
import styles from './ContentWrapper.styles.module.css';
import type { IContentWrapperProps } from './ContentWrapper.types';
import Header from '../Header';

const ContentWrapper = ({ children, title, subtitle, metaInfo, ...rest }: IContentWrapperProps) => {
const ContentWrapper = ({
children,
title,
subtitle,
metaInfo,
className,
...rest
}: IContentWrapperProps) => {
return (
<Box className={styles.wrapper} height="100%" {...rest}>
<Box className={cn(styles.wrapper, className)} height="100%" {...rest}>
{title && <Header title={title} subtitle={subtitle} metaInfo={metaInfo} />}
<Box py="4" px="5">
<Box py="4" px="5" height="100%">
{children}
</Box>
</Box>
Expand Down
4 changes: 2 additions & 2 deletions lib/atom/MenuItem/MenuItem.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
padding-left: var(--space-4);

&::before {
content: ' ';
content: '';
color: #dcdfe4;
margin-left: var(--space-2);
background-color: var(--blue-6);
Expand Down Expand Up @@ -68,7 +68,7 @@
position: relative;

&::before {
content: ' ';
content: '';
display: block;
background-color: #667085;
width: 3px;
Expand Down
47 changes: 47 additions & 0 deletions lib/compound/InboxView/InboxView.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.inboxViewWrapper,
.transactionTimelineWrapper {
> div {
padding: 0;
}
}

.recentAlerts {
box-shadow: inset -1px 0 0 0 var(--gray-a5);
}

.alertDetails {
Comment thread
kyleknighted marked this conversation as resolved.
background-color: var(--color-background);
z-index: 1;
}

.callListItem {
border-radius: var(--radius-5);
background-color: var(--color-background);
box-shadow: inset 0 0 0 1px var(--gray-a4);
height: fit-content;
width: 100%;
align-items: start;
}

.callListItemHeading {
color: var(--gray-12);
width: 100%;
}

.callListItemSelected {
box-shadow: inset 0 0 0 1px var(--blue-9);
}

.newMessageBadge {
border-radius: var(--radius-5);
background-color: var(--blue-5);
width: 6px;
height: 6px;
}

.tabContentRoot {
height: 100%;
flex: 1;
position: relative;
padding-inline: var(--space-4);
}
73 changes: 73 additions & 0 deletions lib/compound/InboxView/InboxView.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import type { Meta, StoryObj } from '@storybook/react-vite';
import { InboxView, type IInboxViewProps } from '../..';
import TranscriptItem from './parts/TranscriptItem';
import { Box, Text } from '@radix-ui/themes';

const meta = {
title: 'Compound/InboxView',
component: InboxView,
parameters: {
layout: 'full',
},
tags: ['autodocs'],
render: (args) => (
<Box height="100vh">
<InboxView {...args} />
</Box>
),
args: {
tabs: [
{
label: 'Transcript',
value: 'transcript',
content: (
<>
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
</>
),
},
{
label: 'Details',
value: 'details',
content: (
<Box>
<Text size="2" color="gray">
Meeting Details:
</Text>
<Text size="3">- Date: January 1, 2024</Text>
<Text size="3">- Time: 12:00 PM</Text>
<Text size="3">- Participants: Alice, Bob</Text>
</Box>
),
},
],
Comment on lines +19 to +65
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The story is using a tabs prop that doesn't exist in IInboxViewProps. According to InboxView.types.ts, the component expects content and callList props, but this story is providing tabs instead. Additionally, the required callList prop is completely missing from the story args. This will cause the story to fail or not render properly.

Suggested change
tabs: [
{
label: 'Transcript',
value: 'transcript',
content: (
<>
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
</>
),
},
{
label: 'Details',
value: 'details',
content: (
<Box>
<Text size="2" color="gray">
Meeting Details:
</Text>
<Text size="3">- Date: January 1, 2024</Text>
<Text size="3">- Time: 12:00 PM</Text>
<Text size="3">- Participants: Alice, Bob</Text>
</Box>
),
},
],
content: (
<>
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
<TranscriptItem />
</>
),
callList: (
<Box>
<Text size="2" color="gray">
Meeting Details:
</Text>
<Text size="3">- Date: January 1, 2024</Text>
<Text size="3">- Time: 12:00 PM</Text>
<Text size="3">- Participants: Alice, Bob</Text>
</Box>
),

Copilot uses AI. Check for mistakes.
},
} satisfies Meta<IInboxViewProps>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {};
85 changes: 85 additions & 0 deletions lib/compound/InboxView/InboxView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import type { IInboxViewProps } from './InboxView.types';
import styles from './InboxView.module.css';
import ContentWrapper from '../../atom/ContentWrapper/ContentWrapper';
import { Box, Button, Flex, Heading, IconButton, Text } from '@radix-ui/themes';
import { useState } from 'react';
import CallList from './parts/CallList';
import { SidebarSimpleIcon } from '@phosphor-icons/react';

const InboxView = ({ content, callList }: IInboxViewProps) => {
const [callListCollapsed, setCallListCollapsed] = useState(false);

return (
<ContentWrapper className={styles.inboxViewWrapper} overflow={'hidden'} height="100%">
<Flex width="100%" height="100%">
{!callListCollapsed && <CallList calls={callList} />}

<Flex
pb="4"
minWidth={'250px'}
gap="2"
direction={'column'}
position={'relative'}
flexGrow={'1'}
overflowY="scroll"
overflowX="hidden"
>
<Flex
justify="between"
position="sticky"
top={'0'}
pt="4"
px="4"
pb="2"
style={{
position: 'sticky',
top: 0,
backgroundColor: 'var(--gray-1)',
zIndex: 1,
paddingTop: 'var(--space-4)',
paddingBottom: 'var(--space-2)',
boxShadow: 'inset 0 -1px 0 0 var(--gray-a4)',
paddingInline: 'var(--space-4)',
marginRight: '1px',
}}
>
<Flex gap="2">
<IconButton
variant="ghost"
size="2"
color="gray"
mt="1"
onClick={() => {
setCallListCollapsed((prev) => !prev);
}}
>
<SidebarSimpleIcon weight="bold" size={20} aria-label="Toggle Call List" />
</IconButton>
<Box>
<Text size="2" color="gray">
January 1, 2024 at 12:00 AM
</Text>
<Heading size="6" mt="1">
New Year Sync
</Heading>
</Box>
</Flex>
<Box>
<Button variant="outline" size="2" color="blue" mr="2">
Join Meeting
</Button>
<Button variant="outline" size="2" color="red">
Remove Agent
</Button>
</Box>
</Flex>

<Box px="4">{content}</Box>
</Flex>
</Flex>
</ContentWrapper>
);
};

export default InboxView;
export type { IInboxViewProps };
14 changes: 14 additions & 0 deletions lib/compound/InboxView/InboxView.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export type CallListItem = {
id: string;
label: React.ReactNode | string;
startTime: string;
severity: string;
onClick: () => void;
active: boolean;
read: boolean;
};

export interface IInboxViewProps {
content: React.ReactNode;
callList: Array<CallListItem>;
}
2 changes: 2 additions & 0 deletions lib/compound/InboxView/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default } from './InboxView';
export type { IInboxViewProps } from './InboxView.types';
Loading