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
7 changes: 7 additions & 0 deletions .changeset/rms-chat-layout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@lg-chat/chat-layout': minor
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I left this as a minor per Gemini's rec. Also thinking minor is ideal for now since it's still in beta release

---

[LG-5575](https://jira.mongodb.org/browse/LG-5575)

- Added compatibility with `@lg-chat/[email protected]`. We recommend new projects use `@lg-chat/leafygreen-chat-provider` v6; support for v5 will be removed in a future major version.
8 changes: 8 additions & 0 deletions .changeset/rms-chat-provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@lg-chat/leafygreen-chat-provider': major
---

- Removed `variant` prop and `Variant` enum export. The provider no longer supports variant selection (spacious/compact). All components now use a single, consistent design.
- Removed `containerWidth` from context value. This was only used in spacious variants.
- Removed wrapper `div` element from `LeafyGreenChatProvider`.
- Removed `use-resize-observer` dependency.
9 changes: 9 additions & 0 deletions .changeset/rms-chat-window.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@lg-chat/chat-window': major
---

[LG-5575](https://jira.mongodb.org/browse/LG-5575)

- Added compatibility with `@lg-chat/[email protected]`. We recommend new projects use `@lg-chat/leafygreen-chat-provider` v6; support for v5 will be removed in a future major version.
- All chat components have been simplified by removing variant-specific conditional logic.
- Removed `onClose` and `iconSlot` props from `ChatWindowProps`. These props were only used in the spacious variant.
12 changes: 12 additions & 0 deletions .changeset/rms-input-bar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@lg-chat/input-bar': major
---

[LG-5575](https://jira.mongodb.org/browse/LG-5575)

- Added compatibility with `@lg-chat/[email protected]`. We recommend new projects use `@lg-chat/leafygreen-chat-provider` v6; support for v5 will be removed in a future major version.
- Removed deprecated `lgInputBarStyles` export.
- All chat components have been simplified by removing variant-specific conditional logic.
- Removed props: `badgeText`, `shouldRenderGradient`, and `shouldRenderHotKeyIndicator`
- Added min-width of 150px to `textarea` element to ensure proper height calculation.
- Updated `react-textarea-autosize` from `^8.3.2` to `^8.5.9`.
5 changes: 5 additions & 0 deletions .changeset/rms-lg-markdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lg-chat/lg-markdown': major
---

- Removed deprecated `lgMarkdownStyles` export.
9 changes: 9 additions & 0 deletions .changeset/rms-message-feed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@lg-chat/message-feed': major
---

[LG-5575](https://jira.mongodb.org/browse/LG-5575)

- Added compatibility with `@lg-chat/[email protected]`. We recommend new projects use `@lg-chat/leafygreen-chat-provider` v6; support for v5 will be removed in a future major version.
- Removed deprecated `lgMessageFeedStyles` export.
- All chat components have been simplified by removing variant-specific conditional logic.
8 changes: 8 additions & 0 deletions .changeset/rms-message-feedback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@lg-chat/message-feedback': major
---

[LG-5575](https://jira.mongodb.org/browse/LG-5575)

- Added compatibility with `@lg-chat/[email protected]`. We recommend new projects use `@lg-chat/leafygreen-chat-provider` v6; support for v5 will be removed in a future major version.
- Removed `PopoverMessageFeedback` component and `PopoverMessageFeedbackProps` type exports.
11 changes: 11 additions & 0 deletions .changeset/rms-message-rating.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@lg-chat/message-rating': major
---

[LG-5575](https://jira.mongodb.org/browse/LG-5575)

- Added compatibility with `@lg-chat/[email protected]`. We recommend new projects use `@lg-chat/leafygreen-chat-provider` v6; support for v5 will be removed in a future major version.
- Removed deprecated `lgMessageRatingStyles` export.
- All chat components have been simplified by removing variant-specific conditional logic.
- Removed `description` prop.
- Removed `RadioButton` component and related exports (`lgRadioButtonStyles`, `RadioButtonProps` type).
14 changes: 14 additions & 0 deletions .changeset/rms-message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@lg-chat/message': major
---

[LG-5575](https://jira.mongodb.org/browse/LG-5575)

- Added compatibility with `@lg-chat/[email protected]`. We recommend new projects use `@lg-chat/leafygreen-chat-provider` v6; support for v5 will be removed in a future major version.
- Removed the following exports:
- `lgMessageStyles`
- `MessageContainer` component, `lgMessageContainerStyles`, and `MessageContainerProps` type
- `MessageContent` component and `MessageContentProps` type
- `MessageLinks` component
- All chat components have been simplified by removing variant-specific conditional logic.
- Removed props: `align`, `avatar`, `baseFontSize`, `componentOverrides`, `links`, `linksHeading`, `onLinkClick`, and `verified`
10 changes: 10 additions & 0 deletions .changeset/rms-title-bar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@lg-chat/title-bar': major
---

[LG-5575](https://jira.mongodb.org/browse/LG-5575)

- Added compatibility with `@lg-chat/[email protected]`. We recommend new projects use `@lg-chat/leafygreen-chat-provider` v6; support for v5 will be removed in a future major version.
- All chat components have been simplified by removing variant-specific conditional logic.
- Removed `align`, `iconSlot`, and `onClose` props.
- Removed `Align` enum export.
2 changes: 1 addition & 1 deletion chat/chat-layout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"peerDependencies": {
"@leafygreen-ui/leafygreen-provider": "workspace:^3.2.0 || workspace:^4.0.0 || workspace:^5.0.0",
"@lg-chat/leafygreen-chat-provider": "workspace:^"
"@lg-chat/leafygreen-chat-provider": "workspace:^5.1.0 || workspace:^6.0.0"
},
"devDependencies": {
"@lg-chat/chat-window": "workspace:^",
Expand Down
7 changes: 2 additions & 5 deletions chat/chat-layout/src/ChatLayout.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import React, { useState } from 'react';
import { ChatWindow } from '@lg-chat/chat-window';
import { InputBar } from '@lg-chat/input-bar';
import {
LeafyGreenChatProvider,
Variant,
} from '@lg-chat/leafygreen-chat-provider';
import { LeafyGreenChatProvider } from '@lg-chat/leafygreen-chat-provider';
import { Message } from '@lg-chat/message';
import { MessageFeed } from '@lg-chat/message-feed';
import { TitleBar } from '@lg-chat/title-bar';
Expand Down Expand Up @@ -76,7 +73,7 @@ const Template: StoryFn<ChatLayoutProps> = props => {
};

return (
<LeafyGreenChatProvider variant={Variant.Compact}>
<LeafyGreenChatProvider>
<ChatLayout {...props}>
<ChatSideNav>
<ChatSideNav.Header
Expand Down
21 changes: 2 additions & 19 deletions chat/chat-layout/src/ChatSideNav/ChatSideNav.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,15 @@
import React from 'react';
import {
LeafyGreenChatProvider,
Variant,
} from '@lg-chat/leafygreen-chat-provider';
import { LeafyGreenChatProvider } from '@lg-chat/leafygreen-chat-provider';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

import { ChatSideNav } from '.';

const Providers = ({ children }: { children: React.ReactNode }) => (
<LeafyGreenChatProvider variant={Variant.Compact}>
{children}
</LeafyGreenChatProvider>
<LeafyGreenChatProvider>{children}</LeafyGreenChatProvider>
);

describe('ChatSideNav', () => {
beforeAll(() => {
global.ResizeObserver = jest.fn().mockImplementation(() => ({
observe: jest.fn(),
unobserve: jest.fn(),
disconnect: jest.fn(),
}));
});

afterEach(() => {
jest.clearAllMocks();
});

test('Header shows "New Chat" button when onClickNewChat provided', async () => {
const onClickNewChat = jest.fn();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import React from 'react';
import {
LeafyGreenChatProvider,
Variant,
} from '@lg-chat/leafygreen-chat-provider';
import { LeafyGreenChatProvider } from '@lg-chat/leafygreen-chat-provider';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

Expand All @@ -11,24 +8,10 @@ import { AriaCurrentValue } from '@leafygreen-ui/lib';
import { ChatSideNav } from '../..';

const Providers = ({ children }: { children: React.ReactNode }) => (
<LeafyGreenChatProvider variant={Variant.Compact}>
{children}
</LeafyGreenChatProvider>
<LeafyGreenChatProvider>{children}</LeafyGreenChatProvider>
);

describe('ChatSideNavItem', () => {
beforeAll(() => {
global.ResizeObserver = jest.fn().mockImplementation(() => ({
observe: jest.fn(),
unobserve: jest.fn(),
disconnect: jest.fn(),
}));
});

afterEach(() => {
jest.clearAllMocks();
});

test('renders with children', () => {
render(
<Providers>
Expand Down
52 changes: 4 additions & 48 deletions chat/chat-window/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,69 +22,25 @@ npm install @lg-chat/chat-window

## Example

### Compact

```tsx
import { ChatWindow } from '@lg-chat/chat-window';
import {
LeafyGreenChatProvider,
Variant,
} from '@lg-chat/leafygreen-chat-provider';
import { Message } from '@lg-chat/message';
import { MessageFeed } from '@lg-chat/message-feed';

const CompactExample = props => {
const userName = 'Sean Park';
const [messages, setMessages] = useState<Array<any>>(baseMessages);

const handleMessageSend = (messageBody: string) => {
const newMessage = {
messageBody,
userName,
};
setMessages(messages => [...messages, newMessage]);
};

return (
<LeafyGreenChatProvider variant={Variant.Compact}>
<ChatWindow title="LG Chat Demo" badgeText="Beta" {...props}>
<MessageFeed>
{messages.map(messageFields => (
<Message key={messageFields.id} {...messageFields} />
))}
</MessageFeed>
<InputBar onMessageSend={handleMessageSend} />
</ChatWindow>
</LeafyGreenChatProvider>
);
};
```

### Spacious

```tsx
import { ChatWindow } from '@lg-chat/chat-window';
import {
LeafyGreenChatProvider,
Variant,
} from '@lg-chat/leafygreen-chat-provider';
import { LeafyGreenChatProvider } from '@lg-chat/leafygreen-chat-provider';
import { Message } from '@lg-chat/message';
import { MessageFeed } from '@lg-chat/message-feed';
import { InputBar } from '@lg-chat/input-bar';

const SpaciousExample = props => {
const userName = 'Sean Park';
const Example = props => {
const [messages, setMessages] = useState<Array<any>>(baseMessages);

const handleMessageSend = (messageBody: string) => {
const newMessage = {
messageBody,
userName,
};
setMessages(messages => [...messages, newMessage]);
};

return (
<LeafyGreenChatProvider variant={Variant.Spacious}>
<LeafyGreenChatProvider>
<ChatWindow title="LG Chat Demo" badgeText="Beta" {...props}>
<MessageFeed>
{messages.map(messageFields => (
Expand Down
3 changes: 1 addition & 2 deletions chat/chat-window/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
},
"devDependencies": {
"@leafygreen-ui/drawer": "workspace:^",
"@lg-chat/avatar": "workspace:^",
"@lg-chat/input-bar": "workspace:^",
"@lg-chat/message": "workspace:^",
"@lg-chat/message-feed": "workspace:^",
Expand All @@ -33,7 +32,7 @@
},
"peerDependencies": {
"@leafygreen-ui/leafygreen-provider": "workspace:^3.2.0 || workspace:^4.0.0 || workspace:^5.0.0",
"@lg-chat/leafygreen-chat-provider": "workspace:^"
"@lg-chat/leafygreen-chat-provider": "workspace:^5.1.0 || workspace:^6.0.0"
},
"exports": {
".": {
Expand Down
Loading
Loading