mirror of
https://github.com/usememos/memos.git
synced 2026-11-19 10:29:11 +01:00
chore: bump ui lib
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@
|
||||
"@tanstack/react-query-devtools": "^5.100.9",
|
||||
"@usememos/canvas": "26.11.3",
|
||||
"@usememos/editor": "26.11.5",
|
||||
"@usememos/ui": "26.11.22",
|
||||
"@usememos/ui": "26.11.23",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"clsx": "^2.1.1",
|
||||
"copy-to-clipboard": "^4.0.2",
|
||||
|
||||
Generated
+5
-5
@@ -45,8 +45,8 @@ importers:
|
||||
specifier: 26.11.5
|
||||
version: 26.11.5(react-dom@19.2.6(react@19.2.6))(react@19.2.6)
|
||||
'@usememos/ui':
|
||||
specifier: 26.11.22
|
||||
version: 26.11.22(@base-ui/react@1.9.0(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6))(lucide-react@1.34.0(react@19.2.6))(react-dom@19.2.6(react@19.2.6))(react@19.2.6)
|
||||
specifier: 26.11.23
|
||||
version: 26.11.23(@base-ui/react@1.9.0(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6))(lucide-react@1.34.0(react@19.2.6))(react-dom@19.2.6(react@19.2.6))(react@19.2.6)
|
||||
class-variance-authority:
|
||||
specifier: ^0.7.1
|
||||
version: 0.7.1
|
||||
@@ -981,8 +981,8 @@ packages:
|
||||
react-dom:
|
||||
optional: true
|
||||
|
||||
'@usememos/ui@26.11.22':
|
||||
resolution: {integrity: sha512-DumtNXp1zePyBNdL+ecxgN1sGX8eWtMcRMx4aHXxLSuQFBKdwVgcFP7/DTH/2XLN8xapWw0WWhjJaWKZyGt2Pg==}
|
||||
'@usememos/ui@26.11.23':
|
||||
resolution: {integrity: sha512-fC3dyMDAASe407AcTHZ5kXM1U35Y+WvrXWHryQveSyMupaMeun3qUjE5HGPV56fGnYhydqYGApeQ/WvTrAQQVA==}
|
||||
peerDependencies:
|
||||
'@base-ui/react': 1.9.0
|
||||
lucide-react: '>=1.0.0'
|
||||
@@ -2414,7 +2414,7 @@ snapshots:
|
||||
react: 19.2.6
|
||||
react-dom: 19.2.6(react@19.2.6)
|
||||
|
||||
'@usememos/ui@26.11.22(@base-ui/react@1.9.0(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6))(lucide-react@1.34.0(react@19.2.6))(react-dom@19.2.6(react@19.2.6))(react@19.2.6)':
|
||||
'@usememos/ui@26.11.23(@base-ui/react@1.9.0(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6))(lucide-react@1.34.0(react@19.2.6))(react-dom@19.2.6(react@19.2.6))(react@19.2.6)':
|
||||
dependencies:
|
||||
'@base-ui/react': 1.9.0(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)
|
||||
lucide-react: 1.34.0(react@19.2.6)
|
||||
|
||||
@@ -61,12 +61,11 @@ describe("EditorToolbar commit button", () => {
|
||||
expect(tooltip.querySelector(".mu-tooltip-shortcut")).toHaveTextContent("Enter");
|
||||
});
|
||||
|
||||
it("keeps the same button, label and spinner slot while saving", async () => {
|
||||
it("keeps the same button and label while saving, with the spinner before the label", async () => {
|
||||
renderToolbar("A thought");
|
||||
const button = screen.getByRole("button", { name: "editor.save" });
|
||||
const label = button.querySelector(".mu-button-label");
|
||||
const slot = button.querySelector(".mu-button-loading-slot");
|
||||
expect(slot).not.toBeNull();
|
||||
expect(button.firstElementChild).toBe(label);
|
||||
|
||||
act(() => dispatchSaving?.(true));
|
||||
|
||||
@@ -74,24 +73,23 @@ describe("EditorToolbar commit button", () => {
|
||||
expect(button).toHaveAttribute("aria-busy", "true");
|
||||
expect(button).toHaveAttribute("aria-disabled", "true");
|
||||
expect(button).toHaveAccessibleDescription("editor.saving");
|
||||
await waitFor(() => expect(button.querySelector(".mu-spinner")).toBe(slot));
|
||||
await waitFor(() => expect(button.firstElementChild).toHaveClass("mu-spinner"));
|
||||
expect(button.querySelector(".mu-button-label")).toBe(label);
|
||||
expect(label).toHaveTextContent("editor.save");
|
||||
|
||||
act(() => dispatchSaving?.(false));
|
||||
|
||||
expect(screen.getByRole("button", { name: "editor.save" })).toBe(button);
|
||||
expect(button.querySelector(".mu-button-loading-slot")).toBe(slot);
|
||||
expect(button.firstElementChild).toBe(label);
|
||||
expect(button.querySelector(".mu-spinner")).toBeNull();
|
||||
expect(button).not.toHaveAttribute("aria-busy");
|
||||
});
|
||||
|
||||
it("keeps the button, label, slot and keyboard focus when validation changes", () => {
|
||||
it("keeps the button, label and keyboard focus when validation changes", () => {
|
||||
renderToolbar("");
|
||||
const button = screen.getByRole("button", { name: "editor.save" });
|
||||
const label = button.querySelector(".mu-button-label");
|
||||
const slot = button.querySelector(".mu-button-loading-slot");
|
||||
expect(slot).not.toBeNull();
|
||||
expect(button.firstElementChild).toBe(label);
|
||||
expect(button).toHaveAttribute("aria-disabled", "true");
|
||||
expect(button).toHaveAccessibleDescription("editor.validation.content-required");
|
||||
act(() => button.focus());
|
||||
@@ -102,7 +100,7 @@ describe("EditorToolbar commit button", () => {
|
||||
expect(screen.getByRole("button", { name: "editor.save" })).toBe(button);
|
||||
expect(button).not.toHaveAttribute("aria-disabled", "true");
|
||||
expect(button.querySelector(".mu-button-label")).toBe(label);
|
||||
expect(button.querySelector(".mu-button-loading-slot")).toBe(slot);
|
||||
expect(button.firstElementChild).toBe(label);
|
||||
expect(button).toHaveFocus();
|
||||
fireEvent.click(button);
|
||||
expect(onSave).toHaveBeenCalledOnce();
|
||||
@@ -110,7 +108,7 @@ describe("EditorToolbar commit button", () => {
|
||||
act(() => dispatchContent?.(""));
|
||||
expect(screen.getByRole("button", { name: "editor.save" })).toBe(button);
|
||||
expect(button).toHaveAttribute("aria-disabled", "true");
|
||||
expect(button.querySelector(".mu-button-loading-slot")).toBe(slot);
|
||||
expect(button.firstElementChild).toBe(label);
|
||||
expect(button).toHaveFocus();
|
||||
});
|
||||
|
||||
|
||||
@@ -92,8 +92,8 @@ describe("<PasswordSignInForm>", () => {
|
||||
initialize.mockReturnValue(new Promise<void>((resolve) => (finishInitialize = resolve)));
|
||||
render(<PasswordSignInForm redirectPath="/memos/example" />);
|
||||
const button = screen.getByRole("button", { name: "common.sign-in" });
|
||||
const slot = button.querySelector(".mu-button-loading-slot");
|
||||
expect(slot).not.toBeNull();
|
||||
const label = button.querySelector(".mu-button-label");
|
||||
expect(button.firstElementChild).toBe(label);
|
||||
act(() => button.focus());
|
||||
|
||||
fill();
|
||||
@@ -105,7 +105,7 @@ describe("<PasswordSignInForm>", () => {
|
||||
expect(button).toHaveAttribute("aria-disabled", "true");
|
||||
expect(screen.getByLabelText("common.username")).toHaveAttribute("readonly");
|
||||
expect(screen.getByLabelText("common.password")).toHaveAttribute("readonly");
|
||||
await waitFor(() => expect(button.querySelector(".mu-spinner")).toBe(slot));
|
||||
await waitFor(() => expect(button.firstElementChild).toHaveClass("mu-spinner"));
|
||||
expect(button).toHaveTextContent("common.sign-in");
|
||||
expect(button).toHaveFocus();
|
||||
|
||||
@@ -122,7 +122,7 @@ describe("<PasswordSignInForm>", () => {
|
||||
signIn.mockRejectedValueOnce(new ConnectError("offline", Code.Unavailable));
|
||||
render(<PasswordSignInForm />);
|
||||
const button = screen.getByRole("button", { name: "common.sign-in" });
|
||||
const slot = button.querySelector(".mu-button-loading-slot");
|
||||
const label = button.querySelector(".mu-button-label");
|
||||
|
||||
fill();
|
||||
|
||||
@@ -130,7 +130,7 @@ describe("<PasswordSignInForm>", () => {
|
||||
expect(screen.getByRole("button", { name: "common.sign-in" })).toBe(button);
|
||||
expect(button).not.toHaveAttribute("aria-busy");
|
||||
expect(button).not.toHaveAttribute("aria-description");
|
||||
expect(button.querySelector(".mu-button-loading-slot")).toBe(slot);
|
||||
expect(button.firstElementChild).toBe(label);
|
||||
expect(screen.getByLabelText("common.password")).not.toHaveAttribute("readonly");
|
||||
|
||||
signIn.mockResolvedValueOnce({});
|
||||
|
||||
@@ -183,8 +183,8 @@ describe("automatic SSO auth pages", () => {
|
||||
renderPage("/auth", <IdentityProviderButtons identityProviderList={[provider, otherProvider]} />);
|
||||
const button = screen.getByRole("button", { name: "auth.continue-with: Company SSO" });
|
||||
const otherButton = screen.getByRole("button", { name: "auth.continue-with: Other SSO" });
|
||||
const slot = button.querySelector(".mu-button-loading-slot");
|
||||
expect(slot).not.toBeNull();
|
||||
const label = button.querySelector(".mu-button-label");
|
||||
expect(button.firstElementChild).toBe(label);
|
||||
act(() => button.focus());
|
||||
fireEvent.click(button);
|
||||
fireEvent.click(button);
|
||||
@@ -196,7 +196,7 @@ describe("automatic SSO auth pages", () => {
|
||||
expect(otherButton).toBeDisabled();
|
||||
fireEvent.click(otherButton);
|
||||
expect(signInWithSSO).toHaveBeenCalledOnce();
|
||||
await waitFor(() => expect(button.querySelector(".mu-spinner")).toBe(slot));
|
||||
await waitFor(() => expect(button.firstElementChild).toHaveClass("mu-spinner"));
|
||||
expect(button).toHaveTextContent("auth.continue-with: Company SSO");
|
||||
expect(button).toHaveFocus();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user