-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(onboarding): New project onboarding (#4372)
* feat(onboarding): New project onboarding * WIP * work in progress * add integrations * finish python onboarding * Final * add crewai * WIP
- Loading branch information
1 parent
4018c2c
commit 16ac5ed
Showing
28 changed files
with
1,538 additions
and
249 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from "react"; | ||
|
||
import { Radio, RadioGroup } from "@arizeai/components"; | ||
|
||
export type CodeLanguage = "Python" | "TypeScript"; | ||
|
||
export function CodeLanguageRadioGroup({ | ||
language, | ||
onChange, | ||
}: { | ||
language: CodeLanguage; | ||
onChange: (language: CodeLanguage) => void; | ||
}) { | ||
return ( | ||
<RadioGroup | ||
defaultValue={language} | ||
variant="inline-button" | ||
size="compact" | ||
onChange={(v) => { | ||
if (v === "Python" || v === "TypeScript") { | ||
onChange(v); | ||
} else { | ||
throw new Error(`Unknown language: ${v}`); | ||
} | ||
}} | ||
> | ||
<Radio label="Python" value={"Python"}> | ||
Python | ||
</Radio> | ||
<Radio label="TypeScript" value={"TypeScript"}> | ||
TypeScript | ||
</Radio> | ||
</RadioGroup> | ||
); | ||
} |
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,11 @@ | ||
import React, { ReactNode } from "react"; | ||
|
||
import { View } from "@arizeai/components"; | ||
|
||
export function CodeWrap({ children }: { children: ReactNode }) { | ||
return ( | ||
<View borderColor="light" borderWidth="thin" borderRadius="small"> | ||
{children} | ||
</View> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from "react"; | ||
import { javascript } from "@codemirror/lang-javascript"; | ||
import { nord } from "@uiw/codemirror-theme-nord"; | ||
import CodeMirror, { ReactCodeMirrorProps } from "@uiw/react-codemirror"; | ||
|
||
import { useTheme } from "@phoenix/contexts"; | ||
|
||
import { readOnlyCodeMirrorCSS } from "./styles"; | ||
|
||
type TypeScriptBlockProps = Omit< | ||
ReactCodeMirrorProps, | ||
"theme" | "extensions" | "editable" | "basicSetup" | ||
>; | ||
|
||
export function TypeScriptBlock(props: TypeScriptBlockProps) { | ||
const { theme } = useTheme(); | ||
const codeMirrorTheme = theme === "light" ? undefined : nord; | ||
return ( | ||
<CodeMirror | ||
value={props.value} | ||
extensions={[javascript({ typescript: true })]} | ||
editable={false} | ||
theme={codeMirrorTheme} | ||
{...props} | ||
basicSetup={{ | ||
lineNumbers: false, | ||
foldGutter: true, | ||
bracketMatching: true, | ||
syntaxHighlighting: true, | ||
highlightActiveLine: false, | ||
highlightActiveLineGutter: false, | ||
}} | ||
css={readOnlyCodeMirrorCSS} | ||
/> | ||
); | ||
} |
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,16 @@ | ||
import React from "react"; | ||
|
||
import { CopyToClipboardButton } from "../CopyToClipboardButton"; | ||
|
||
import { codeBlockWithCopyCSS } from "./styles"; | ||
import { TypeScriptBlock } from "./TypeScriptBlock"; | ||
|
||
export function TypeScriptBlockWithCopy(props: { value: string }) { | ||
const { value } = props; | ||
return ( | ||
<div className="typescript-code-block" css={codeBlockWithCopyCSS}> | ||
<CopyToClipboardButton text={value} /> | ||
<TypeScriptBlock value={value} /> | ||
</div> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
export * from "./JSONEditor"; | ||
export * from "./JSONBlock"; | ||
export * from "./PythonBlock"; | ||
export * from "./PythonBlockWithCopy"; | ||
export * from "./CodeWrap"; | ||
export * from "./TypeScriptBlock"; | ||
export * from "./CodeEditorFieldWrapper"; | ||
export * from "./CodeLanguageRadioGroup"; |
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
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.