Skip to content

Commit

Permalink
- Close button in sidebar menu is now a FlatButton.
Browse files Browse the repository at this point in the history
- Drawer no longer gets blue outline when opening drawer with keyboard.
  • Loading branch information
mattias800 committed Sep 7, 2023
1 parent 94ffaa4 commit 2c98325
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 108 deletions.
4 changes: 4 additions & 0 deletions packages/modal/src/components/drawer/Drawer.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
position: absolute;
transition: transform var(--swui-animation-time-medium) ease-in-out;

&:focus-visible {
outline: unset;
}

&.slideFromLeft,
&.slideFromRight {
transform: translateX(var(--translate-x-outside-screen, 0));
Expand Down
10 changes: 5 additions & 5 deletions packages/panels/src/components/sidebar-menu/SidebarMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import cx from "classnames";
import * as React from "react";
import styles from "./SidebarMenu.module.css";
import {
SidebarMenuCloseButton,
SidebarMenuCloseButtonProps,
} from "./SidebarMenuCloseButton";
SidebarMenuCloseButtonRow,
SidebarMenuCloseButtonRowProps,
} from "./SidebarMenuCloseButtonRow";
import { getNavbarHeight } from "../nav-bar/NavbarHeightStyleUtil";
import { NavBarVariant } from "../nav-bar/NavBar";

export type SidebarMenuVariant = NavBarVariant;

export interface SidebarMenuProps extends BoxProps {
onCloseClick?: SidebarMenuCloseButtonProps["onClick"];
onCloseClick?: SidebarMenuCloseButtonRowProps["onClick"];
hideCloseButton?: boolean;
collapsed?: boolean;
variant?: SidebarMenuVariant;
Expand Down Expand Up @@ -48,7 +48,7 @@ export const SidebarMenu: React.FC<SidebarMenuProps> = ({

{!hideCloseButton && (
<>
<SidebarMenuCloseButton onClick={onCloseClick} />
<SidebarMenuCloseButtonRow onClick={onCloseClick} />
<Space num={1.5} />
</>
)}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.stenaFlag {
height: 32px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import * as React from "react";
import styles from "./SidebarMenuCloseButtonRow.module.css";
import { ButtonElementProps, Row } from "@stenajs-webui/core";
import { FlatButton, StenaFlag, stenaTimes } from "@stenajs-webui/elements";

export interface SidebarMenuCloseButtonRowProps extends ButtonElementProps {}

export const SidebarMenuCloseButtonRow: React.FC<
SidebarMenuCloseButtonRowProps
> = ({ onClick }) => {
return (
<Row justifyContent={"space-between"} alignItems={"center"} flex={1}>
<FlatButton leftIcon={stenaTimes} onClick={onClick} variant={"danger"} />
<StenaFlag className={styles.stenaFlag} />
</Row>
);
};
3 changes: 0 additions & 3 deletions packages/panels/src/components/sidebar-menu/svg/close.svg

This file was deleted.

0 comments on commit 2c98325

Please sign in to comment.