-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[editor] Add MantineProvider to Unblock Styling Work (#640)
# [editor] Add MantineProvider to Unblock Styling Work Adding the [MantineProvider](https://mantine.dev/theming/mantine-provider/) around the editor to allow customizing theme/styles from the root component. This will allow differentiation between local editor and gradio ## Testing: - Load editor without issue - Temporarily set theme={{primaryColor: "red"}} and see the correct changes --- Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/lastmile-ai/aiconfig/pull/640). * __->__ #640 * #639 * #638
- Loading branch information
Showing
7 changed files
with
131 additions
and
59 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
14 changes: 14 additions & 0 deletions
14
python/src/aiconfig/editor/client/src/components/prompt/PromptOutputBar.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,14 @@ | ||
import { Divider, Flex, Text } from "@mantine/core"; | ||
import { memo } from "react"; | ||
|
||
type Props = {}; | ||
|
||
export default memo(function PromptOutputBar(_props: Props) { | ||
return ( | ||
<Flex direction="column" mt="0.5em"> | ||
<Divider size="sm" mt="0.5em" mb="0.5em" /> | ||
<Text color="dimmed">Output</Text> | ||
{/* TODO: Add output metrics */} | ||
</Flex> | ||
); | ||
}); |
33 changes: 33 additions & 0 deletions
33
python/src/aiconfig/editor/client/src/components/prompt/RunPromptButton.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,33 @@ | ||
import { ClientPrompt } from "../../shared/types"; | ||
import { Button, createStyles, Flex, Text } from "@mantine/core"; | ||
import { IconPlayerPlayFilled } from "@tabler/icons-react"; | ||
import { memo } from "react"; | ||
|
||
type Props = { | ||
prompt: ClientPrompt; | ||
size: "compact" | "full"; | ||
}; | ||
|
||
const useStyles = createStyles(() => ({ | ||
executeButton: { | ||
borderBottomLeftRadius: 0, | ||
borderTopLeftRadius: 0, | ||
borderTopRightRadius: 0, | ||
}, | ||
})); | ||
|
||
export default memo(function RunPromptButton({ prompt, size }: Props) { | ||
const { classes } = useStyles(); | ||
return ( | ||
<Button | ||
onClick={() => {}} | ||
p="xs" | ||
size="xs" | ||
fullWidth={size === "full"} | ||
className={classes.executeButton} | ||
> | ||
<IconPlayerPlayFilled size="16" /> | ||
{size === "full" && <Text ml="0.5em">Run</Text>} | ||
</Button> | ||
); | ||
}); |
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