-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into test/chat-panel-stories
- Loading branch information
Showing
34 changed files
with
526 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
apps/nextjs/src/components/AppComponents/Chat/chat-lhs-header.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { | ||
ChatContext, | ||
type ChatContextProps, | ||
} from "@/components/ContextProviders/ChatProvider"; | ||
|
||
import ChatLhsHeader from "./chat-lhs-header"; | ||
|
||
const ChatDecorator: Story["decorators"] = (Story, { parameters }) => ( | ||
<ChatContext.Provider | ||
value={ | ||
{ | ||
ailaStreamingStatus: "Idle", | ||
...parameters.chatContext, | ||
} as unknown as ChatContextProps | ||
} | ||
> | ||
<Story /> | ||
</ChatContext.Provider> | ||
); | ||
|
||
const meta: Meta<typeof ChatLhsHeader> = { | ||
title: "Components/Chat/ChatLhsHeader", | ||
component: ChatLhsHeader, | ||
tags: ["autodocs"], | ||
decorators: [ChatDecorator], | ||
args: { | ||
showStreamingStatus: false, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof ChatLhsHeader>; | ||
|
||
export const Default: Story = { | ||
args: {}, | ||
}; | ||
|
||
export const NonProdStreamingStatus: Story = { | ||
args: { | ||
showStreamingStatus: true, | ||
}, | ||
parameters: { | ||
chatContext: { | ||
ailaStreamingStatus: "StreamingLessonPlan", | ||
}, | ||
}, | ||
}; | ||
|
||
export const DemoBannerPadding: Story = { | ||
args: { | ||
isDemoUser: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 133 additions & 0 deletions
133
apps/nextjs/src/components/AppComponents/Chat/chat-quick-buttons.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { | ||
ChatContext, | ||
type ChatContextProps, | ||
} from "@/components/ContextProviders/ChatProvider"; | ||
import { lessonPlanTrackingContext } from "@/lib/analytics/lessonPlanTrackingContext"; | ||
|
||
import ChatQuickButtons from "./chat-quick-buttons"; | ||
|
||
const DummyMessage = {}; | ||
|
||
const ChatDecorator: Story["decorators"] = (Story, { parameters }) => ( | ||
<ChatContext.Provider | ||
value={ | ||
{ | ||
messages: [DummyMessage], | ||
...parameters.chatContext, | ||
} as unknown as ChatContextProps | ||
} | ||
> | ||
<Story /> | ||
</ChatContext.Provider> | ||
); | ||
|
||
const LessonPlanTrackingContextDecorator: Story["decorators"] = (Story) => ( | ||
<lessonPlanTrackingContext.Provider | ||
value={{ | ||
onClickContinue: () => {}, | ||
onClickRetry: () => {}, | ||
onClickStartFromExample: () => {}, | ||
onClickStartFromFreeText: () => {}, | ||
onStreamFinished: () => {}, | ||
onSubmitText: () => {}, | ||
}} | ||
> | ||
<Story /> | ||
</lessonPlanTrackingContext.Provider> | ||
); | ||
|
||
const meta: Meta<typeof ChatQuickButtons> = { | ||
title: "Components/Chat/ChatQuickButtons", | ||
component: ChatQuickButtons, | ||
tags: ["autodocs"], | ||
decorators: [ChatDecorator, LessonPlanTrackingContextDecorator], | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof ChatQuickButtons>; | ||
|
||
export const Idle: Story = { | ||
args: {}, | ||
parameters: { | ||
chatContext: { | ||
ailaStreamingStatus: "Idle", | ||
}, | ||
}, | ||
}; | ||
|
||
export const Loading: Story = { | ||
args: {}, | ||
parameters: { | ||
chatContext: { | ||
ailaStreamingStatus: "Loading", | ||
}, | ||
}, | ||
}; | ||
|
||
export const LoadingWithoutMessages: Story = { | ||
args: {}, | ||
parameters: { | ||
chatContext: { | ||
ailaStreamingStatus: "Loading", | ||
messages: [], | ||
}, | ||
}, | ||
}; | ||
|
||
export const RequestMade: Story = { | ||
args: {}, | ||
parameters: { | ||
chatContext: { | ||
ailaStreamingStatus: "RequestMade", | ||
}, | ||
}, | ||
}; | ||
|
||
export const StreamingLessonPlan: Story = { | ||
args: {}, | ||
parameters: { | ||
chatContext: { | ||
ailaStreamingStatus: "StreamingLessonPlan", | ||
}, | ||
}, | ||
}; | ||
|
||
export const StreamingChatResponse: Story = { | ||
args: {}, | ||
parameters: { | ||
chatContext: { | ||
ailaStreamingStatus: "StreamingChatResponse", | ||
}, | ||
}, | ||
}; | ||
|
||
export const Moderating: Story = { | ||
args: {}, | ||
parameters: { | ||
chatContext: { | ||
ailaStreamingStatus: "Moderating", | ||
}, | ||
}, | ||
}; | ||
|
||
export const StreamingWithQueuedUserAction: Story = { | ||
args: {}, | ||
parameters: { | ||
chatContext: { | ||
queuedUserAction: "regenerate", | ||
ailaStreamingStatus: "StreamingLessonPlan", | ||
}, | ||
}, | ||
}; | ||
|
||
export const ModeratingWithQueuedUserAction: Story = { | ||
args: {}, | ||
parameters: { | ||
chatContext: { | ||
queuedUserAction: "regenerate", | ||
ailaStreamingStatus: "Moderating", | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
apps/nextjs/src/components/Onboarding/AcceptTermsForm.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { AcceptTermsForm } from "./AcceptTermsForm"; | ||
|
||
const meta: Meta<typeof AcceptTermsForm> = { | ||
title: "Pages/Onboarding/AcceptTermsForm", | ||
component: AcceptTermsForm, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof AcceptTermsForm>; | ||
|
||
export const Default: Story = { | ||
args: {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
apps/nextjs/src/components/Onboarding/LegacyUpgradeNotice.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import { LegacyUpgradeNotice } from "./LegacyUpgradeNotice"; | ||
|
||
const meta: Meta<typeof LegacyUpgradeNotice> = { | ||
title: "Pages/Onboarding/LegacyUpgradeNotice", | ||
component: LegacyUpgradeNotice, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof LegacyUpgradeNotice>; | ||
|
||
export const Default: Story = { | ||
args: {}, | ||
}; |
Oops, something went wrong.