-
Notifications
You must be signed in to change notification settings - Fork 563
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cta for embeddings and model evaluation
- Loading branch information
Showing
18 changed files
with
333 additions
and
243 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
167 changes: 167 additions & 0 deletions
167
app/packages/components/src/components/PanelCTA/index.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,167 @@ | ||
import { constants } from "@fiftyone/utilities"; | ||
import { OpenInNew, West } from "@mui/icons-material"; | ||
import { | ||
Box, | ||
Button, | ||
Card, | ||
IconProps, | ||
Stack, | ||
Typography, | ||
TypographyProps, | ||
useTheme, | ||
} from "@mui/material"; | ||
import React, { FunctionComponent } from "react"; | ||
import MuiButton from "../MuiButton"; | ||
import MuiIconFont from "../MuiIconFont"; | ||
|
||
const { IS_APP_MODE_FIFTYONE, BOOK_A_DEMO_LINK, TRY_IN_BROWSER_LINK } = | ||
constants; | ||
|
||
export default function PanelCTA(props: PanelCTAProps) { | ||
const { | ||
demoLabel, | ||
demoDescription, | ||
demoCaption, | ||
Actions, | ||
caption, | ||
description, | ||
docCaption, | ||
docLink, | ||
icon: Icon, | ||
iconProps = {}, | ||
label, | ||
mode, | ||
name, | ||
onBack, | ||
} = props; | ||
const theme = useTheme(); | ||
const isDefault = mode === "default"; | ||
const computedLabel = IS_APP_MODE_FIFTYONE ? demoLabel || label : label; | ||
const computedDescription = IS_APP_MODE_FIFTYONE | ||
? demoDescription || description | ||
: description; | ||
const computedCaption = IS_APP_MODE_FIFTYONE | ||
? demoCaption || caption | ||
: caption; | ||
|
||
return ( | ||
<Stack spacing={1} sx={{ height: "100%", p: 2 }}> | ||
{isDefault && ( | ||
<Box> | ||
<Button onClick={onBack} startIcon={<West />} color="secondary"> | ||
Back to {name} | ||
</Button> | ||
</Box> | ||
)} | ||
<Card sx={{ position: "relative", height: "100%" }}> | ||
<Stack | ||
spacing={1} | ||
sx={{ | ||
height: "100%", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
}} | ||
> | ||
{typeof Icon === "string" && ( | ||
<MuiIconFont | ||
sx={{ | ||
fontSize: 64, | ||
color: theme.palette.custom.primarySoft, | ||
marginBottom: 2, | ||
}} | ||
{...(iconProps as IconProps)} | ||
name={Icon} | ||
/> | ||
)} | ||
{Boolean(Icon) && typeof Icon !== "string" && Icon} | ||
<TypographyOrNode variant="h6">{computedLabel}</TypographyOrNode> | ||
<TypographyOrNode color="secondary"> | ||
{computedDescription} | ||
</TypographyOrNode> | ||
<TypographyOrNode sx={{ color: theme.palette.text.tertiary }}> | ||
{computedCaption} | ||
</TypographyOrNode> | ||
{!IS_APP_MODE_FIFTYONE && ( | ||
<Box pt={1}>{Actions && <Actions {...props} />}</Box> | ||
)} | ||
{IS_APP_MODE_FIFTYONE && ( | ||
<Stack direction="row" spacing={2} pt={2}> | ||
<MuiButton | ||
variant="contained" | ||
color="primary" | ||
href={BOOK_A_DEMO_LINK} | ||
target="_blank" | ||
> | ||
Book a demo | ||
</MuiButton> | ||
<MuiButton | ||
variant="contained" | ||
color="primary" | ||
href={TRY_IN_BROWSER_LINK} | ||
target="_blank" | ||
> | ||
Try in browser | ||
</MuiButton> | ||
</Stack> | ||
)} | ||
{docLink && ( | ||
<Stack | ||
spacing={1} | ||
sx={{ | ||
position: "absolute", | ||
bottom: "32px", | ||
alignItems: "center", | ||
}} | ||
> | ||
{docCaption && ( | ||
<Typography color="secondary"> | ||
{docCaption || "Not ready to upgrade yet?"} | ||
</Typography> | ||
)} | ||
<MuiButton | ||
variant="outlined" | ||
endIcon={<OpenInNew sx={{ fontSize: "16px!important" }} />} | ||
href={docLink} | ||
target="_blank" | ||
> | ||
View documentation | ||
</MuiButton> | ||
</Stack> | ||
)} | ||
</Stack> | ||
</Card> | ||
</Stack> | ||
); | ||
} | ||
|
||
function TypographyOrNode(props: TypographyProps) { | ||
const { children, ...otherProps } = props; | ||
|
||
if (typeof children === "string") { | ||
return <Typography {...otherProps}>{children}</Typography>; | ||
} | ||
|
||
if (React.isValidElement(children)) { | ||
return children; | ||
} | ||
|
||
return null; | ||
} | ||
|
||
export type PanelCTAProps = { | ||
Actions?: FunctionComponent<any>; | ||
caption?: string | React.ReactNode; | ||
description?: string | React.ReactNode; | ||
docCaption?: string; | ||
docLink?: string; | ||
icon?: string | React.ReactNode; | ||
iconProps?: IconProps; | ||
label: string | React.ReactNode; | ||
mode?: "onboarding" | "default"; | ||
name: string; | ||
onBack: () => void; | ||
panelProps?: any; | ||
demoLabel?: string; | ||
demoDescription?: string; | ||
demoCaption?: string; | ||
}; |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export { type AdaptiveMenuItemComponentPropsType } from "./AdaptiveMenu"; | ||
export { type PanelCTAProps } from "./PanelCTA"; |
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: 0 additions & 55 deletions
55
...packages/core/src/plugins/SchemaIO/components/NativeModelEvaluationView/EmptyOverview.tsx
This file was deleted.
Oops, something went wrong.
21 changes: 6 additions & 15 deletions
21
app/packages/core/src/plugins/SchemaIO/components/NativeModelEvaluationView/Evaluate.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
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
Oops, something went wrong.