@noya-app/noya-designsystem 0.1.89 → 0.1.90
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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +10 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/components/BaseToolbar.tsx +3 -1
- package/src/components/Dialog.tsx +4 -1
- package/src/components/__tests__/BaseToolbar.test.tsx +22 -0
- package/src/components/__tests__/DialogNavigator.test.tsx +13 -0
- package/src/components/workspace/DrawerWorkspaceLayout.tsx +1 -1
- package/src/components/workspace/__tests__/DrawerWorkspaceLayout.test.tsx +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noya-app/noya-designsystem",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.90",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"@dnd-kit/core": "6.3.1",
|
|
30
30
|
"@dnd-kit/sortable": "10.0.0",
|
|
31
31
|
"@floating-ui/react": "^0.27.0",
|
|
32
|
-
"@noya-app/noya-colorpicker": "0.1.
|
|
33
|
-
"@noya-app/noya-utils": "0.1.
|
|
34
|
-
"@noya-app/noya-geometry": "0.1.
|
|
32
|
+
"@noya-app/noya-colorpicker": "0.1.36",
|
|
33
|
+
"@noya-app/noya-utils": "0.1.10",
|
|
34
|
+
"@noya-app/noya-geometry": "0.1.19",
|
|
35
35
|
"@noya-app/noya-icons": "0.1.20",
|
|
36
36
|
"@noya-app/noya-keymap": "0.1.4",
|
|
37
37
|
"@noya-app/noya-tailwind-config": "0.1.10",
|
|
@@ -9,6 +9,7 @@ export interface BaseToolbarProps {
|
|
|
9
9
|
left?: React.ReactNode;
|
|
10
10
|
right?: React.ReactNode;
|
|
11
11
|
logo?: React.ReactNode;
|
|
12
|
+
showLogoDivider?: boolean;
|
|
12
13
|
showDivider?: boolean;
|
|
13
14
|
className?: string;
|
|
14
15
|
innerClassName?: string;
|
|
@@ -63,6 +64,7 @@ export function BaseToolbar({
|
|
|
63
64
|
left,
|
|
64
65
|
right,
|
|
65
66
|
logo,
|
|
67
|
+
showLogoDivider = true,
|
|
66
68
|
showDivider = true,
|
|
67
69
|
className,
|
|
68
70
|
innerClassName,
|
|
@@ -97,7 +99,7 @@ export function BaseToolbar({
|
|
|
97
99
|
{logo && (
|
|
98
100
|
<>
|
|
99
101
|
{logo}
|
|
100
|
-
<DividerVertical />
|
|
102
|
+
{showLogoDivider && <DividerVertical />}
|
|
101
103
|
</>
|
|
102
104
|
)}
|
|
103
105
|
<Spacer.Horizontal size={10} />
|
|
@@ -19,7 +19,10 @@ const StyledBackdrop = forwardRef<
|
|
|
19
19
|
>(({ className, ...props }, ref) => (
|
|
20
20
|
<DialogPrimitive.Backdrop
|
|
21
21
|
ref={ref}
|
|
22
|
-
className={cx(
|
|
22
|
+
className={cx(
|
|
23
|
+
`n-fixed n-inset-0 n-z-[999] n-bg-[rgba(0,0,0,0.5)]`,
|
|
24
|
+
className
|
|
25
|
+
)}
|
|
23
26
|
{...props}
|
|
24
27
|
/>
|
|
25
28
|
));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { afterEach, describe, expect, test } from "bun:test";
|
|
2
|
+
import { cleanup, render } from "@testing-library/react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { BaseToolbar } from "../BaseToolbar";
|
|
5
|
+
|
|
6
|
+
afterEach(cleanup);
|
|
7
|
+
|
|
8
|
+
describe("BaseToolbar", () => {
|
|
9
|
+
test("shows a vertical divider after the logo by default", () => {
|
|
10
|
+
const { container } = render(<BaseToolbar logo={<div>Logo</div>} />);
|
|
11
|
+
|
|
12
|
+
expect(container.querySelector(".n-w-px")).toBeTruthy();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test("can hide the vertical divider after the logo", () => {
|
|
16
|
+
const { container } = render(
|
|
17
|
+
<BaseToolbar logo={<div>Back</div>} showLogoDivider={false} />
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
expect(container.querySelector(".n-w-px")).toBeNull();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -64,6 +64,19 @@ describe("DialogNavigator", () => {
|
|
|
64
64
|
expect(view.getByRole("button", { name: "Close" })).toBeTruthy();
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
+
test("stacks the backdrop above elevated page controls", () => {
|
|
68
|
+
render(<TestDialogNavigator onOpenChange={() => {}} />);
|
|
69
|
+
|
|
70
|
+
const backdrop = Array.from(document.querySelectorAll("div")).find(
|
|
71
|
+
(element) =>
|
|
72
|
+
element.classList.contains("n-bg-[rgba(0,0,0,0.5)]") &&
|
|
73
|
+
element.classList.contains("n-inset-0")
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
expect(backdrop).toBeTruthy();
|
|
77
|
+
expect(backdrop?.classList.contains("n-z-[999]")).toBe(true);
|
|
78
|
+
});
|
|
79
|
+
|
|
67
80
|
test("combines navigation and dialog controls in the header", async () => {
|
|
68
81
|
const onOpenChange = mock(() => {});
|
|
69
82
|
const view = render(<TestDialogNavigator onOpenChange={onOpenChange} />);
|
|
@@ -182,7 +182,7 @@ export const DrawerWorkspaceLayout = memoGeneric(function DrawerWorkspaceLayout<
|
|
|
182
182
|
)}
|
|
183
183
|
|
|
184
184
|
{compactTabItem && (
|
|
185
|
-
<div className="n-absolute n-top-0 n-left-0 n-h-[calc(var(--n-toolbar-height)+1px)] n-w-[calc(var(--n-toolbar-height)+1px)] n-bg-sidebar-background n-border-
|
|
185
|
+
<div className="n-absolute n-top-0 n-left-0 n-h-[calc(var(--n-toolbar-height)+1px)] n-w-[calc(var(--n-toolbar-height)+1px)] n-bg-sidebar-background n-border-b n-border-divider-strong n-z-10 n-flex n-items-center n-justify-center">
|
|
186
186
|
<Button
|
|
187
187
|
aria-label={
|
|
188
188
|
typeof compactTabItem.title === "string"
|
|
@@ -27,7 +27,12 @@ describe("DrawerWorkspaceLayout", () => {
|
|
|
27
27
|
|
|
28
28
|
expect(container.textContent).toBe("Center content");
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
const navigationButton = getByRole("button", { name: "Navigation" });
|
|
31
|
+
const compactTrigger = navigationButton.parentElement;
|
|
32
|
+
expect(compactTrigger?.classList.contains("n-border-b")).toBe(true);
|
|
33
|
+
expect(compactTrigger?.classList.contains("n-border-r")).toBe(false);
|
|
34
|
+
|
|
35
|
+
fireEvent.click(navigationButton);
|
|
31
36
|
|
|
32
37
|
expect(getByText("Sidebar content")).toBeTruthy();
|
|
33
38
|
});
|