From 7fb71fb97150d6f1ed0a81b857359ccd1de129d3 Mon Sep 17 00:00:00 2001 From: Mil4n0r Date: Wed, 24 Sep 2025 12:13:34 +0200 Subject: [PATCH 1/2] Reduced dialog z-index to be displayed behind select --- packages/lib/src/styles/variables.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/lib/src/styles/variables.css b/packages/lib/src/styles/variables.css index 2289d9b56..1c4661cda 100644 --- a/packages/lib/src/styles/variables.css +++ b/packages/lib/src/styles/variables.css @@ -12,15 +12,15 @@ --z-header-menu: 210; /* UI components */ - --z-date-input: 300; - --z-dropdown: 310; - --z-textinput: 320; - --z-select: 330; + --z-dialog: 300; + --z-date-input: 310; + --z-dropdown: 320; + --z-textinput: 330; + --z-select: 340; /* Modals and overlays */ --z-spinner-overlay: 400; --z-progressbar-overlay: 410; - --z-dialog: 420; --z-alert: 430; /* Notifications */ From 1028622cd981714c82e058f5890ecdb27f3c1731 Mon Sep 17 00:00:00 2001 From: Mil4n0r Date: Wed, 24 Sep 2025 13:13:09 +0200 Subject: [PATCH 2/2] Added examples for dialog z-index --- packages/lib/src/dialog/Dialog.stories.tsx | 89 +++++++++++++++++++++- 1 file changed, 88 insertions(+), 1 deletion(-) diff --git a/packages/lib/src/dialog/Dialog.stories.tsx b/packages/lib/src/dialog/Dialog.stories.tsx index e521a95df..a13819bee 100644 --- a/packages/lib/src/dialog/Dialog.stories.tsx +++ b/packages/lib/src/dialog/Dialog.stories.tsx @@ -1,5 +1,5 @@ import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport"; -import { userEvent } from "@storybook/test"; +import { screen, userEvent, within } from "@storybook/test"; import ExampleContainer from "../../.storybook/components/ExampleContainer"; import Title from "../../.storybook/components/Title"; import DxcAlert from "../alert/Alert"; @@ -11,6 +11,10 @@ import DxcParagraph from "../paragraph/Paragraph"; import DxcTextInput from "../text-input/TextInput"; import DxcDialog from "./Dialog"; import { Meta, StoryObj } from "@storybook/react"; +import DxcSelect from "../select/Select"; +import DxcDateInput from "../date-input/DateInput"; +import DxcDropdown from "../dropdown/Dropdown"; +import DxcTooltip from "../tooltip/Tooltip"; export default { title: "Dialog", @@ -310,6 +314,57 @@ const ScrollingDialog = () => ( ); +const DialogWithDateInput = () => ( + + + + + +); + +const DialogWithDropdown = () => ( + + + {}} + /> + + +); + +const DialogWithSelect = () => ( + + + + + +); + +const DialogWithTooltip = () => ( + + + + + + + +); + type Story = StoryObj; export const DefaultDialog: Story = { @@ -357,3 +412,35 @@ export const ScrollDialog: Story = { await userEvent.tab(); }, }; + +export const DateInputDialog: Story = { + render: DialogWithDateInput, + play: async () => { + const combobox = await screen.findByRole("combobox"); + await userEvent.click(combobox); + }, +}; + +export const DropdownDialog: Story = { + render: DialogWithDropdown, + play: async () => { + const buttons = await screen.findAllByRole("button"); + buttons[0] && (await userEvent.click(buttons[0])); + }, +}; + +export const SelectDialog: Story = { + render: DialogWithSelect, + play: async () => { + const combobox = await screen.findByRole("combobox"); + await userEvent.click(combobox); + }, +}; + +export const TooltipDialog: Story = { + render: DialogWithTooltip, + play: async () => { + const buttons = await screen.findAllByRole("button"); + buttons[0] && (await userEvent.hover(buttons[0])); + }, +};