Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change all imports to be relative to ./ rather than from ./index.ts #1828

Merged
merged 10 commits into from
Jul 5, 2023
10 changes: 8 additions & 2 deletions packages/odyssey-react-mui/src/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@
* See the License for the specific language governing permissions and limitations under the License.
*/

import { AlertColor, AlertProps } from "@mui/material";
import {
Alert,
AlertColor,
AlertTitle,
AlertProps,
Link,
ScreenReaderText,
} from "./";
import { memo } from "react";
import { Alert, AlertTitle, Link, ScreenReaderText } from "./";
import { useTranslation } from "react-i18next";

export type BannerProps = {
Expand Down
8 changes: 5 additions & 3 deletions packages/odyssey-react-mui/src/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
* See the License for the specific language governing permissions and limitations under the License.
*/

import { Checkbox as MuiCheckbox, Typography } from "@mui/material";
import {
Checkbox as MuiCheckbox,
FormControlLabel,
Typography,
} from "@mui/material";
import { ChangeEventHandler, memo, useMemo } from "react";
import { useTranslation } from "react-i18next";

import { FormControlLabel } from ".";

export type CheckboxProps = {
ariaLabel?: string;
ariaLabelledBy?: string;
Expand Down
3 changes: 2 additions & 1 deletion packages/odyssey-react-mui/src/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import {
DialogContentText,
DialogActions,
} from "@mui/material";
import { Button, CloseIcon } from "./";
import { Button } from "./Button";
import { CloseIcon } from "./iconDictionary";
import {
memo,
ReactNode,
Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-react-mui/src/FieldError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import { memo } from "react";

import { FormHelperText } from ".";
import { FormHelperText } from "@mui/material";
import { ScreenReaderText } from "./ScreenReaderText";
import { useTranslation } from "react-i18next";

Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-react-mui/src/FieldHint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import { memo } from "react";

import { FormHelperText } from "./";
import { FormHelperText } from "@mui/material";

export type FieldHintProps = {
id?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-react-mui/src/FieldLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { memo, useMemo } from "react";

import { useTranslation } from "react-i18next";
import { ScreenReaderText } from "./ScreenReaderText";
import { Typography } from ".";
import { Typography } from "@mui/material";

export type FieldLabelProps = {
hasVisibleLabel: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-react-mui/src/Fieldset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import { memo, ReactElement } from "react";

import { Box, Typography } from ".";
import { Box, Typography } from "@mui/material";
import { Infobox } from "./Infobox";
import { useUniqueId } from "./useUniqueId";

Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-react-mui/src/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import { memo, ReactElement } from "react";

import { Box, Typography } from "./";
import { Box, Typography } from "@mui/material";
import { Button } from "./Button";
import { Infobox } from "./Infobox";
import { useUniqueId } from "./useUniqueId";
Expand Down
3 changes: 2 additions & 1 deletion packages/odyssey-react-mui/src/Infobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

import { AlertColor } from "@mui/material";
import { memo, ReactNode } from "react";
import { Alert, AlertTitle, ScreenReaderText } from ".";
import { Alert, AlertTitle } from "@mui/material";
import { ScreenReaderText } from "./ScreenReaderText";
import { useTranslation } from "react-i18next";

export type InfoboxProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-react-mui/src/OdysseyProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import { memo, ReactElement } from "react";

import { ThemeOptions } from ".";
import { ThemeOptions } from "@mui/material";
import { DesignTokensOverride } from "../src/theme/index";
import { OdysseyCacheProvider } from "./OdysseyCacheProvider";
import { OdysseyThemeProvider } from "./OdysseyThemeProvider";
Expand Down
10 changes: 7 additions & 3 deletions packages/odyssey-react-mui/src/OdysseyThemeProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@
* See the License for the specific language governing permissions and limitations under the License.
*/

import { ThemeProvider as MuiThemeProvider } from "@mui/material/styles";
import {
createTheme,
ThemeProvider as MuiThemeProvider,
} from "@mui/material/styles";
import { memo, ReactElement, useMemo } from "react";

import { createTheme, deepmerge, ThemeOptions, DesignTokensOverride } from ".";
import { createOdysseyMuiTheme } from "./theme";
import { ThemeOptions } from "@mui/material";
import { deepmerge } from "@mui/utils";
import { createOdysseyMuiTheme, DesignTokensOverride } from "./theme";
import * as Tokens from "@okta/odyssey-design-tokens";

const OdysseyThemeProvider = ({
Expand Down
3 changes: 2 additions & 1 deletion packages/odyssey-react-mui/src/PasswordField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import {
useState,
} from "react";

import { ShowIcon, HideIcon, IconButton } from "./";
import { ShowIcon, HideIcon } from "./iconDictionary";
import { IconButton } from "@mui/material";
import { Field } from "./Field";

export type PasswordFieldProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-react-mui/src/Radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import { Radio as MuiRadio } from "@mui/material";
import { memo } from "react";

import { FormControlLabel } from ".";
import { FormControlLabel } from "@mui/material";

export type RadioProps = {
isChecked?: boolean;
Expand Down
3 changes: 2 additions & 1 deletion packages/odyssey-react-mui/src/ScreenReaderText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
*/

import { memo, ReactNode } from "react";
import { Box, visuallyHidden } from "./";
import { Box } from "@mui/material";
import { visuallyHidden } from "@mui/utils";

export type ScreenReaderTextProps = {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-react-mui/src/SearchField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
useCallback,
} from "react";

import { SearchIcon } from "./";
import { SearchIcon } from "./iconDictionary";
import { Field } from "./Field";

export type SearchFieldProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-react-mui/src/Status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and limitations under the License.
*/

import { Chip } from "./";
import { Chip } from "@mui/material";

export type StatusProps = {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-react-mui/src/TagList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and limitations under the License.
*/

import { Tag } from "./";
import { Tag } from "./Tag";
import { Stack } from "@mui/material";
import { memo, ReactElement, useMemo } from "react";
import { ChipElementType, TagListContext } from "./TagListContext";
Expand Down
12 changes: 4 additions & 8 deletions packages/odyssey-react-mui/src/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@

import { AlertColor } from "@mui/material";
import { useEffect, memo, useState, useCallback } from "react";
import {
Alert,
AlertTitle,
CloseIcon,
Link,
Snackbar,
visuallyHidden,
} from ".";
import { Alert, AlertTitle, Snackbar } from "@mui/material";
import { visuallyHidden } from "@mui/utils";
import { Link } from "./Link";
import { CloseIcon } from "./iconDictionary";
import { Button } from "./Button";
import { useTranslation } from "react-i18next";

Expand Down
2 changes: 1 addition & 1 deletion packages/odyssey-react-mui/src/ToastStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import { memo, ReactElement } from "react";
import { Box, Snackbar } from ".";
import { Box, Snackbar } from "@mui/material";
import { Toast } from "./Toast";

export type ToastStackProps = {
Expand Down
1 change: 1 addition & 0 deletions packages/odyssey-react-mui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export {
} from "@mui/material";

export type {
AlertColor,
AlertProps,
AlertTitleProps,
BoxProps,
Expand Down