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

[core] feat(MultistepDialog): navigationPosition prop #4970

Merged
merged 12 commits into from
Apr 5, 2022

Conversation

mud
Copy link
Contributor

@mud mud commented Oct 15, 2021

Follow up to #4969

This PR builds on top of #4969 by adding an option to position the navigation element in MultistepDialog. In addition to the default (Position.LEFT) Position.TOP and Position.RIGHT are possible.

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

Add a new prop to MultistepDialog which allows the positioning of the navigation element to the top or right.

Reviewers should focus on:

This is all done through style changes by applying a top level class for each position. All the overrides are in .#{$ns}-multistep-dialog-panels so it's all in one place, but alternative is to add position overrides to each existing class name where they appear.

Screenshot

Position.TOP

Screen Shot 2021-10-15 at 3 08 08 PM
Screen Shot 2021-10-15 at 3 07 58 PM

Position.RIGHT

Screen Shot 2021-10-15 at 2 57 33 PM
Screen Shot 2021-10-15 at 2 57 23 PM

@mud mud requested a review from adidahiya October 18, 2021 16:49
Base automatically changed from to/multistep-dialog-fixes to develop October 19, 2021 17:54
@blueprint-bot
Copy link

Oops remove old props

Previews: documentation | landing | table | modern colors demo

@mud
Copy link
Contributor Author

mud commented Oct 19, 2021

Hey @adidahiya I merged develop and clean up this PR in case you reconsider the position feature. Feel free to close if you don't think it's worthwhile to support -- I can create a custom component in-app instead.

@aycai
Copy link
Contributor

aycai commented Oct 19, 2021

Chatted with the original designer for some of her thoughts and relaying here along with mine:

  • Overall adding positioning seems reasonable. I'd say having the steps on the right side should be used with caution (for information hierarchy concerns) but some edge cases (e.g. RTL languages) might reasonably use this and at the end of the day it's up to each consumer.
  • I'd want to keep the header present with Position.TOP and discourage removing it to keep the structure of the dialog intact, as well as to keep the "close" button present.
  • Position.TOP makes this more apparent, but the differing background colors feel wonky when positioned next to both the header (with the white background) and the body (with the light grey background). This might be a separate change to consider outside the scope of positioning, but flagging here.

@mud
Copy link
Contributor Author

mud commented Oct 19, 2021

Thanks @aycai

To address your second point, we fixed issues some issues with omitting title in #4969. So there is a way to close the dialog without the title.

As for discouraging Position.RIGHT, I just added that option because it was easy and reasonable. Position.BOTTOM didn't make sense since it would conflict with the footer. I'm happy to work on RTL support, especially since we'd need to flip the footer navigation (which currently is not possible.)

What I would like to get from the Blueprint team is 1) what can we do in this PR for you to accept the Position option and 2) any additional FLUPs to work on (ie. RTL support) which I'm happy to implement.

@aycai
Copy link
Contributor

aycai commented Oct 20, 2021

Gotcha, didn't realize the hidden header is already existing behavior. Moving the close button makes sense in a regular dialog, though the hierarchy gets a little wonky if the steps are to the left and outside the footer but the button to close the entire dialog is in that footer.

As for this change no other flags on the design side!

@adidahiya
Copy link
Contributor

@aycai the title was removable before, but there were some styling issues which likely discouraged that kind of usage of the component. We only fixed those styling issues yesterday in #4969, thereby adding "full" support for omitting a title from MultistepDialog. At this point, we still have a chance to go back and change that (we can make title required and always render the header); that change has not been released yet in @blueprintjs/core. However I feel like it's probably ok despite the small information hierarchy concern you mentioned. Lmk if you feel strongly against it, otherwise I'll go ahead and review this PR soon...

@aycai
Copy link
Contributor

aycai commented Oct 20, 2021

I think we can keep our path forward here as is; the information hierarchy point is something I'm more concerned about enforcing separately.

@adidahiya adidahiya added this to the core v4.1 milestone Mar 16, 2022
@adidahiya adidahiya self-assigned this Mar 16, 2022
@adidahiya adidahiya removed this from the core v4.1 milestone Apr 5, 2022
@blueprint-bot
Copy link

Merge remote-tracking branch 'origin/develop' into to/multistep-dialog-position

Previews: documentation | landing | table | demo

@adidahiya adidahiya added this to the core v4.1 milestone Apr 5, 2022
Comment on lines 200 to 201
export const MULTISTEP_DIALOG_POSITION_TOP = `${MULTISTEP_DIALOG}-position-top`;
export const MULTISTEP_DIALOG_POSITION_RIGHT = `${MULTISTEP_DIALOG}-position-right`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export const MULTISTEP_DIALOG_POSITION_TOP = `${MULTISTEP_DIALOG}-position-top`;
export const MULTISTEP_DIALOG_POSITION_RIGHT = `${MULTISTEP_DIALOG}-position-right`;
export const MULTISTEP_DIALOG_NAV_TOP = `${MULTISTEP_DIALOG}-nav-top`;
export const MULTISTEP_DIALOG_NAV_RIGHT = `${MULTISTEP_DIALOG}-nav-right`;

@@ -23,6 +23,79 @@ $step-radius: $pt-border-radius * 2 !default;
border-top-right-radius: $dialog-border-radius;
}
}

.#{$ns}-multistep-dialog-position-top & {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.#{$ns}-multistep-dialog-position-top & {
.#{$ns}-multistep-dialog-nav-top & {

}
}

.#{$ns}-multistep-dialog-position-right & {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.#{$ns}-multistep-dialog-position-right & {
.#{$ns}-multistep-dialog-nav-right & {

import { DISPLAYNAME_PREFIX } from "../../common/props";
import { Button, ButtonProps } from "../button/buttons";
import { Dialog, DialogProps } from "./dialog";
import { DialogStep, DialogStepId, DialogStepProps, DialogStepButtonProps } from "./dialogStep";

type DialogStepElement = React.ReactElement<DialogStepProps & { children: React.ReactNode }>;

export type MultistepDialogNavigationPosition = typeof Position.TOP | typeof Position.LEFT | typeof Position.RIGHT;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export type MultistepDialogNavigationPosition = typeof Position.TOP | typeof Position.LEFT | typeof Position.RIGHT;
export type MultistepDialogNavPosition = typeof Position.TOP | typeof Position.LEFT | typeof Position.RIGHT;

*
* @default Position.LEFT
*/
navigationPosition?: MultistepDialogNavigationPosition;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
navigationPosition?: MultistepDialogNavigationPosition;
navPosition?: MultistepDialogNavPosition;

@@ -45,6 +47,13 @@ export interface IMultistepDialogProps extends DialogProps {
*/
finalButtonProps?: Partial<ButtonProps>;

/**
* Position of the step navigation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Position of the step navigation.
* Position of the step navigation within the dialog.

@blueprint-bot
Copy link

minor renames for brevity

Previews: documentation | landing | table | demo

@adidahiya adidahiya changed the title Add positioning of navigation element for MultistepDialog [core] feat(MultistepDialog): navigationPosition prop Apr 5, 2022
@adidahiya adidahiya merged commit d01d91c into develop Apr 5, 2022
@adidahiya adidahiya deleted the to/multistep-dialog-position branch April 5, 2022 18:25
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.

None yet

4 participants