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

Storybook inconsistency for dialog #4238

Open
2 tasks done
gobarcanin opened this issue Jul 22, 2024 · 1 comment
Open
2 tasks done

Storybook inconsistency for dialog #4238

gobarcanin opened this issue Jul 22, 2024 · 1 comment
Labels
📬 waiting feedback Waiting for assigned user feedback

Comments

@gobarcanin
Copy link

Which UI Kit version is this bug for?

v5.x

Latest version

  • I have tested the latest version

No Hitachi confidential content

  • I'm not including any Hitachi confidential content

Current behavior 😯

When on storybook setting variant "warning" for dialog I'm getting following result

import { useState } from "react";
import {
  HvButton,
  HvDialog,
  HvDialogActions,
  HvDialogContent,
  HvDialogProps,
  HvDialogTitle,
} from "@hitachivantara/uikit-react-core";

export const MainStory = (props: HvDialogProps) => {
  const [open, setOpen] = useState(false);

  return (
    <div>
      <HvButton style={{ width: "120px" }} onClick={() => setOpen(true)}>
        Open Dialog
      </HvButton>
      <HvDialog open={open} onClose={() => setOpen(false)} {...props}>
        <HvDialogTitle variant="warning">Switch model view?</HvDialogTitle>
        <HvDialogContent indentContent>
          Switching to model view will clear all the fields in your
          visualization. You will need to re-select your fields.
        </HvDialogContent>
        <HvDialogActions>
          <HvButton variant="secondaryGhost" onClick={() => setOpen(false)}>
            Apply
          </HvButton>
          <HvButton
            autoFocus
            variant="secondaryGhost"
            onClick={() => setOpen(false)}
          >
            Cancel
          </HvButton>
        </HvDialogActions>
      </HvDialog>
    </div>
  );
};

but it should be used as following

<HvDialog maxWidth="xl" onClose={onClose29618327} open={open29618327} variant="warning">
	<HvDialogTitle />
	<HvDialogContent>
	<HvTypography id="HvTypography_29618341" className={classes.typographyComponent} variant="title1">
		Typography
	</HvTypography>
	</HvDialogContent>
	<HvDialogActions>
		<HvButton id="HvButton_29618346" variant="primary" size="md" radius="none">
			Button
		</HvButton>
		<HvButton id="HvButton_29618343" onClick={onClick29618343} variant="primary" size="md" radius="none">
			Button
		</HvButton>
	</HvDialogActions>
</HvDialog>

Expected behavior 🤔

If you set variant in HvDialogTitle nothing happens, styling is applied only when variant is set in HvDialog

Steps to reproduce 🕹

Pretty much described in current behaviour and expected behaviour

Context 🔦

Style dialog

Your Environment 🌎

Build tool: (e.g. Vite 4, Webpack 5)
Device & OS: (e.g. Windows 11 laptop, iPhone 13 iOS15)
Browser: (e.g. Chrome 112, Safari 15.4)
Other details (e.g. 4K resolution, ...)

@gobarcanin gobarcanin added the ⌛ needs triage Waiting for a review. These issues haven't been looked at yet by a maintainer. label Jul 22, 2024
@MEsteves22
Copy link
Contributor

MEsteves22 commented Jul 22, 2024

Hello @gobarcanin 👋

I'm not sure if I understood the problem but adding variant to HvDialogTitle adds an icon on the left side of the dialog title. Adding this property to HvDialog adds a status bar to the top of the dialog. They are two different properties and do different things.

Is it not working on your side?

On Storybook you are only able to the change the variant for HvDialog using the Storybook controls.

@MEsteves22 MEsteves22 added 📬 waiting feedback Waiting for assigned user feedback and removed ⌛ needs triage Waiting for a review. These issues haven't been looked at yet by a maintainer. labels Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📬 waiting feedback Waiting for assigned user feedback
Projects
None yet
Development

No branches or pull requests

2 participants