Skip to content

Commit

Permalink
finish migration
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking committed Dec 23, 2024
1 parent 23e612d commit 0b1fe16
Show file tree
Hide file tree
Showing 22 changed files with 117 additions and 143 deletions.
23 changes: 7 additions & 16 deletions app/src/components/ConfirmNavigation.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
import React, { ReactNode } from "react";
import { Blocker } from "react-router";

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

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

function ConfirmNavigationDialogFooter({ blocker }: { blocker: Blocker }) {
return (
<View padding={"size-100"} borderTopColor={"dark"} borderTopWidth={"thin"}>
<Flex justifyContent={"end"} gap={"size-100"}>
<Button
variant={"default"}
onClick={() => blocker.reset && blocker.reset()}
size={"compact"}
>
<Button onPress={() => blocker.reset && blocker.reset()} size="S">
Cancel
</Button>
<Button
variant={"primary"}
onClick={() => blocker.proceed && blocker.proceed()}
size={"compact"}
variant="primary"
onPress={() => blocker.proceed && blocker.proceed()}
size="S"
>
Confirm
</Button>
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/dataset/NewDatasetButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import React, { useState } from "react";

import {
Alert,
Button,
Card,
Icon,
Icons,
PopoverTrigger,
View,
} from "@arizeai/components";

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

import { CreateDatasetForm } from "./CreateDatasetForm";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from "react";

// eslint-disable-next-line deprecate/import
import {
Button,
Button as LegacyButton,
DropdownMenu,
DropdownTrigger,
Flex,
Expand All @@ -20,8 +21,8 @@ export function CanvasDisplaySettingsDropdown() {
const pointSizeScale = usePointCloudContext((state) => state.pointSizeScale);
return (
<DropdownTrigger placement="bottom left">
<Button
variant={"default"}
<LegacyButton
variant="default"
size="compact"
icon={<Icon svg={<Icons.OptionsOutline />} />}
aria-label="Display Settings"
Expand Down
9 changes: 3 additions & 6 deletions app/src/components/pointcloud/ClusteringSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Controller, useForm } from "react-hook-form";
import { css } from "@emotion/react";

import {
Button,
Content,
ContextualHelp,
Form,
Expand All @@ -12,6 +11,7 @@ import {
TextField,
} from "@arizeai/components";

import { Button } from "@phoenix/components";
import { MAX_32_BIT_INTEGER } from "@phoenix/constants/numberConstants";
import {
MIN_CLUSTER_MIN_SAMPLES,
Expand Down Expand Up @@ -243,15 +243,12 @@ export default function ClusteringSettings() {
<Button
variant={isDirty ? "primary" : "default"}
type="submit"
isDisabled={!isValid}
loading={clustersLoading}
isDisabled={!isValid || clustersLoading}
css={css`
width: 100%;
`}
>
{clustersLoading
? "Applying parameters"
: "Apply Clustering Config"}
{clustersLoading ? "Applying..." : "Apply Clustering Config"}
</Button>
</div>
</Form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Controller, useForm } from "react-hook-form";
import { css } from "@emotion/react";

import {
Button,
Content,
ContextualHelp,
Form,
Expand All @@ -12,6 +11,7 @@ import {
TextField,
} from "@arizeai/components";

import { Button } from "@phoenix/components";
import {
MAX_INFERENCES_SAMPLE_SIZE,
MAX_MIN_DIST,
Expand Down
7 changes: 4 additions & 3 deletions app/src/components/settings/UserForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React from "react";
import { Controller, useForm } from "react-hook-form";
import { css } from "@emotion/react";

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

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

import { RolePicker } from "./RolePicker";
Expand Down Expand Up @@ -193,8 +194,8 @@ export function UserForm({
<Button
variant={isDirty ? "primary" : "default"}
type="submit"
size="compact"
disabled={isSubmitting}
size="S"
isDisabled={isSubmitting}
>
{isSubmitting ? "Adding..." : "Add User"}
</Button>
Expand Down
19 changes: 10 additions & 9 deletions app/src/components/trace/EditSpanAnnotationsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import {
} from "react-relay";
import { css } from "@emotion/react";

// eslint-disable-next-line deprecate/import
import {
Alert,
Button,
Button as LegacyButton,
Card,
Dialog,
Flex,
Expand All @@ -29,6 +30,7 @@ import {
View,
} from "@arizeai/components";

import { Button } from "@phoenix/components";
import { Empty } from "@phoenix/components/Empty";
import { useNotifySuccess } from "@phoenix/contexts";
import { formatFloat } from "@phoenix/utils/numberFormatUtils";
Expand Down Expand Up @@ -129,17 +131,17 @@ function NewAnnotationButton(props: NewAnnotationButtonProps) {
setIsPopoverOpen(isOpen);
}}
>
<Button
variant="default"
<LegacyButton
variant="primary"
disabled={disabled}
size="compact"
icon={<Icon svg={<Icons.PlusCircleOutline />} />}
onClick={() => {
setIsPopoverOpen(true);
}}
>
New
</Button>
New Annotation
</LegacyButton>
<NewAnnotationPopover
projectId={projectId}
spanNodeId={spanNodeId}
Expand Down Expand Up @@ -267,12 +269,11 @@ function NewSpanAnnotationCard(props: {
<Flex direction="row" alignItems="center" gap="size-100">
<AnnotatorKindLabel kind="HUMAN" />
<Button
variant="default"
size="compact"
size="S"
isDisabled
aria-label="delete annotation"
icon={<Icon svg={<Icons.CloseOutline />} />}
onClick={onDelete}
onPress={onDelete}
/>
</Flex>
}
Expand Down Expand Up @@ -477,7 +478,7 @@ function NewAnnotationPopoverContent(props: {
/>
<Button
variant="primary"
onClick={() => {
onPress={() => {
onAnnotationNameSelect(newName);
}}
>
Expand Down
13 changes: 4 additions & 9 deletions app/src/components/trace/SpanAnnotationActionMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ import React, {
} from "react";
import { graphql, useMutation } from "react-relay";

import {
Button,
Dialog,
DialogContainer,
Flex,
Text,
View,
} from "@arizeai/components";
import { Dialog, DialogContainer, Flex, Text, View } from "@arizeai/components";
import { NoticeConfig } from "@arizeai/components/dist/notification/types";

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

import { SpanAnnotationActionMenuDeleteMutation } from "./__generated__/SpanAnnotationActionMenuDeleteMutation.graphql";
import { AnnotationActionMenu } from "./AnnotationActionMenu";

Expand Down Expand Up @@ -101,7 +96,7 @@ export function SpanAnnotationActionMenu(props: SpanAnnotationActionMenuProps) {
<Flex direction="row" justifyContent="end">
<Button
variant="danger"
onClick={() => {
onPress={() => {
handleDelete();
setConfirmDialog(null);
}}
Expand Down
14 changes: 4 additions & 10 deletions app/src/components/trace/SpanAnnotationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@ import React, { useCallback } from "react";
import { Controller, useForm } from "react-hook-form";
import { css } from "@emotion/react";

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

import { Button } from "@phoenix/components";
export type AnnotationFormData = {
name: string;
score?: number | null;
Expand Down Expand Up @@ -189,8 +183,8 @@ export function SpanAnnotationForm(props: SpanAnnotationFormProps) {
<Button
variant={isDirty ? "primary" : "default"}
type="submit"
size="compact"
disabled={!isValid || !isDirty || isSubmitting}
size="S"
isDisabled={!isValid || !isDirty || isSubmitting}
>
{isSubmitting ? "Saving..." : "Save"}
</Button>
Expand Down
7 changes: 4 additions & 3 deletions app/src/pages/auth/ForgotPasswordForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React, { useCallback, useState } from "react";
import { Controller, useForm } from "react-hook-form";
import { css } from "@emotion/react";

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

import { Button } from "@phoenix/components";
import { prependBasename } from "@phoenix/utils/routingUtils";

type ForgotPasswordFormParams = {
Expand Down Expand Up @@ -80,8 +81,8 @@ export function ForgotPasswordForm({
}
`}
>
<Button variant="primary" type={"submit"} loading={isLoading}>
Send
<Button variant="primary" type={"submit"} isDisabled={isLoading}>
{isLoading ? "Sending..." : "Send"}
</Button>
</div>
</Form>
Expand Down
12 changes: 8 additions & 4 deletions app/src/pages/auth/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { Controller, useForm } from "react-hook-form";
import { useNavigate } from "react-router";
import { css } from "@emotion/react";

import { Alert, Button, Form, TextField, View } from "@arizeai/components";
import { Alert, Form, Icon, Icons, TextField, View } from "@arizeai/components";

import { Button } from "@phoenix/components";
import { Link } from "@phoenix/components";
import { prependBasename } from "@phoenix/utils/routingUtils";
import { getReturnUrl } from "@phoenix/utils/routingUtils";
Expand Down Expand Up @@ -129,10 +130,13 @@ export function LoginForm(props: LoginFormProps) {
>
<Button
variant="primary"
loading={isLoading}
onClick={handleSubmit(onSubmit)}
isDisabled={isLoading}
icon={
isLoading ? <Icon svg={<Icons.LoadingOutline />} /> : undefined
}
onPress={() => handleSubmit(onSubmit)()}
>
Login
{isLoading ? "Logging in" : "Log in"}
</Button>
</div>
</Form>
Expand Down
9 changes: 5 additions & 4 deletions app/src/pages/dataset/AddDatasetExampleButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, { ReactNode, useCallback, useState } from "react";

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

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

import { AddDatasetExampleDialog } from "./AddDatasetExampleDialog";

Expand Down Expand Up @@ -28,9 +30,8 @@ export function AddDatasetExampleButton(props: AddDatasetExampleButtonProps) {
<>
<Button
icon={<Icon svg={<Icons.PlusCircleOutline />} />}
size="compact"
variant="default"
onClick={onAddExample}
size="S"
onPress={onAddExample}
>
Add Example
</Button>
Expand Down
14 changes: 8 additions & 6 deletions app/src/pages/dataset/AddDatasetExampleDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ import { css } from "@emotion/react";

import {
Alert,
Button,
Card,
CardProps,
Dialog,
Flex,
Icon,
Icons,
TextArea,
View,
} from "@arizeai/components";

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

Expand Down Expand Up @@ -226,12 +228,12 @@ export function AddDatasetExampleDialog(props: AddDatasetExampleDialogProps) {
<Flex direction="row" justifyContent="end" gap="size-100">
<Button
variant="primary"
size="compact"
disabled={!isValid || isCommitting}
loading={isCommitting}
onClick={handleSubmit(onSubmit)}
size="S"
isDisabled={!isValid || isCommitting}
icon={isCommitting ? <Icon svg={<Icons.LoadingOutline />} /> : null}
onPress={() => handleSubmit(onSubmit)()}
>
Add Example
{isCommitting ? "Adding Example..." : "Add Example"}
</Button>
</Flex>
</View>
Expand Down
Loading

0 comments on commit 0b1fe16

Please sign in to comment.