blue-react 11.3.2 → 13.0.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/README.md +56 -64
- package/dist/{components/A.d.ts → A.d.ts} +1 -1
- package/dist/Accordion.d.ts +3 -0
- package/dist/AccordionItem.d.ts +8 -0
- package/dist/{components/ActionMenu.d.ts → ActionMenu.d.ts} +1 -1
- package/dist/{components/Actions.d.ts → Actions.d.ts} +2 -2
- package/dist/{components/Button.d.ts → Button.d.ts} +1 -1
- package/dist/{components/Chevron.d.ts → Chevron.d.ts} +2 -2
- package/dist/{components/FieldGroup.d.ts → FieldGroup.d.ts} +1 -1
- package/dist/{components/HashRouter.d.ts → HashRouter.d.ts} +2 -2
- package/dist/{components/Header.d.ts → Header.d.ts} +2 -2
- package/dist/{components/HeaderTitle.d.ts → HeaderTitle.d.ts} +2 -2
- package/dist/{components/IconMenuItem.d.ts → IconMenuItem.d.ts} +2 -1
- package/dist/{components/Intro.d.ts → Intro.d.ts} +2 -1
- package/dist/Layout.d.ts +26 -0
- package/dist/LayoutSplitter.d.ts +37 -0
- package/dist/{components/LegacyMenuItem.d.ts → LegacyMenuItem.d.ts} +1 -1
- package/dist/{components/MenuItem.d.ts → MenuItem.d.ts} +1 -1
- package/dist/{components/Modal.d.ts → Modal.d.ts} +2 -2
- package/dist/{components/ModalProvider.d.ts → ModalProvider.d.ts} +2 -2
- package/dist/{components/Outside.d.ts → Outside.d.ts} +2 -2
- package/dist/{components/Search.d.ts → Search.d.ts} +1 -1
- package/dist/{components/SidebarMenu.d.ts → SidebarMenu.d.ts} +2 -2
- package/dist/{components/SimpleLayout.d.ts → SimpleLayout.d.ts} +1 -1
- package/dist/{components/SlimContainer.d.ts → SlimContainer.d.ts} +2 -2
- package/dist/{components/Status.d.ts → Status.d.ts} +2 -2
- package/dist/{components/StatusProvider.d.ts → StatusProvider.d.ts} +2 -2
- package/dist/{components/Tab.d.ts → Tab.d.ts} +1 -1
- package/dist/{components/Tabs.d.ts → Tabs.d.ts} +1 -1
- package/dist/{components/ToastProvider.d.ts → ToastProvider.d.ts} +2 -2
- package/dist/components/Accordion.js +21 -0
- package/dist/components/AccordionItem.js +34 -0
- package/dist/components/Layout.js +44 -17
- package/dist/components/LayoutSplitter.js +79 -0
- package/dist/components/shared.js +1 -0
- package/index.d.ts +10 -7
- package/index.js +3 -0
- package/package.json +53 -77
- package/dist/components/Layout.d.ts +0 -18
- package/dist/style.scss +0 -6
- /package/dist/{components/Utilities.d.ts → Utilities.d.ts} +0 -0
- /package/dist/{components/shared.d.ts → shared.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,85 +1,77 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/bruegmann/blue-react/master/public/blue-readme-cover.png" alt="React component library based on Bootstrap">
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
1
|
# Blue React
|
|
6
2
|
|
|
7
3
|
[](https://www.npmjs.com/package/blue-react)
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
use Blue React.
|
|
5
|
+
## Use Blue React
|
|
11
6
|
|
|
12
|
-
|
|
7
|
+
### Create new project with [Vite](https://vitejs.dev/)
|
|
13
8
|
|
|
14
|
-
|
|
9
|
+
To quickly getting started, you can use the [template with Vite, React, TypeScript and Blue React](https://github.com/bruegmann/vite-template-blue-react).
|
|
10
|
+
You can use degit to create a new project with this command:
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- labelClassName
|
|
20
|
-
- caretClassName
|
|
21
|
-
- caretStyle
|
|
22
|
-
- isHome
|
|
23
|
-
- dropdownClassName
|
|
24
|
-
- dropdownStyle
|
|
25
|
-
- showDropdown
|
|
26
|
-
- onShowDropdown
|
|
27
|
-
- supportOutside
|
|
28
|
-
- outsideIgnoreClasses
|
|
29
|
-
- Renamed
|
|
30
|
-
- iconForActive -> iconForCurrent
|
|
31
|
-
- isActive -> current
|
|
32
|
-
- highlighted -> active
|
|
33
|
-
- Changed behviour. Menu item no longer has built in styling if `draggable`. But since Menu item extends HTML Button or A element, props `draggable`, `onDragStart` etc. should still work.
|
|
34
|
-
- Added
|
|
35
|
-
- sm
|
|
36
|
-
- lg
|
|
37
|
-
- iconBefore
|
|
38
|
-
- iconAfter
|
|
39
|
-
- labelHidden
|
|
40
|
-
- busy
|
|
41
|
-
- success
|
|
42
|
-
- defaultDisplay
|
|
43
|
-
- buttonContent
|
|
44
|
-
- as
|
|
12
|
+
```
|
|
13
|
+
npx degit bruegmann/vite-template-blue-react name-of-my-app
|
|
14
|
+
```
|
|
45
15
|
|
|
46
|
-
|
|
16
|
+
### Install to existing project
|
|
47
17
|
|
|
48
|
-
|
|
18
|
+
```
|
|
19
|
+
npm i blue-react
|
|
20
|
+
```
|
|
49
21
|
|
|
50
|
-
-
|
|
51
|
-
- Page
|
|
52
|
-
- SidebarToggler
|
|
22
|
+
`blue-react` has `blue-web` and `bootstrap` as dependencies, so these will be installed automatically.
|
|
53
23
|
|
|
54
|
-
##
|
|
24
|
+
## Breaking changes between v11 and v12
|
|
55
25
|
|
|
56
|
-
|
|
57
|
-
developing, just and install everything with `npm i` and run:
|
|
26
|
+
### Changes in Layout component
|
|
58
27
|
|
|
59
|
-
|
|
60
|
-
npm start
|
|
61
|
-
```
|
|
28
|
+
`children` doesn't get wrapped around a `div.blue-layout-body` anymore. Put your page's content into the `page` slot instead:
|
|
62
29
|
|
|
63
|
-
|
|
30
|
+
```diff
|
|
31
|
+
- <Layout><h1>Hello World</h1></Layout>
|
|
32
|
+
+ <Layout page={<h1>Hello World</h1>} />
|
|
33
|
+
```
|
|
64
34
|
|
|
65
|
-
This
|
|
66
|
-
By running
|
|
35
|
+
This lets you place other elements, such as the new `LayoutSplitter` component, in the layout's main area through `children`.
|
|
67
36
|
|
|
68
|
-
|
|
69
|
-
npm publish
|
|
70
|
-
```
|
|
37
|
+
## Breaking changes between v10 and v11
|
|
71
38
|
|
|
72
|
-
|
|
73
|
-
the NPM package will be released.
|
|
39
|
+
### Fundamental changes in `MenuItem`
|
|
74
40
|
|
|
75
|
-
|
|
41
|
+
- Removed props
|
|
42
|
+
- onClickAttached
|
|
43
|
+
- iconClassName
|
|
44
|
+
- labelClassName
|
|
45
|
+
- caretClassName
|
|
46
|
+
- caretStyle
|
|
47
|
+
- isHome
|
|
48
|
+
- dropdownClassName
|
|
49
|
+
- dropdownStyle
|
|
50
|
+
- showDropdown
|
|
51
|
+
- onShowDropdown
|
|
52
|
+
- supportOutside
|
|
53
|
+
- outsideIgnoreClasses
|
|
54
|
+
- Renamed
|
|
55
|
+
- iconForActive -> iconForCurrent
|
|
56
|
+
- isActive -> current
|
|
57
|
+
- highlighted -> active
|
|
58
|
+
- Changed behviour. Menu item no longer has built in styling if `draggable`. But since Menu item extends HTML Button or A element, props `draggable`, `onDragStart` etc. should still work.
|
|
59
|
+
- Added
|
|
60
|
+
- sm
|
|
61
|
+
- lg
|
|
62
|
+
- iconBefore
|
|
63
|
+
- iconAfter
|
|
64
|
+
- labelHidden
|
|
65
|
+
- busy
|
|
66
|
+
- success
|
|
67
|
+
- defaultDisplay
|
|
68
|
+
- buttonContent
|
|
69
|
+
- as
|
|
76
70
|
|
|
77
|
-
|
|
78
|
-
npm run deploy
|
|
79
|
-
```
|
|
71
|
+
The previous Menu Item with the older API is still available as `LegacyMenuItem`, but will be removed in a future release. Because of styling changes in Blue Web, it might not behave the same.
|
|
80
72
|
|
|
81
|
-
|
|
73
|
+
### Removed deprecated components
|
|
82
74
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
- Body
|
|
76
|
+
- Page
|
|
77
|
+
- SidebarToggler
|
|
@@ -6,4 +6,4 @@ export interface AProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
6
6
|
* `A` allows all props of the `<a>` element.\
|
|
7
7
|
* `<A href="https://example.com" target="_blank">Example</A>` ➡️ `<a href="https://example.com" target="_blank" rel="noreferrer">Example</a>`
|
|
8
8
|
*/
|
|
9
|
-
export default function A({ children, rel, ...rest }: AProps):
|
|
9
|
+
export default function A({ children, rel, ...rest }: AProps): React.JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
|
+
export type AccordionItemProps = {
|
|
3
|
+
header?: ReactNode;
|
|
4
|
+
headerClassName?: string;
|
|
5
|
+
headerButtonClassName?: string;
|
|
6
|
+
bodyClassName?: string;
|
|
7
|
+
} & ComponentProps<"details">;
|
|
8
|
+
export default function AccordionItem({ header, headerClassName, headerButtonClassName, bodyClassName, className, children, ...props }: AccordionItemProps): import("react").JSX.Element;
|
|
@@ -23,4 +23,4 @@ export interface ActionMenuProps {
|
|
|
23
23
|
* @deprecated Use the new `Actions` instead, which is more flexible.
|
|
24
24
|
* The Action Menu on the top right of a page. You can place Actions here which are in context of the current page.
|
|
25
25
|
*/
|
|
26
|
-
export default function ActionMenu(props: ActionMenuProps):
|
|
26
|
+
export default function ActionMenu(props: ActionMenuProps): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode } from "react";
|
|
1
|
+
import React, { CSSProperties, ReactNode } from "react";
|
|
2
2
|
export interface ActionsProps {
|
|
3
3
|
children?: ReactNode;
|
|
4
4
|
className?: string;
|
|
@@ -13,4 +13,4 @@ export interface ActionsProps {
|
|
|
13
13
|
* Otherwise they will be visible in the dropdown menu. JavaScript detects if space is changing and rearranges.
|
|
14
14
|
* IMPORTANT: As of right now, children you pass will be rendered twice. Once in the toolbar and once in the dropdown.
|
|
15
15
|
*/
|
|
16
|
-
export default function Actions({ children, className, menuClassName, collapseClassName, collapseStyle, collapseMenuClassName, collapseMenuStyle }: ActionsProps):
|
|
16
|
+
export default function Actions({ children, className, menuClassName, collapseClassName, collapseStyle, collapseMenuClassName, collapseMenuStyle }: ActionsProps): React.JSX.Element;
|
|
@@ -28,4 +28,4 @@ export type ButtonProps = ComponentProps<"a"> & ComponentProps<"button"> & {
|
|
|
28
28
|
*/
|
|
29
29
|
exact?: boolean;
|
|
30
30
|
};
|
|
31
|
-
export default function Button({ elementType, className, type, variant, color, sm, lg, iconBefore, iconAfter, label, labelHidden, busy: busyProp, success: successProp, active, square, ...props }: ButtonProps): import("react
|
|
31
|
+
export default function Button({ elementType, className, type, variant, color, sm, lg, iconBefore, iconAfter, label, labelHidden, busy: busyProp, success: successProp, active, square, ...props }: ButtonProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties } from "react";
|
|
1
|
+
import React, { CSSProperties } from "react";
|
|
2
2
|
export interface ChevronProps {
|
|
3
3
|
/**
|
|
4
4
|
* Indicates if open or not.
|
|
@@ -14,4 +14,4 @@ export interface ChevronProps {
|
|
|
14
14
|
/**
|
|
15
15
|
* Chevron icon component with open state.
|
|
16
16
|
*/
|
|
17
|
-
export default function Chevron({ open, mirrored, className, style }: ChevronProps):
|
|
17
|
+
export default function Chevron({ open, mirrored, className, style }: ChevronProps): React.JSX.Element;
|
|
@@ -7,4 +7,4 @@ export type FieldGroupProps = ComponentProps<"details"> & {
|
|
|
7
7
|
heading?: number;
|
|
8
8
|
pageHeader?: boolean;
|
|
9
9
|
};
|
|
10
|
-
export default function FieldGroup({ className, children, open, header, isExpanded, headerClassName, id, heading, pageHeader, ...rest }: FieldGroupProps): import("react
|
|
10
|
+
export default function FieldGroup({ className, children, open, header, isExpanded, headerClassName, id, heading, pageHeader, ...rest }: FieldGroupProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ReactNode } from "react";
|
|
1
|
+
import React, { Component, ReactNode } from "react";
|
|
2
2
|
declare global {
|
|
3
3
|
interface Window {
|
|
4
4
|
blueHashRouterRef: any;
|
|
@@ -72,5 +72,5 @@ export default class HashRouter extends Component<HashRouterProps, HashRouterSta
|
|
|
72
72
|
addEventListener(param1: any, param2: any, param3: any, listenerId?: string): void;
|
|
73
73
|
removeEventListener(type: string, listenerId: string): void;
|
|
74
74
|
removeDuplicatedEventListeners(): void;
|
|
75
|
-
render():
|
|
75
|
+
render(): React.JSX.Element;
|
|
76
76
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
export interface HeaderProps {
|
|
3
3
|
children?: ReactNode;
|
|
4
4
|
className?: string;
|
|
@@ -6,4 +6,4 @@ export interface HeaderProps {
|
|
|
6
6
|
/**
|
|
7
7
|
* The top of a page.
|
|
8
8
|
*/
|
|
9
|
-
export default function Header({ children, className }: HeaderProps):
|
|
9
|
+
export default function Header({ children, className }: HeaderProps): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
export interface HeaderTitleProps {
|
|
3
3
|
/**
|
|
4
4
|
* Can be an image. Will be placed inside of the `src` attribute.
|
|
@@ -37,4 +37,4 @@ export interface HeaderTitleProps {
|
|
|
37
37
|
* The title area at the header bar.
|
|
38
38
|
* Depending on its content, the document's title will be set aswell (what will be shown in the browser title bar).
|
|
39
39
|
*/
|
|
40
|
-
export default function HeaderTitle({ logo, logoAlt, appTitle, children, className, sidebar, elementType, to, href, breadcrumb }: HeaderTitleProps):
|
|
40
|
+
export default function HeaderTitle({ logo, logoAlt, appTitle, children, className, sidebar, elementType, to, href, breadcrumb }: HeaderTitleProps): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { LegacyMenuItemProps } from "./LegacyMenuItem";
|
|
2
3
|
export interface IconMenuItemProps extends LegacyMenuItemProps {
|
|
3
4
|
outerClass?: string;
|
|
@@ -16,4 +17,4 @@ export interface IconMenuItemProps extends LegacyMenuItemProps {
|
|
|
16
17
|
* Variant of `MenuItem` to primarily display an icon without a label.
|
|
17
18
|
* The label prop will be displayed as a tooltip.
|
|
18
19
|
*/
|
|
19
|
-
export default function IconMenuItem({ label, outerClass, tooltipClass, horizontalOnOpenSidebar, className, ...props }: IconMenuItemProps):
|
|
20
|
+
export default function IconMenuItem({ label, outerClass, tooltipClass, horizontalOnOpenSidebar, className, ...props }: IconMenuItemProps): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
export interface IntroProps {
|
|
2
3
|
/**
|
|
3
4
|
* Can be an image. Will be placed inside of the `src` attribute.
|
|
@@ -19,4 +20,4 @@ export interface IntroProps {
|
|
|
19
20
|
/**
|
|
20
21
|
* Can be used for a sign-in page.
|
|
21
22
|
*/
|
|
22
|
-
export default function Intro({ logo, logoMaxWidth, title, children }: IntroProps):
|
|
23
|
+
export default function Intro({ logo, logoMaxWidth, title, children }: IntroProps): React.JSX.Element;
|
package/dist/Layout.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { ComponentProps, ReactNode, RefObject } from "react";
|
|
2
|
+
export type LayoutProps = {
|
|
3
|
+
header?: React.ReactNode;
|
|
4
|
+
side?: React.ReactNode;
|
|
5
|
+
noPageBorder?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* If you don't use `LayoutSplitter`, put page's body content in here.
|
|
8
|
+
*/
|
|
9
|
+
page?: React.ReactNode;
|
|
10
|
+
drawerTitle?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* For SSR you can pass server's country code to solve hydration problems.
|
|
13
|
+
*/
|
|
14
|
+
countryCode?: string;
|
|
15
|
+
/**
|
|
16
|
+
* If set, an event listener will be added to the Blue Web Layout element.
|
|
17
|
+
* This callback function helps you get the current state of the inspector. To control the
|
|
18
|
+
* inspector, use the `toggleInspector`, `openInspector`, `closeInspector` by Blue Web.
|
|
19
|
+
*/
|
|
20
|
+
onInspectorChange?: (open: boolean) => void;
|
|
21
|
+
ref?: RefObject<HTMLDivElement | null>;
|
|
22
|
+
} & ComponentProps<"div">;
|
|
23
|
+
/**
|
|
24
|
+
* A layout with header, side and main content area. Side is collapsible.
|
|
25
|
+
*/
|
|
26
|
+
export default function Layout({ children, className, header, side, noPageBorder, page, drawerTitle, countryCode, onInspectorChange, ref, ...props }: LayoutProps): React.JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import "@spectrum-web-components/split-view/sp-split-view.js";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
declare module "react" {
|
|
4
|
+
namespace JSX {
|
|
5
|
+
interface IntrinsicElements {
|
|
6
|
+
"sp-split-view": React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
|
|
7
|
+
vertical?: boolean;
|
|
8
|
+
resizable?: boolean;
|
|
9
|
+
collapsible?: boolean;
|
|
10
|
+
label?: string;
|
|
11
|
+
"primary-size"?: string;
|
|
12
|
+
"primary-min"?: string;
|
|
13
|
+
"primary-max"?: string;
|
|
14
|
+
"secondary-min"?: string;
|
|
15
|
+
"secondary-max"?: string;
|
|
16
|
+
"splitter-pos"?: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export type LayoutSplitterProps = Omit<ComponentProps<"sp-split-view">, "children"> & {
|
|
22
|
+
inspectorId?: string;
|
|
23
|
+
start?: ReactNode;
|
|
24
|
+
end?: ReactNode;
|
|
25
|
+
drawerTitle?: ReactNode;
|
|
26
|
+
noPageBorder?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* For SSR you can pass server's country code to solve hydration problems.
|
|
29
|
+
*/
|
|
30
|
+
countryCode?: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Might require React 19 or higher!
|
|
34
|
+
* Allows to create a split view between the layout's main content and an inspector next to it.
|
|
35
|
+
* Doesn't support SSR out of the box.
|
|
36
|
+
*/
|
|
37
|
+
export default function LayoutSplitter({ inspectorId, start, end, drawerTitle, noPageBorder, countryCode, className, ...props }: LayoutSplitterProps): import("react").JSX.Element;
|
|
@@ -147,4 +147,4 @@ export interface LegacyMenuItemProps {
|
|
|
147
147
|
* @deprecated
|
|
148
148
|
* Link, button or custom component for Sidebar, Actions or ActionMenu
|
|
149
149
|
*/
|
|
150
|
-
export default function LegacyMenuItem(props: LegacyMenuItemProps):
|
|
150
|
+
export default function LegacyMenuItem(props: LegacyMenuItemProps): React.JSX.Element;
|
|
@@ -10,4 +10,4 @@ export type MenuItemProps = ButtonProps & {
|
|
|
10
10
|
iconForCurrent?: ReactNode;
|
|
11
11
|
as?: "collapse" | "collapse-group" | "popover-group";
|
|
12
12
|
};
|
|
13
|
-
export default function MenuItem({ as, ...props }: MenuItemProps): import("react
|
|
13
|
+
export default function MenuItem({ as, ...props }: MenuItemProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
import { ModalType } from "./shared";
|
|
3
3
|
export interface ModalProps {
|
|
4
4
|
modalContent?: string;
|
|
@@ -27,4 +27,4 @@ export interface ModalProps {
|
|
|
27
27
|
*
|
|
28
28
|
* For easy use, you should use the hook `useModal` together with `ModalProvider`. See the example there.
|
|
29
29
|
*/
|
|
30
|
-
export default function Modal({ modalContent, modalTitle, modalIcon, unSetModalContent, onSubmit, defaultInput, type, inputType, switchPrimaryBtn, acceptBtnText, cancelBtnText }: ModalProps):
|
|
30
|
+
export default function Modal({ modalContent, modalTitle, modalIcon, unSetModalContent, onSubmit, defaultInput, type, inputType, switchPrimaryBtn, acceptBtnText, cancelBtnText }: ModalProps): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
interface ModelAlertOptions {
|
|
3
3
|
title?: string;
|
|
4
4
|
icon?: ReactNode;
|
|
@@ -12,7 +12,7 @@ interface ModelAskOptions extends ModelAlertOptions {
|
|
|
12
12
|
export interface ModalProviderProps {
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
}
|
|
15
|
-
declare const ModalProvider: ({ children, ...rest }: ModalProviderProps) =>
|
|
15
|
+
declare const ModalProvider: ({ children, ...rest }: ModalProviderProps) => React.JSX.Element;
|
|
16
16
|
declare const useModal: () => {
|
|
17
17
|
ask: (text: string, options?: ModelAskOptions) => Promise<string | boolean>;
|
|
18
18
|
tell: (text: string, options?: ModelAlertOptions) => Promise<boolean>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties, MouseEventHandler, MutableRefObject, RefObject } from "react";
|
|
1
|
+
import React, { CSSProperties, MouseEventHandler, MutableRefObject, RefObject } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* Hook that alerts clicks outside of the passed ref
|
|
4
4
|
*/
|
|
@@ -14,4 +14,4 @@ export interface OutsideProps {
|
|
|
14
14
|
/**
|
|
15
15
|
* Component that fires an event if you click outside of it
|
|
16
16
|
*/
|
|
17
|
-
export default function Outside({ children, className, onClickOutside, onClick, style, wrapperRef }: OutsideProps):
|
|
17
|
+
export default function Outside({ children, className, onClickOutside, onClick, style, wrapperRef }: OutsideProps): React.JSX.Element;
|
|
@@ -43,4 +43,4 @@ export interface SearchProps {
|
|
|
43
43
|
/**
|
|
44
44
|
* A search bar that can be placed to the sidebar or on a page.
|
|
45
45
|
*/
|
|
46
|
-
export default function Search(props: SearchProps):
|
|
46
|
+
export default function Search(props: SearchProps): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode } from "react";
|
|
1
|
+
import React, { CSSProperties, ReactNode } from "react";
|
|
2
2
|
export interface SidebarMenuProps {
|
|
3
3
|
/**
|
|
4
4
|
* Extends the class name by the sidebar.
|
|
@@ -29,4 +29,4 @@ export interface SidebarMenuProps {
|
|
|
29
29
|
/**
|
|
30
30
|
* Sidebar for the `Layout` component.
|
|
31
31
|
*/
|
|
32
|
-
export default function SidebarMenu(props: SidebarMenuProps):
|
|
32
|
+
export default function SidebarMenu(props: SidebarMenuProps): React.JSX.Element;
|
|
@@ -9,4 +9,4 @@ export interface SimpleLayoutProps {
|
|
|
9
9
|
/**
|
|
10
10
|
* A simple layout with header and main content area.
|
|
11
11
|
*/
|
|
12
|
-
export default function SimpleLayout({ children, className, style, header, noPageBorder }: SimpleLayoutProps):
|
|
12
|
+
export default function SimpleLayout({ children, className, style, header, noPageBorder }: SimpleLayoutProps): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
export interface SlimContainerProps {
|
|
3
3
|
children?: ReactNode;
|
|
4
4
|
className?: string;
|
|
@@ -7,4 +7,4 @@ export interface SlimContainerProps {
|
|
|
7
7
|
/**
|
|
8
8
|
* Shortcut for a combination using Bootstrap's Grid System to create a slim responsive container.
|
|
9
9
|
*/
|
|
10
|
-
export default function SlimContainer({ children, className, innerClassName }: SlimContainerProps):
|
|
10
|
+
export default function SlimContainer({ children, className, innerClassName }: SlimContainerProps): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
import { StatusAlert, StatusType } from "./shared";
|
|
3
3
|
export interface StatusProps {
|
|
4
4
|
alert?: StatusAlert;
|
|
@@ -9,4 +9,4 @@ export interface StatusProps {
|
|
|
9
9
|
dangerIcon?: ReactNode;
|
|
10
10
|
status?: StatusType;
|
|
11
11
|
}
|
|
12
|
-
export default function Status({ alert, onUnsetAlert, successIcon, infoIcon, warningIcon, dangerIcon, status }: StatusProps):
|
|
12
|
+
export default function Status({ alert, onUnsetAlert, successIcon, infoIcon, warningIcon, dangerIcon, status }: StatusProps): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
import { StatusAlert, StatusType } from "./shared";
|
|
3
3
|
export interface StatusProviderProps {
|
|
4
4
|
children?: ReactNode;
|
|
@@ -7,7 +7,7 @@ export interface StatusProviderProps {
|
|
|
7
7
|
warningIcon?: ReactNode;
|
|
8
8
|
dangerIcon?: ReactNode;
|
|
9
9
|
}
|
|
10
|
-
declare const StatusProvider: ({ children, successIcon, infoIcon, warningIcon, dangerIcon, ...rest }: StatusProviderProps) =>
|
|
10
|
+
declare const StatusProvider: ({ children, successIcon, infoIcon, warningIcon, dangerIcon, ...rest }: StatusProviderProps) => React.JSX.Element;
|
|
11
11
|
declare const useStatus: () => {
|
|
12
12
|
setAlert: (alert: StatusAlert | null) => void;
|
|
13
13
|
setStatus: (status: StatusType) => void;
|
|
@@ -9,4 +9,4 @@ export interface TabProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
9
9
|
/**
|
|
10
10
|
* Always use together with `Tabs`.
|
|
11
11
|
*/
|
|
12
|
-
export default function Tab({ label, children, className, contentClassName, active, ...rest }: TabProps): import("react
|
|
12
|
+
export default function Tab({ label, children, className, contentClassName, active, ...rest }: TabProps): import("react").JSX.Element;
|
|
@@ -13,4 +13,4 @@ export interface TabsProps {
|
|
|
13
13
|
* Implementation of Blue Web Tabs. Allows to use tabs without JavaScript.
|
|
14
14
|
* Use together with `Tab`.
|
|
15
15
|
*/
|
|
16
|
-
export default function Tabs({ children, className, underline }: TabsProps): import("react
|
|
16
|
+
export default function Tabs({ children, className, underline }: TabsProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
export interface ToastProviderProps {
|
|
3
3
|
children?: ReactNode;
|
|
4
4
|
successIcon?: ReactNode;
|
|
@@ -15,7 +15,7 @@ export interface ToastItem {
|
|
|
15
15
|
/**
|
|
16
16
|
* Push notifications to your visitors using Bootstrap's toast component.
|
|
17
17
|
*/
|
|
18
|
-
export declare function ToastProvider({ children, successIcon, infoIcon, warningIcon, dangerIcon }: ToastProviderProps):
|
|
18
|
+
export declare function ToastProvider({ children, successIcon, infoIcon, warningIcon, dangerIcon }: ToastProviderProps): React.JSX.Element;
|
|
19
19
|
export declare const useToast: () => {
|
|
20
20
|
addToast: (toastItem: ToastItem) => void;
|
|
21
21
|
clearToasts: () => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["className", "children"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
|
+
import clsx from "clsx";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
export default function Accordion(_ref) {
|
|
13
|
+
var className = _ref.className,
|
|
14
|
+
children = _ref.children,
|
|
15
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
17
|
+
className: clsx("blue-accordion accordion", className)
|
|
18
|
+
}, props), {}, {
|
|
19
|
+
children: children
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["header", "headerClassName", "headerButtonClassName", "bodyClassName", "className", "children"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
|
+
import clsx from "clsx";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
export default function AccordionItem(_ref) {
|
|
13
|
+
var header = _ref.header,
|
|
14
|
+
headerClassName = _ref.headerClassName,
|
|
15
|
+
headerButtonClassName = _ref.headerButtonClassName,
|
|
16
|
+
bodyClassName = _ref.bodyClassName,
|
|
17
|
+
className = _ref.className,
|
|
18
|
+
children = _ref.children,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
return /*#__PURE__*/_jsxs("details", _objectSpread(_objectSpread({
|
|
21
|
+
className: clsx("accordion-item blue-collapse", className)
|
|
22
|
+
}, props), {}, {
|
|
23
|
+
children: [/*#__PURE__*/_jsx("summary", {
|
|
24
|
+
className: clsx("accordion-header", headerClassName),
|
|
25
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
26
|
+
className: clsx("accordion-button collapsed", headerButtonClassName),
|
|
27
|
+
children: header
|
|
28
|
+
})
|
|
29
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
30
|
+
className: clsx("accordion-body", bodyClassName),
|
|
31
|
+
children: children
|
|
32
|
+
})]
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["children", "className", "header", "side", "noPageBorder", "page", "drawerTitle", "countryCode", "onInspectorChange", "ref"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
1
10
|
import React, { useEffect, useId, useRef } from "react";
|
|
2
11
|
import clsx from "clsx";
|
|
3
12
|
import { init, dispose } from "blue-web/dist/js/layout.js";
|
|
@@ -9,32 +18,50 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
9
18
|
export default function Layout(_ref) {
|
|
10
19
|
var children = _ref.children,
|
|
11
20
|
className = _ref.className,
|
|
12
|
-
style = _ref.style,
|
|
13
21
|
header = _ref.header,
|
|
14
22
|
side = _ref.side,
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
noPageBorder = _ref.noPageBorder,
|
|
24
|
+
page = _ref.page,
|
|
17
25
|
drawerTitle = _ref.drawerTitle,
|
|
18
|
-
countryCode = _ref.countryCode
|
|
19
|
-
|
|
26
|
+
countryCode = _ref.countryCode,
|
|
27
|
+
onInspectorChange = _ref.onInspectorChange,
|
|
28
|
+
ref = _ref.ref,
|
|
29
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
+
var fallbackRef = useRef(null);
|
|
31
|
+
var divRef = ref || fallbackRef;
|
|
20
32
|
var idPrefix = useId();
|
|
21
33
|
var sideId = "".concat(idPrefix, "side");
|
|
22
34
|
var drawerId = "".concat(idPrefix, "drawer");
|
|
23
35
|
var drawerLabelId = "".concat(idPrefix, "drawerLabel");
|
|
24
36
|
useEffect(function () {
|
|
25
|
-
if (
|
|
26
|
-
init(
|
|
37
|
+
if (divRef.current) {
|
|
38
|
+
var instance = init(divRef.current);
|
|
39
|
+
if (onInspectorChange) {
|
|
40
|
+
var isOpen = divRef.current.dataset.blueInspectorOpen !== undefined;
|
|
41
|
+
onInspectorChange(isOpen);
|
|
42
|
+
}
|
|
43
|
+
if (onInspectorChange) {
|
|
44
|
+
divRef.current.addEventListener("blue-inspector-change", function (_ref2) {
|
|
45
|
+
var target = _ref2.target;
|
|
46
|
+
if (target) {
|
|
47
|
+
var _isOpen = target.dataset.blueInspectorOpen !== undefined;
|
|
48
|
+
onInspectorChange(_isOpen);
|
|
49
|
+
}
|
|
50
|
+
}, {
|
|
51
|
+
signal: instance === null || instance === void 0 ? void 0 : instance.controller.signal
|
|
52
|
+
});
|
|
53
|
+
}
|
|
27
54
|
}
|
|
28
55
|
return function () {
|
|
29
|
-
if (
|
|
30
|
-
dispose(
|
|
56
|
+
if (divRef.current) {
|
|
57
|
+
dispose(divRef.current);
|
|
31
58
|
}
|
|
32
59
|
};
|
|
33
60
|
}, []);
|
|
34
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
35
|
-
ref:
|
|
36
|
-
className: clsx("blue-layout", className)
|
|
37
|
-
|
|
61
|
+
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
|
62
|
+
ref: divRef,
|
|
63
|
+
className: clsx("blue-layout", className)
|
|
64
|
+
}, props), {}, {
|
|
38
65
|
children: [/*#__PURE__*/_jsxs("header", {
|
|
39
66
|
className: "blue-layout-header",
|
|
40
67
|
children: [/*#__PURE__*/_jsx("button", {
|
|
@@ -84,7 +111,7 @@ export default function Layout(_ref) {
|
|
|
84
111
|
children: /*#__PURE__*/_jsxs("dialog", {
|
|
85
112
|
className: "blue-lg-modal blue-modal modal",
|
|
86
113
|
id: drawerId,
|
|
87
|
-
"aria-
|
|
114
|
+
"aria-labelledby": drawerLabelId,
|
|
88
115
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
89
116
|
className: "offcanvas offcanvas-start",
|
|
90
117
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
@@ -121,12 +148,12 @@ export default function Layout(_ref) {
|
|
|
121
148
|
})
|
|
122
149
|
}), /*#__PURE__*/_jsx("main", {
|
|
123
150
|
className: "blue-layout-main",
|
|
124
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
151
|
+
children: children || /*#__PURE__*/_jsx("div", {
|
|
125
152
|
className: clsx("blue-layout-body", {
|
|
126
153
|
"border-0": noPageBorder
|
|
127
154
|
}),
|
|
128
|
-
children:
|
|
155
|
+
children: page
|
|
129
156
|
})
|
|
130
157
|
})]
|
|
131
|
-
});
|
|
158
|
+
}));
|
|
132
159
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["inspectorId", "start", "end", "drawerTitle", "noPageBorder", "countryCode", "className"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
10
|
+
import "@spectrum-web-components/split-view/sp-split-view.js";
|
|
11
|
+
import { useId } from "react";
|
|
12
|
+
import clsx from "clsx";
|
|
13
|
+
import { getPhrase } from "./shared.js";
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* Might require React 19 or higher!
|
|
17
|
+
* Allows to create a split view between the layout's main content and an inspector next to it.
|
|
18
|
+
* Doesn't support SSR out of the box.
|
|
19
|
+
*/
|
|
20
|
+
export default function LayoutSplitter(_ref) {
|
|
21
|
+
var inspectorId = _ref.inspectorId,
|
|
22
|
+
start = _ref.start,
|
|
23
|
+
end = _ref.end,
|
|
24
|
+
drawerTitle = _ref.drawerTitle,
|
|
25
|
+
noPageBorder = _ref.noPageBorder,
|
|
26
|
+
countryCode = _ref.countryCode,
|
|
27
|
+
className = _ref.className,
|
|
28
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
var idPrefix = useId();
|
|
30
|
+
var drawerLabelId = "".concat(idPrefix, "drawerLabel");
|
|
31
|
+
return /*#__PURE__*/_jsxs("sp-split-view", _objectSpread(_objectSpread({
|
|
32
|
+
className: clsx("blue-layout-splitter", className)
|
|
33
|
+
}, props), {}, {
|
|
34
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
35
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
36
|
+
className: clsx("blue-layout-body", {
|
|
37
|
+
"border-0": noPageBorder
|
|
38
|
+
}),
|
|
39
|
+
children: start
|
|
40
|
+
})
|
|
41
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
42
|
+
children: /*#__PURE__*/_jsxs("dialog", {
|
|
43
|
+
className: "blue-layout-inspector blue-lg-modal blue-modal modal",
|
|
44
|
+
id: inspectorId,
|
|
45
|
+
"aria-labelledby": drawerLabelId,
|
|
46
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
47
|
+
className: "offcanvas offcanvas-end",
|
|
48
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
49
|
+
className: "offcanvas-header",
|
|
50
|
+
children: [/*#__PURE__*/_jsx("h1", {
|
|
51
|
+
className: "h5 offcanvas-title",
|
|
52
|
+
id: drawerLabelId,
|
|
53
|
+
children: drawerTitle || getPhrase("Inspector", countryCode)
|
|
54
|
+
}), /*#__PURE__*/_jsx("form", {
|
|
55
|
+
method: "dialog",
|
|
56
|
+
style: {
|
|
57
|
+
display: "contents"
|
|
58
|
+
},
|
|
59
|
+
children: /*#__PURE__*/_jsx("button", {
|
|
60
|
+
type: "submit",
|
|
61
|
+
className: "btn-close",
|
|
62
|
+
"aria-label": getPhrase("Close", countryCode)
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
66
|
+
className: "offcanvas-body",
|
|
67
|
+
children: end
|
|
68
|
+
})]
|
|
69
|
+
}), /*#__PURE__*/_jsx("form", {
|
|
70
|
+
method: "dialog",
|
|
71
|
+
className: "blue-modal-backdrop",
|
|
72
|
+
children: /*#__PURE__*/_jsx("button", {
|
|
73
|
+
children: getPhrase("Close", countryCode)
|
|
74
|
+
})
|
|
75
|
+
})]
|
|
76
|
+
})
|
|
77
|
+
})]
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
@@ -5,6 +5,7 @@ var phrases = {
|
|
|
5
5
|
Message: ["Message", "Nachricht"],
|
|
6
6
|
"Toggle menu": ["Toggle menu", "Menü umschalten"],
|
|
7
7
|
Menu: ["Menu", "Menü"],
|
|
8
|
+
Inspector: ["Inspector", "Inspektor"],
|
|
8
9
|
"Toggle sidebar": ["Toggle sidebar", "Seitenleiste umschalten"],
|
|
9
10
|
"Toggle details": ["Toggle details", "Details umschalten"],
|
|
10
11
|
"Close all": ["Close all", "Alle schließen"],
|
package/index.d.ts
CHANGED
|
@@ -9,9 +9,18 @@ export default global
|
|
|
9
9
|
export { default as Layout } from "./dist/components/Layout"
|
|
10
10
|
export { LayoutProps } from "./dist/components/Layout"
|
|
11
11
|
|
|
12
|
+
export { default as LayoutSplitter } from "./dist/components/LayoutSplitter"
|
|
13
|
+
export { LayoutSplitterProps } from "./dist/components/LayoutSplitter"
|
|
14
|
+
|
|
12
15
|
export { default as A } from "./dist/components/A"
|
|
13
16
|
export { AProps } from "./dist/components/A"
|
|
14
17
|
|
|
18
|
+
export { default as Accordion } from "./dist/components/Accordion"
|
|
19
|
+
export { AccordionProps } from "./dist/components/Accordion"
|
|
20
|
+
|
|
21
|
+
export { default as AccordionItem } from "./dist/components/AccordionItem"
|
|
22
|
+
export { AccordionItemProps } from "./dist/components/AccordionItem"
|
|
23
|
+
|
|
15
24
|
export { default as ActionMenu } from "./dist/components/ActionMenu"
|
|
16
25
|
export { ActionMenuProps } from "./dist/components/ActionMenu"
|
|
17
26
|
|
|
@@ -73,12 +82,6 @@ export { StatusProps } from "./dist/components/Status"
|
|
|
73
82
|
|
|
74
83
|
export { StatusProvider, useStatus } from "./dist/components/StatusProvider"
|
|
75
84
|
|
|
76
|
-
export {
|
|
77
|
-
ToastProvider,
|
|
78
|
-
ToastProviderProps,
|
|
79
|
-
useToast,
|
|
80
|
-
ToastItem,
|
|
81
|
-
ToastItemType
|
|
82
|
-
} from "./dist/components/ToastProvider"
|
|
85
|
+
export { ToastProvider, ToastProviderProps, useToast, ToastItem, ToastItemType } from "./dist/components/ToastProvider"
|
|
83
86
|
|
|
84
87
|
export { default as Utilities } from "./dist/components/Utilities"
|
package/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { default as A } from "./dist/components/A.js"
|
|
2
|
+
export { default as Accordion } from "./dist/components/Accordion.js"
|
|
3
|
+
export { default as AccordionItem } from "./dist/components/AccordionItem.js"
|
|
2
4
|
export { default as ActionMenu } from "./dist/components/ActionMenu.js"
|
|
3
5
|
export { default as Actions } from "./dist/components/Actions.js"
|
|
4
6
|
export { default as Button } from "./dist/components/Button.js"
|
|
@@ -6,6 +8,7 @@ export { default as Chevron } from "./dist/components/Chevron.js"
|
|
|
6
8
|
export { default as FieldGroup } from "./dist/components/FieldGroup.js"
|
|
7
9
|
export { default as HashRouter } from "./dist/components/HashRouter.js"
|
|
8
10
|
export { default as Layout } from "./dist/components/Layout.js"
|
|
11
|
+
export { default as LayoutSplitter } from "./dist/components/LayoutSplitter.js"
|
|
9
12
|
export { default as Header } from "./dist/components/Header.js"
|
|
10
13
|
export { default as HeaderTitle } from "./dist/components/HeaderTitle.js"
|
|
11
14
|
export { default as IconMenuItem } from "./dist/components/IconMenuItem.js"
|
package/package.json
CHANGED
|
@@ -1,78 +1,54 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"@types/react-syntax-highlighter": "^13.5.0",
|
|
56
|
-
"@typescript-eslint/eslint-plugin": "^8.46.4",
|
|
57
|
-
"@typescript-eslint/parser": "^8.46.4",
|
|
58
|
-
"@vitejs/plugin-react": "^5.0.4",
|
|
59
|
-
"babel-plugin-add-import-extension": "^1.6.0",
|
|
60
|
-
"babel-plugin-react-compiler": "^19.1.0-rc.3",
|
|
61
|
-
"eslint": "^9.37.0",
|
|
62
|
-
"eslint-plugin-react-hooks": "^6.1.1",
|
|
63
|
-
"eslint-plugin-react-refresh": "^0.4.7",
|
|
64
|
-
"gh-pages": "^6.3.0",
|
|
65
|
-
"license-report": "^6.2.0",
|
|
66
|
-
"prettier": "2.4.1",
|
|
67
|
-
"react": "^19.2.6",
|
|
68
|
-
"react-bootstrap-icons": "^1.9.1",
|
|
69
|
-
"react-docgen": "^8.0.2",
|
|
70
|
-
"react-dom": "^19.2.6",
|
|
71
|
-
"react-markdown": "^9.0.1",
|
|
72
|
-
"react-router-dom": "^5.3.3",
|
|
73
|
-
"react-syntax-highlighter": "^15.4.3",
|
|
74
|
-
"sass": "1.77.6",
|
|
75
|
-
"typescript": "^5.9.3",
|
|
76
|
-
"vite": "^5.3.4"
|
|
77
|
-
}
|
|
78
|
-
}
|
|
2
|
+
"name": "blue-react",
|
|
3
|
+
"version": "13.0.0",
|
|
4
|
+
"description": "Blue React Components",
|
|
5
|
+
"license": "LGPL-3.0-or-later",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "index.js",
|
|
8
|
+
"types": "index.d.ts",
|
|
9
|
+
"homepage": "https://bruegmann.github.io/blue/react",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/bruegmann/blue"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/bruegmann/blue/issues"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@popperjs/core": "^2.11.5",
|
|
19
|
+
"@spectrum-web-components/split-view": "^1.12.2",
|
|
20
|
+
"blue-web": "1.32.0",
|
|
21
|
+
"bootstrap": "~5.3.3",
|
|
22
|
+
"clsx": "^1.1.1"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": "^18.0.0 || ^19.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@babel/cli": "^7.10.4",
|
|
29
|
+
"@babel/preset-env": "^7.10.4",
|
|
30
|
+
"@babel/preset-react": "^7.10.4",
|
|
31
|
+
"@babel/preset-typescript": "^7.9.0",
|
|
32
|
+
"@types/bootstrap": "^5.2.11",
|
|
33
|
+
"@types/react": "^19.2.15",
|
|
34
|
+
"@types/react-dom": "^19.2.3",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^8.46.4",
|
|
36
|
+
"@typescript-eslint/parser": "^8.46.4",
|
|
37
|
+
"babel-plugin-add-import-extension": "^1.6.0",
|
|
38
|
+
"babel-plugin-react-compiler": "^19.1.0-rc.3",
|
|
39
|
+
"eslint": "^9.37.0",
|
|
40
|
+
"eslint-plugin-react-hooks": "^6.1.1",
|
|
41
|
+
"eslint-plugin-react-refresh": "^0.4.7",
|
|
42
|
+
"react": "^19.2.6",
|
|
43
|
+
"react-dom": "^19.2.6",
|
|
44
|
+
"typescript": "^5.9.3"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"dev": "babel ./src/components --out-dir ./dist/components --extensions \".tsx,.js,.ts\" --watch",
|
|
48
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
49
|
+
"build-types": "tsc -p tsconfig.app.json --declaration --emitDeclarationOnly --declarationDir ./dist --noEmit false --composite false",
|
|
50
|
+
"build": "babel ./src/components --out-dir ./dist/components --extensions \".tsx,.js,.ts\"",
|
|
51
|
+
"build-release": "npm run build-types && npm run build",
|
|
52
|
+
"release": "npm publish && npm run deploy"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React, { CSSProperties, ReactNode } from "react";
|
|
2
|
-
export interface LayoutProps {
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
className?: string;
|
|
5
|
-
style?: CSSProperties;
|
|
6
|
-
header?: React.ReactNode;
|
|
7
|
-
side?: React.ReactNode;
|
|
8
|
-
noPageBorder?: boolean;
|
|
9
|
-
drawerTitle?: ReactNode;
|
|
10
|
-
/**
|
|
11
|
-
* For SSR you can pass server's country code to solve hydration problems.
|
|
12
|
-
*/
|
|
13
|
-
countryCode?: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* A layout with header, side and main content area. Side is collapsible.
|
|
17
|
-
*/
|
|
18
|
-
export default function Layout({ children, className, style, header, side, noPageBorder, drawerTitle, countryCode }: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/style.scss
DELETED
|
File without changes
|
|
File without changes
|