Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking committed Dec 23, 2024
1 parent 0561340 commit 046d690
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 45 deletions.
9 changes: 5 additions & 4 deletions app/src/components/auth/DeleteAPIKeyButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { ReactNode, useState } from "react";

import {
Button,
Dialog,
DialogContainer,
Flex,
Expand All @@ -11,6 +10,8 @@ import {
View,
} from "@arizeai/components";

import { Button } from "@phoenix/components";

export function DeleteAPIKeyButton({
handleDelete,
}: {
Expand All @@ -36,7 +37,7 @@ export function DeleteAPIKeyButton({
<Flex direction="row" justifyContent="end">
<Button
variant="danger"
onClick={() => {
onPress={() => {
handleDelete();
setDialog(null);
}}
Expand All @@ -52,10 +53,10 @@ export function DeleteAPIKeyButton({
<>
<Button
variant="danger"
size="compact"
size="S"
icon={<Icon svg={<Icons.TrashOutline />} />}
aria-label="Delete System Key"
onClick={onDelete}
onPress={onDelete}
/>
<DialogContainer
isDismissable
Expand Down
21 changes: 9 additions & 12 deletions app/src/components/dataset/DatasetForm.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import React from "react";
import { Controller, useForm } from "react-hook-form";

import {
Button,
Flex,
Form,
TextArea,
TextField,
View,
} from "@arizeai/components";
import { Flex, Form, TextArea, TextField, View } from "@arizeai/components";

import { Button } from "@phoenix/components";
import { CodeEditorFieldWrapper, JSONEditor } from "@phoenix/components/code";
import { isJSONObjectString } from "@phoenix/utils/jsonUtils";

Expand Down Expand Up @@ -129,11 +123,14 @@ export function DatasetForm({
<Button
// Only allow submission if the form is dirty for edits
// When creating allow the user to click create without any changes as the form will be prefilled with valid values
disabled={formMode === "edit" ? !isDirty : false}
isDisabled={
(formMode === "edit" ? !isDirty : false) || isSubmitting
}
variant={isDirty ? "primary" : "default"}
size="compact"
loading={isSubmitting}
onClick={handleSubmit(onSubmit)}
size="S"
onPress={() => {
handleSubmit(onSubmit)();
}}
>
{submitButtonText}
</Button>
Expand Down
16 changes: 9 additions & 7 deletions app/src/components/pointcloud/PointCloud.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { ThemeContext as EmotionThemeContext } from "@emotion/react";

import {
ActionTooltip,
Button,
Heading,
Icon,
InfoOutline,
TooltipTrigger,
TriggerWrap,
} from "@arizeai/components";
import {
Axes,
Expand All @@ -21,6 +21,7 @@ import {
ThreeDimensionalControls,
} from "@arizeai/point-cloud";

import { Button } from "@phoenix/components";
import { UNKNOWN_COLOR } from "@phoenix/constants/pointCloudConstants";
import {
InferencesContext,
Expand Down Expand Up @@ -184,12 +185,13 @@ function CanvasTools() {
function CanvasInfo() {
return (
<TooltipTrigger placement="bottom left" delay={0}>
<Button
variant="default"
size="compact"
icon={<Icon svg={<InfoOutline />} />}
aria-label="Information bout the point-cloud display"
/>
<TriggerWrap>
<Button
size="S"
icon={<Icon svg={<InfoOutline />} />}
aria-label="Information bout the point-cloud display"
/>
</TriggerWrap>
<ActionTooltip title={"Point Cloud Summary"}>
<PointCloudInfo />
</ActionTooltip>
Expand Down
19 changes: 10 additions & 9 deletions app/src/components/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import {
useReactTable,
} from "@tanstack/react-table";

import { Button, Icon, Icons } from "@arizeai/components";
import { Icon, Icons } from "@arizeai/components";

import { Button } from "@phoenix/components";

import { paginationCSS, tableCSS } from "./styles";
import { TableEmpty } from "./TableEmpty";
Expand Down Expand Up @@ -75,25 +77,24 @@ export function Table<DataRow extends object>({
</thead>
{body}
</table>
{/*
{/*
TODO(mikeldking): style tables
This is just a very basic UI implementation
*/}
<div css={paginationCSS}>
<Button
variant="default"
size="compact"
onClick={table.previousPage}
disabled={!table.getCanPreviousPage()}
size="S"
onPress={table.previousPage}
isDisabled={!table.getCanPreviousPage()}
aria-label="Previous Page"
icon={<Icon svg={<Icons.ArrowIosBackOutline />} />}
/>

<Button
variant="default"
size="compact"
onClick={table.nextPage}
disabled={!table.getCanNextPage()}
size="S"
onPress={table.nextPage}
isDisabled={!table.getCanNextPage()}
aria-label="Next Page"
icon={<Icon svg={<Icons.ArrowIosForwardOutline />} />}
/>
Expand Down
20 changes: 16 additions & 4 deletions app/src/pages/datasets/DeleteDatasetDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import React, { startTransition, useCallback } from "react";
import { useMutation } from "react-relay";
import { graphql } from "relay-runtime";

import { Button, Dialog, Flex, Text, View } from "@arizeai/components";
import { Dialog, Flex, Icon, Icons, Text, View } from "@arizeai/components";

import { Button } from "@phoenix/components";

import { DeleteDatasetDialogMutation } from "./__generated__/DeleteDatasetDialogMutation.graphql";

Expand Down Expand Up @@ -58,11 +60,21 @@ export function DeleteDatasetDialog({
<Flex direction="row" justifyContent="end">
<Button
variant="danger"
onClick={() => {
onPress={() => {
handleDelete();
}}
disabled={isCommittingDelete}
loading={isCommittingDelete}
isDisabled={isCommittingDelete}
icon={
<Icon
svg={
isCommittingDelete ? (
<Icons.LoadingOutline />
) : (
<Icons.TrashOutline />
)
}
/>
}
>
Delete Dataset
</Button>
Expand Down
9 changes: 5 additions & 4 deletions app/src/pages/example/EditExampleButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, { ReactNode, useState } from "react";

import { Button, DialogContainer, Icon, Icons } from "@arizeai/components";
import { DialogContainer, Icon, Icons } from "@arizeai/components";

import { Button } from "@phoenix/components";

import { EditExampleDialog, EditExampleDialogProps } from "./EditExampleDialog";

Expand All @@ -11,10 +13,9 @@ export function EditExampleButton(props: EditExampleButtonProps) {
return (
<>
<Button
variant="default"
size="compact"
size="S"
icon={<Icon svg={<Icons.EditOutline />} />}
onClick={() =>
onPress={() =>
setDialog(
<EditExampleDialog
{...dialogProps}
Expand Down
10 changes: 5 additions & 5 deletions app/src/pages/playground/PlaygroundDatasetPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React from "react";
import { useNavigate, useParams } from "react-router";
import { css } from "@emotion/react";

import { Button, Icon, Icons } from "@arizeai/components";
import { Icon, Icons } from "@arizeai/components";

import { Button } from "@phoenix/components";
import { DatasetPicker } from "@phoenix/components/dataset";

/**
Expand All @@ -23,7 +24,7 @@ const playgroundDatasetPickerCSS = css`
border-bottom-right-radius: 0;
height: ${DATASET_PICKER_BUTTON_HEIGHT}px;
}
.ac-button {
& > button {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-left: none;
Expand Down Expand Up @@ -51,10 +52,9 @@ export function PlaygroundDatasetPicker() {
}}
/>
<Button
size="compact"
variant={"default"}
size="S"
icon={<Icon svg={<Icons.CloseOutline />} />}
onClick={() => {
onPress={() => {
navigate("/playground");
}}
/>
Expand Down

0 comments on commit 046d690

Please sign in to comment.