@purpurds/drawer 5.22.0 → 5.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpurds/drawer",
3
- "version": "5.22.0",
3
+ "version": "5.23.0",
4
4
  "license": "AGPL-3.0-only",
5
5
  "main": "./dist/drawer.cjs.js",
6
6
  "types": "./dist/drawer.d.ts",
@@ -17,11 +17,11 @@
17
17
  "@radix-ui/react-dialog": "~1.0.5",
18
18
  "@radix-ui/react-scroll-area": "~1.0.5",
19
19
  "classnames": "~2.5.0",
20
- "@purpurds/button": "5.22.0",
21
- "@purpurds/paragraph": "5.22.0",
22
- "@purpurds/icon": "5.22.0",
23
- "@purpurds/tokens": "5.22.0",
24
- "@purpurds/heading": "5.22.0"
20
+ "@purpurds/button": "5.23.0",
21
+ "@purpurds/heading": "5.23.0",
22
+ "@purpurds/icon": "5.23.0",
23
+ "@purpurds/tokens": "5.23.0",
24
+ "@purpurds/paragraph": "5.23.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@rushstack/eslint-patch": "~1.10.0",
@@ -72,9 +72,33 @@ describe("DrawerContent", () => {
72
72
  );
73
73
  expect(screen.getByTestId(Selectors.DRAWER_CONTENT)).toHaveTextContent("Some drawer-content");
74
74
  });
75
+
76
+ it("should set the z-index", () => {
77
+ render(
78
+ <RadixDialog.Root open={true}>
79
+ <DrawerContent
80
+ data-testid={Selectors.DRAWER_CONTENT}
81
+ backButton
82
+ backButtonText="Back"
83
+ bodyText="bodyText"
84
+ closeButtonText="Close"
85
+ onBackButtonClick={() => {}}
86
+ stickyFooter
87
+ title="Title"
88
+ zIndex={200}
89
+ >
90
+ Some drawer-content
91
+ </DrawerContent>
92
+ </RadixDialog.Root>
93
+ );
94
+
95
+ const dialogOverlayElement = screen.getByTestId(Selectors.DRAWER_CONTENT_OVERLAY);
96
+ expect(dialogOverlayElement.style.zIndex).toBe("200");
97
+ });
75
98
  });
76
99
 
77
100
  const Selectors = {
78
101
  DRAWER_CONTENT: "purpur-drawer-content",
102
+ DRAWER_CONTENT_OVERLAY: "purpur-drawer-content-overlay",
79
103
  BODY_TEXT: "purpur-drawer-content-description",
80
104
  };
@@ -76,7 +76,7 @@ export const DrawerContent = forwardRef(
76
76
  <RadixDialog.Portal>
77
77
  <RadixDialog.Overlay
78
78
  className={cx("purpur-drawer-overlay")}
79
- style={{ zIndex: typeof zIndex === "number" ? zIndex : "auto" }}
79
+ style={zIndex ? { zIndex } : undefined}
80
80
  data-testid={`${dataTestId}-overlay`}
81
81
  >
82
82
  <RadixDialog.Content
@@ -84,7 +84,6 @@ export const DrawerContent = forwardRef(
84
84
  className={classes}
85
85
  data-testid={dataTestId}
86
86
  ref={ref}
87
- style={{ zIndex: typeof zIndex === "number" ? zIndex + 1 : "auto" }}
88
87
  {...props}
89
88
  >
90
89
  <DrawerFrame