Skip to content

refactor(required-fields-indicator, global-header, text-editor): replace Box with div #7366

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

Merged
merged 2 commits into from
Jun 9, 2025
Merged
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
@@ -1,14 +1,16 @@
import React from "react";
import styled from "styled-components";
import { MarginProps } from "styled-system";
import Box from "../../box";
import { margin, MarginProps } from "styled-system";
import applyBaseTheme from "../../../style/themes/apply-base-theme";
import StyledTypography from "../../typography/typography.style";

export interface RequiredIndicatorProps extends MarginProps {
children: React.ReactNode;
}

const StyledIndicatorContainer = styled(Box)`
const StyledIndicatorContainer = styled.div.attrs(applyBaseTheme)`
${margin}

${StyledTypography} {
color: var(--colorsUtilityYin090);
}
Expand Down
3 changes: 1 addition & 2 deletions src/components/global-header/global-header.component.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import styled from "styled-components";
import { PaddingProps, FlexboxProps } from "styled-system";
import Box from "../box";
import NavigationBar from "../navigation-bar";
import { TagProps } from "../../__internal__/utils/helpers/tags";
import { GlobalHeaderProvider } from "./__internal__/global-header.context";
Expand All @@ -16,7 +15,7 @@ export interface GlobalHeaderProps
logo?: React.ReactNode;
}

const StyledLogo = styled(Box)`
const StyledLogo = styled.div`
display: flex;
align-items: center;
margin-left: var(--spacing200);
Expand Down
3 changes: 1 addition & 2 deletions src/components/text-editor/text-editor.style.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import styled, { css } from "styled-components";

import { margin, MarginProps } from "styled-system";
import Box from "../box";
import addFocusStyling from "../../style/utils/add-focus-styling";

type StyledTextEditorWrapperProps = MarginProps;
Expand All @@ -20,7 +19,7 @@ interface StyledEditorToolbarWrapperProps {
hasWarningOrError?: boolean;
}

export const StyledTextEditor = styled(Box)`
export const StyledTextEditor = styled.div`
position: relative;
`;

Expand Down
Loading