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

refactor: [M3-8643] - Move Breadcrumb to linode/ui package #11329

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Removed
---

Move `Breadcrumb` from `manager` to `ui` package ([#11329](https://github.com/linode/manager/pull/11329))
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { Button } from '@linode/ui';
import { Breadcrumb, Button } from '@linode/ui';
import { styled, useTheme } from '@mui/material/styles';
import Grid from '@mui/material/Unstable_Grid2';
import useMediaQuery from '@mui/material/useMediaQuery';
import * as React from 'react';

import BetaFeedbackIcon from 'src/assets/icons/icon-feedback.svg';
import { Breadcrumb } from 'src/components/Breadcrumb/Breadcrumb';
import { DocsLink } from 'src/components/DocsLink/DocsLink';

import type { BreadcrumbProps } from '@linode/ui';
import type { Theme } from '@mui/material/styles';
import type { BreadcrumbProps } from 'src/components/Breadcrumb/Breadcrumb';

export interface LandingHeaderProps {
analyticsLabel?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { yupResolver } from '@hookform/resolvers/yup';
import { Paper, TextField, Typography } from '@linode/ui';
import { Breadcrumb, Paper, TextField, Typography } from '@linode/ui';
import { useSnackbar } from 'notistack';
import * as React from 'react';
import { Controller, FormProvider, useForm } from 'react-hook-form';
import { useHistory } from 'react-router-dom';

import { ActionsPanel } from 'src/components/ActionsPanel/ActionsPanel';
import { Breadcrumb } from 'src/components/Breadcrumb/Breadcrumb';
import { useCreateAlertDefinition } from 'src/queries/cloudpulse/alerts';

import { CloudPulseAlertSeveritySelect } from './GeneralInformation/AlertSeveritySelect';
Expand Down
5 changes: 5 additions & 0 deletions packages/ui/.changeset/pr-11329-added-1732605342203.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/ui": Added
---

Move `Breadcrumb` from `manager` to `ui` package ([#11329](https://github.com/linode/manager/pull/11329))
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { action } from '@storybook/addon-actions';
import { Meta, StoryObj } from '@storybook/react';
import React from 'react';

import { Breadcrumb } from './Breadcrumb';

import type { Meta, StoryObj } from '@storybook/react';

const meta: Meta<typeof Breadcrumb> = {
component: Breadcrumb,
title: 'Foundations/Breadcrumb',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { render } from '@testing-library/react';
import * as React from 'react';
import { describe, expect, it, vi } from 'vitest';

import { wrapWithTheme } from 'src/utilities/testHelpers';
import { wrapWithTheme } from '../../utilities/testHelpers';
import { Breadcrumb } from './Breadcrumb';

import { Breadcrumb, BreadcrumbProps } from './Breadcrumb';
import type { BreadcrumbProps } from './Breadcrumb';

const props: BreadcrumbProps = {
pathname: '/linodes/9872893679817/test/lastcrumb',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import * as React from 'react';

import { StyledPreContainerDiv, StyledRootDiv } from './Breadcrumb.styles';
import { CrumbOverridesProps, Crumbs } from './Crumbs';
import { EditableProps, LabelProps } from './types';
import { Crumbs } from './Crumbs';

import type { CrumbOverridesProps } from './Crumbs';
import type { EditableProps, LabelProps } from './types';

export interface BreadcrumbProps {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Typography } from '@linode/ui';
import { styled } from '@mui/material';

import { Typography } from '../Typography';

export const StyledTypography = styled(Typography, {
label: 'StyledTypography',
})(({}) => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { LocationDescriptor } from 'history';
import * as React from 'react';
import { Link } from 'react-router-dom';

Expand All @@ -9,7 +8,9 @@ import {
} from './Crumbs.styles';
import { FinalCrumb } from './FinalCrumb';
import { FinalCrumbPrefix } from './FinalCrumbPrefix';
import { EditableProps, LabelProps } from './types';

import type { EditableProps, LabelProps } from './types';
import type { LocationDescriptor } from 'history';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ we should see if we can eliminate the need for history. We don't want our UI package to depend on extra things if possible

export interface CrumbOverridesProps {
label?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { EditableText, H1Header } from '@linode/ui';
import { styled } from '@mui/material';

import { EditableText } from '../EditableText';
import { H1Header } from '../H1Header';

export const StyledDiv = styled('div', { label: 'StyledDiv' })({
display: 'flex',
flexDirection: 'column',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
StyledEditableText,
StyledH1Header,
} from './FinalCrumb.styles';
import { EditableProps, LabelProps } from './types';

import type { EditableProps, LabelProps } from './types';

interface Props {
crumb: string;
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/components/Breadcrumb/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Breadcrumb';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CSSProperties } from 'react';
import type { CSSProperties } from 'react';

export interface LabelProps {
linkTo?: string;
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export * from './Autocomplete';
export * from './BetaChip';
export * from './Box';
export * from './Button';
export * from './Breadcrumb';
export * from './Chip';
export * from './Checkbox';
export * from './CircleProgress';
Expand Down
Loading