canny-ui-react 6.4.0 → 6.6.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.
@@ -1,6 +1,11 @@
1
- import type { NavbarProps, NavbarBrandProps, NavbarNavProps, NavbarItemProps, NavbarActionsProps } from './Navbar.types';
1
+ import type { NavbarProps, NavbarBrandProps, NavbarNavProps, NavbarItemProps, NavbarActionsProps, NavbarToggleProps } from './Navbar.types';
2
2
  export declare const Navbar: import("react").ForwardRefExoticComponent<NavbarProps & import("react").RefAttributes<HTMLElement>>;
3
3
  export declare const NavbarBrand: import("react").ForwardRefExoticComponent<NavbarBrandProps & import("react").RefAttributes<HTMLAnchorElement>>;
4
4
  export declare const NavbarNav: import("react").ForwardRefExoticComponent<NavbarNavProps & import("react").RefAttributes<HTMLElement>>;
5
5
  export declare const NavbarItem: import("react").ForwardRefExoticComponent<NavbarItemProps & import("react").RefAttributes<HTMLAnchorElement>>;
6
6
  export declare const NavbarActions: import("react").ForwardRefExoticComponent<NavbarActionsProps & import("react").RefAttributes<HTMLDivElement>>;
7
+ /**
8
+ * Menu (hamburger) button for a responsive `Sidebar`: shown below 900px, where the
9
+ * sidebar becomes a drawer. Wire it to the sidebar's `mobileOpen`.
10
+ */
11
+ export declare const NavbarToggle: import("react").ForwardRefExoticComponent<NavbarToggleProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1,7 +1,12 @@
1
- import type { AnchorHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
1
+ import type { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
2
2
  import type { SxProp } from '../Layout/sx';
3
3
  export interface NavbarProps extends HTMLAttributes<HTMLElement> {
4
4
  solid?: boolean;
5
+ /**
6
+ * Background (solid, no glass, when raised). `'base'` (default) sits on the page tone; `'raised'` uses the
7
+ * surface of drawers, dialogs and menus (white in light mode).
8
+ */
9
+ surface?: 'base' | 'raised';
5
10
  /**
6
11
  * One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
7
12
  * responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
@@ -24,3 +29,9 @@ export interface NavbarItemProps extends AnchorHTMLAttributes<HTMLAnchorElement>
24
29
  export interface NavbarActionsProps extends HTMLAttributes<HTMLDivElement> {
25
30
  children: ReactNode;
26
31
  }
32
+ export interface NavbarToggleProps extends ButtonHTMLAttributes<HTMLButtonElement> {
33
+ /** Whether the menu it opens is open (sets aria-expanded and the default label). */
34
+ open?: boolean;
35
+ /** The icon; a menu (hamburger) icon by default. */
36
+ children?: ReactNode;
37
+ }
@@ -1,2 +1,2 @@
1
- export { Navbar, NavbarBrand, NavbarNav, NavbarItem, NavbarActions } from './Navbar';
2
- export type { NavbarProps, NavbarBrandProps, NavbarNavProps, NavbarItemProps, NavbarActionsProps, } from './Navbar.types';
1
+ export { Navbar, NavbarBrand, NavbarNav, NavbarItem, NavbarActions, NavbarToggle } from './Navbar';
2
+ export type { NavbarProps, NavbarBrandProps, NavbarNavProps, NavbarItemProps, NavbarActionsProps, NavbarToggleProps, } from './Navbar.types';
@@ -6,6 +6,22 @@ export interface SidebarProps extends HTMLAttributes<HTMLElement> {
6
6
  sticky?: boolean;
7
7
  collapsed?: boolean;
8
8
  responsive?: boolean;
9
+ /**
10
+ * With `responsive`: below 900px the sidebar slides in from the left as a drawer
11
+ * (over a backdrop) while this is true, instead of being hidden. Open it from a
12
+ * menu button such as `NavbarToggle`. Ignored at 900px and wider.
13
+ */
14
+ mobileOpen?: boolean;
15
+ /**
16
+ * Background. `'base'` (default) sits on the page tone; `'raised'` uses the
17
+ * surface of drawers, dialogs and menus (white in light mode).
18
+ */
19
+ surface?: 'base' | 'raised';
20
+ /**
21
+ * Turns on the mobile drawer for a `responsive` sidebar. Called with `false` when
22
+ * the backdrop is clicked or Escape is pressed.
23
+ */
24
+ onMobileOpenChange?: (open: boolean) => void;
9
25
  /**
10
26
  * One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
11
27
  * responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx