@stenajs-webui/panels 15.5.3 → 15.5.4

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/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # v15.5.4 (Mon Apr 25 2022)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Add SidebarRailMenu [#442](https://github.com/StenaIT/stenajs-webui/pull/442) ([@lindskogen](https://github.com/lindskogen) [@mattias800](https://github.com/mattias800))
6
+
7
+ #### Authors: 2
8
+
9
+ - Johan Lindskogen ([@lindskogen](https://github.com/lindskogen))
10
+ - Mattias Andersson ([@mattias800](https://github.com/mattias800))
11
+
12
+ ---
13
+
1
14
  # v15.5.3 (Tue Apr 12 2022)
2
15
 
3
16
  #### 🐛 Bug Fix
@@ -1,15 +1,15 @@
1
1
  import * as React from "react";
2
2
  import { ReactNode } from "react";
3
3
  import { SidebarMenuButtonProps } from "./NavBarSideMenuButton";
4
+ export declare type NavBarVariant = "compact" | "standard" | "relaxed";
4
5
  export interface NavBarProps {
5
- variant?: NavBarVariant;
6
6
  className?: string;
7
7
  showMenuButton?: boolean;
8
+ menuButtonVisibility?: "visible" | "hidden";
8
9
  onClickMenuButton?: SidebarMenuButtonProps["onClick"];
9
10
  right?: ReactNode;
10
11
  center?: ReactNode;
11
12
  left?: ReactNode;
12
- height?: number | string;
13
+ variant?: NavBarVariant;
13
14
  }
14
- export declare type NavBarVariant = "light" | "dark";
15
15
  export declare const NavBar: React.FC<NavBarProps>;
@@ -4,6 +4,9 @@ import { Story } from "@storybook/react";
4
4
  declare const _default: {
5
5
  title: string;
6
6
  component: React.FC<NavBarProps>;
7
+ parameters: {
8
+ layout: string;
9
+ };
7
10
  subcomponents: {
8
11
  NavBarButton: React.FC<import("./NavBarButton").NavBarButtonProps>;
9
12
  NavBarMenuButton: React.FC<import("./NavBarPopoverButton").NavBarPopoverButtonProps>;
@@ -11,14 +14,12 @@ declare const _default: {
11
14
  };
12
15
  export default _default;
13
16
  export declare const Demo: Story<Pick<NavBarProps, "variant">>;
14
- export declare const Dark: () => JSX.Element;
15
17
  export declare const NoButtons: () => JSX.Element;
16
- export declare const DarkNoButtons: () => JSX.Element;
17
18
  export declare const NoMenuOrTitle: () => JSX.Element;
18
19
  export declare const TitleNoMenu: () => JSX.Element;
19
20
  export declare const MenuNoTitle: () => JSX.Element;
20
21
  export declare const WithButtonIcons: () => JSX.Element;
21
22
  export declare const CenterContent: () => JSX.Element;
22
- export declare const CenterContentDark: () => JSX.Element;
23
23
  export declare const PopoverButton: () => JSX.Element;
24
24
  export declare const PopoverButtonIcon: () => JSX.Element;
25
+ export declare const DemoWithRail: Story;
@@ -1,8 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { DivProps } from "@stenajs-webui/core";
3
- import { NavBarVariant } from "./NavBar";
4
3
  export interface SidebarMenuButtonProps extends Pick<DivProps, "className"> {
5
- variant?: NavBarVariant;
6
4
  onClick?: (ev: React.MouseEvent<HTMLButtonElement>) => void;
7
5
  }
8
6
  export declare const NavBarSideMenuButton: React.FC<SidebarMenuButtonProps>;
@@ -0,0 +1,2 @@
1
+ import { NavBarVariant } from "./NavBar";
2
+ export declare const getNavbarHeight: (variant: NavBarVariant) => string;
@@ -1,8 +1,12 @@
1
1
  import { BoxProps } from "@stenajs-webui/core";
2
2
  import * as React from "react";
3
3
  import { SidebarMenuCloseButtonProps } from "./SidebarMenuCloseButton";
4
+ import { NavBarVariant } from "../nav-bar/NavBar";
5
+ export declare type SidebarMenuVariant = NavBarVariant;
4
6
  export interface SidebarMenuProps extends BoxProps {
5
7
  onCloseClick?: SidebarMenuCloseButtonProps["onClick"];
6
8
  hideCloseButton?: boolean;
9
+ collapsed?: boolean;
10
+ variant?: SidebarMenuVariant;
7
11
  }
8
12
  export declare const SidebarMenu: React.FC<SidebarMenuProps>;
@@ -1,7 +1,5 @@
1
1
  import * as React from "react";
2
2
  import { ButtonElementProps } from "@stenajs-webui/core";
3
3
  export interface SidebarMenuCloseButtonProps extends ButtonElementProps {
4
- variant?: SidebarMenuCloseButtonVariant;
5
4
  }
6
- export declare type SidebarMenuCloseButtonVariant = "light" | "dark";
7
5
  export declare const SidebarMenuCloseButton: React.FC<SidebarMenuCloseButtonProps>;
@@ -1,8 +1,16 @@
1
- import { ClickableProps } from "@stenajs-webui/core";
1
+ import { ButtonElementProps } from "@stenajs-webui/core";
2
2
  import * as React from "react";
3
+ import { CSSProperties, ReactNode } from "react";
3
4
  import { ButtonContentProps } from "@stenajs-webui/elements";
4
- export interface SidebarMenuLinkProps extends ClickableProps, Pick<ButtonContentProps, "label" | "loading" | "left" | "leftIcon" | "right" | "rightIcon" | "success"> {
5
+ export declare type RenderLinkProps = ButtonElementProps & {
6
+ activeClassName: string;
7
+ };
8
+ export interface SidebarMenuLinkProps extends ButtonElementProps, Pick<ButtonContentProps, "label" | "loading" | "left" | "leftIcon" | "right" | "rightIcon" | "success"> {
9
+ renderLink?: SidebarLinkRenderer;
10
+ width?: CSSProperties["width"];
5
11
  selected?: boolean;
6
12
  indent?: boolean;
7
13
  }
14
+ export declare type SidebarLinkRenderer = (props: RenderLinkProps) => ReactNode;
15
+ export declare const defaultRenderLink: SidebarLinkRenderer;
8
16
  export declare const SidebarMenuLink: React.FC<SidebarMenuLinkProps>;
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import { SidebarMenuVariant } from "../SidebarMenu";
3
+ interface RailMenuProps {
4
+ variant?: SidebarMenuVariant;
5
+ }
6
+ export declare const SidebarRailMenu: React.FC<RailMenuProps>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from "react";
2
+ import { SidebarItem } from "./types";
3
+ export declare const renderItemsExpanded: (items: SidebarItem[], indent?: boolean) => ReactNode[];
4
+ interface RailRendererOptions {
5
+ popupMinWidth: string | number;
6
+ }
7
+ export declare const renderItemsInRail: (items: SidebarItem[], { popupMinWidth }: RailRendererOptions) => ReactNode[];
8
+ export {};
@@ -0,0 +1,19 @@
1
+ import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
2
+ import { SidebarMenuLinkProps } from "../../SidebarMenuLink";
3
+ export interface SidebarHeadingItem {
4
+ type: "heading";
5
+ label: string;
6
+ }
7
+ export interface SidebarSeparatorItem {
8
+ type: "separator";
9
+ }
10
+ export interface SidebarLinkItem extends Omit<SidebarMenuLinkProps, "type"> {
11
+ type: "link";
12
+ }
13
+ export interface SidebarGroupedItem {
14
+ type: "grouped";
15
+ label: string;
16
+ leftIcon?: IconDefinition;
17
+ items: SidebarItem[];
18
+ }
19
+ export declare type SidebarItem = SidebarHeadingItem | SidebarSeparatorItem | SidebarLinkItem | SidebarGroupedItem;
package/dist/index.d.ts CHANGED
@@ -23,6 +23,9 @@ export * from "./components/page-header/PageHeader";
23
23
  export * from "./components/page-header/PageHeaderRow";
24
24
  export * from "./components/page-header/PageHeading";
25
25
  export * from "./components/sidebar-menu/SidebarMenu";
26
+ export * from "./components/sidebar-menu/rail/SidebarRailMenu";
27
+ export * from "./components/sidebar-menu/rail/renderer/RailRenderer";
28
+ export * from "./components/sidebar-menu/rail/renderer/types";
26
29
  export * from "./components/sidebar-menu/SidebarMenuHeading";
27
30
  export * from "./components/sidebar-menu/SidebarMenuLink";
28
31
  export * from "./components/sidebar-menu/SidebarMenuCollapsible";