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

promote dialog and overlay headers to core #4655

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Fercas123
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Feb 5, 2025

⚠️ No Changeset found

Latest commit: 8ec5792

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Feb 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
saltdesignsystem ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 24, 2025 5:15pm

@Fercas123 Fercas123 force-pushed the headers-core-promotion branch from 8a71815 to 8ec5792 Compare February 24, 2025 17:09
@Fercas123 Fercas123 marked this pull request as ready for review February 24, 2025 17:09
});

it("THEN should support initialFocus being set", () => {
cy.mount(<Default initialFocus={2} />);
cy.mount(<Default initialFocus={3} />);
Copy link
Contributor

Choose a reason for hiding this comment

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

worth to point out potential change in changeset

}

.saltDialogHeader-header > .saltText {
margin: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels magical, is this for global heading style

preheader={preheader}
description={description}
actions={<CloseButton />}
/>{" "}
Copy link
Contributor

Choose a reason for hiding this comment

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

{" "}

Copy link
Contributor

Choose a reason for hiding this comment

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

Need to make sure DialogCloseButton would still work with the new header (non breaking).

@@ -1,22 +1,38 @@
/* Styles applied to the root element */
.saltDialogHeader {
padding-bottom: var(--salt-spacing-100);
padding-bottom: var(--salt-spacing-300);
Copy link
Contributor

Choose a reason for hiding this comment

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

Changeset, this was highlighted by the community, that their existing header looks different than what's on the documentation, because our Site loads the lab CSS which overrides core

import { useComponentCssInjection } from "@salt-ds/styles";
import { useWindow } from "@salt-ds/window";
import clsx from "clsx";
import { clsx } from "clsx";
Copy link
Contributor

Choose a reason for hiding this comment

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

Feels intentional...?

@@ -93,11 +94,20 @@ NoStyleInjectionGrid.parameters = {
};

export const CloseButton: StoryFn<QAContainerProps> = (props) => {
const CloseButton = () => (
Copy link
Contributor

Choose a reason for hiding this comment

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

may trigger lint error double CloseButton definition

@@ -152,9 +168,19 @@ export const NoStyleInjectionCloseButton: StoryFn<
<Button>Show Overlay</Button>
</OverlayTrigger>
<OverlayPanel>
<OverlayPanelCloseButton />
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to dialog, need to keep at least 1 OverlayPanelCloseButton for backwards compatibility check

@@ -18,6 +17,7 @@ import {
useState,
} from "react";
import "./dialog.stories.css";
import { CloseIcon } from "@salt-ds/icons";
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth to use icon from useIcon rather than import from icons package directly, to show the best practice?

<LivePreview componentName="dialog" exampleName="Preheader" >
## Preheader

You can use the optional `preheader` prop to render a preheader above the main header of your dialog

</LivePreview>

<LivePreview componentName="dialog" exampleName="CloseButton" >
## Close button
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is solely for DialogCloseButton, maybe add "deprecated" to the heading text as well. like button variants, add move to bottom of examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants