canny-ui-react 6.3.3 → 6.5.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.
- package/dist/components/CspNonce/CspNonce.types.d.ts +11 -0
- package/dist/components/CspNonce/CspNonceProvider.d.ts +15 -0
- package/dist/components/CspNonce/index.d.ts +2 -0
- package/dist/components/Navbar/Navbar.d.ts +6 -1
- package/dist/components/Navbar/Navbar.types.d.ts +7 -1
- package/dist/components/Navbar/index.d.ts +2 -2
- package/dist/components/Sidebar/Sidebar.types.d.ts +11 -0
- package/dist/index.cjs +43 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3172 -3084
- package/dist/index.js.map +1 -1
- package/dist/utils/NoncedStyle.d.ts +9 -0
- package/package.json +3 -3
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface CspNonceProviderProps {
|
|
3
|
+
/**
|
|
4
|
+
* The per-request CSP nonce — the same value carried in the response's
|
|
5
|
+
* `Content-Security-Policy` header. Applied to every scoped `<style>` element
|
|
6
|
+
* the library emits. `undefined` renders those elements without a nonce
|
|
7
|
+
* attribute (identical to having no provider).
|
|
8
|
+
*/
|
|
9
|
+
nonce: string | undefined;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CspNonceProviderProps } from './CspNonce.types';
|
|
2
|
+
/**
|
|
3
|
+
* Supplies the page's CSP nonce to every scoped `<style>` element Canny-UI
|
|
4
|
+
* emits: responsive `sx` on `Box` and on `withSx`-based components (e.g.
|
|
5
|
+
* `Divider`), `CannyLoader`'s keyframes, and the styles Radix overlays inject
|
|
6
|
+
* (the `Select` viewport's scrollbar rule and the scroll lock of every
|
|
7
|
+
* overlay). Under a nonce-based `style-src` / `style-src-elem` policy the
|
|
8
|
+
* browser blocks those elements unless they carry the nonce. Mount once near
|
|
9
|
+
* the root, with the nonce from the response's Content-Security-Policy
|
|
10
|
+
* header. Without a provider the elements render exactly as before (no nonce
|
|
11
|
+
* attribute).
|
|
12
|
+
*/
|
|
13
|
+
export declare function CspNonceProvider({ nonce, children }: CspNonceProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
/** The nonce from the nearest `CspNonceProvider`, or `undefined` outside one. */
|
|
15
|
+
export declare function useCspNonce(): string | undefined;
|
|
@@ -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,4 +1,4 @@
|
|
|
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;
|
|
@@ -24,3 +24,9 @@ export interface NavbarItemProps extends AnchorHTMLAttributes<HTMLAnchorElement>
|
|
|
24
24
|
export interface NavbarActionsProps extends HTMLAttributes<HTMLDivElement> {
|
|
25
25
|
children: ReactNode;
|
|
26
26
|
}
|
|
27
|
+
export interface NavbarToggleProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
28
|
+
/** Whether the menu it opens is open (sets aria-expanded and the default label). */
|
|
29
|
+
open?: boolean;
|
|
30
|
+
/** The icon; a menu (hamburger) icon by default. */
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
}
|
|
@@ -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,17 @@ 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
|
+
* Turns on the mobile drawer for a `responsive` sidebar. Called with `false` when
|
|
17
|
+
* the backdrop is clicked or Escape is pressed.
|
|
18
|
+
*/
|
|
19
|
+
onMobileOpenChange?: (open: boolean) => void;
|
|
9
20
|
/**
|
|
10
21
|
* One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
|
|
11
22
|
* responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
|