blue-react 10.0.0-rc1 → 10.0.0-rc3

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.
Files changed (69) hide show
  1. package/README.md +50 -0
  2. package/dist/components/A.js +8 -23
  3. package/dist/components/ActionMenu.js +35 -67
  4. package/dist/components/ActionMenuItem.js +15 -37
  5. package/dist/components/Body.js +13 -27
  6. package/dist/components/Caret.js +6 -9
  7. package/dist/components/Chevron.js +14 -24
  8. package/dist/components/HashRouter.js +23 -66
  9. package/dist/components/Header.js +12 -15
  10. package/dist/components/HeaderTitle.js +37 -45
  11. package/dist/components/IconMenuItem.js +17 -33
  12. package/dist/components/Intro.js +12 -22
  13. package/dist/components/Layout.js +47 -42
  14. package/dist/components/MenuItem.js +41 -83
  15. package/dist/components/Modal.js +53 -86
  16. package/dist/components/ModalProvider.js +70 -125
  17. package/dist/components/Outside.js +13 -29
  18. package/dist/components/Page.js +18 -44
  19. package/dist/components/Search.js +47 -85
  20. package/dist/components/SidebarMenu.js +8 -22
  21. package/dist/components/SidebarMenuItem.js +34 -65
  22. package/dist/components/SidebarToggler.js +12 -22
  23. package/dist/components/SlimContainer.js +6 -16
  24. package/dist/components/Status.js +33 -44
  25. package/dist/components/StatusProvider.js +28 -65
  26. package/dist/components/Switch.js +17 -23
  27. package/dist/components/ToastProvider.js +43 -83
  28. package/dist/components/Utilities.js +23 -45
  29. package/dist/components/shared.js +1 -11
  30. package/dist/style.scss +1 -1
  31. package/dist/types/components/A.d.ts +9 -9
  32. package/dist/types/components/ActionMenu.d.ts +25 -25
  33. package/dist/types/components/ActionMenuItem.d.ts +36 -35
  34. package/dist/types/components/Body.d.ts +20 -21
  35. package/dist/types/components/Caret.d.ts +18 -18
  36. package/dist/types/components/Chevron.d.ts +17 -17
  37. package/dist/types/components/HashRouter.d.ts +76 -77
  38. package/dist/types/components/Header.d.ts +9 -8
  39. package/dist/types/components/HeaderTitle.d.ts +40 -40
  40. package/dist/types/components/IconMenuItem.d.ts +18 -19
  41. package/dist/types/components/Intro.d.ts +22 -23
  42. package/dist/types/components/Layout.d.ts +9 -16
  43. package/dist/types/components/MenuItem.d.ts +149 -149
  44. package/dist/types/components/Modal.d.ts +30 -30
  45. package/dist/types/components/ModalProvider.d.ts +21 -21
  46. package/dist/types/components/Outside.d.ts +17 -17
  47. package/dist/types/components/Page.d.ts +11 -12
  48. package/dist/types/components/Search.d.ts +36 -36
  49. package/dist/types/components/SidebarMenu.d.ts +31 -32
  50. package/dist/types/components/SidebarMenuItem.d.ts +21 -22
  51. package/dist/types/components/SidebarToggler.d.ts +10 -10
  52. package/dist/types/components/SlimContainer.d.ts +10 -10
  53. package/dist/types/components/Status.d.ts +12 -12
  54. package/dist/types/components/StatusProvider.d.ts +15 -15
  55. package/dist/types/components/Switch.d.ts +33 -33
  56. package/dist/types/components/ToastProvider.d.ts +22 -22
  57. package/dist/types/components/Utilities.d.ts +41 -41
  58. package/dist/types/components/shared.d.ts +15 -15
  59. package/index.d.ts +8 -12
  60. package/index.js +56 -30
  61. package/package.json +27 -43
  62. package/dist/components/ActionMenuSwitch.js +0 -44
  63. package/dist/components/LegacyLayout.js +0 -367
  64. package/dist/components/LegacySidebarMenu.js +0 -74
  65. package/dist/style.css +0 -11944
  66. package/dist/style.min.css +0 -16
  67. package/dist/types/components/ActionMenuSwitch.d.ts +0 -12
  68. package/dist/types/components/LegacyLayout.d.ts +0 -145
  69. package/dist/types/components/LegacySidebarMenu.d.ts +0 -33
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { SwitchProps } from "./Switch";
3
- export interface ActionMenuSwitchProps extends SwitchProps {
4
- onChange?: () => void;
5
- label?: any;
6
- }
7
- /**
8
- * @deprecated
9
- * Use a solution with Bootstrap's `.form-check.form-switch` or `MenuItem` with a switch icon.
10
- * Switch for the Action Menu.
11
- */
12
- export default function ActionMenuSwitch({ label, ...props }: ActionMenuSwitchProps): JSX.Element;
@@ -1,145 +0,0 @@
1
- import { Component, CSSProperties } from "react";
2
- declare global {
3
- interface Window {
4
- blueLayoutRef: any;
5
- toggleSidebarEvent: any;
6
- }
7
- }
8
- export interface LayoutProps {
9
- id?: string;
10
- /**
11
- * By default, the side bar is "in".
12
- * You can control the state from outside, by also using `onChangeSidebarIn`.
13
- */
14
- sidebarIn?: boolean;
15
- /**
16
- * React to changes of the `sidebarIn` state.
17
- */
18
- onChangeSidebarIn?: (sidebarIn: boolean) => void;
19
- style?: CSSProperties;
20
- /**
21
- * Set `true` to hide button to toggle `expandSidebar` state.
22
- */
23
- hideToggleExpandSidebar?: boolean;
24
- /**
25
- * Sidebar is automatically expanded on wider views.
26
- */
27
- expandSidebar?: boolean;
28
- /**
29
- * React to changes of the `expandSidebar` state.
30
- */
31
- onChangeExpandSidebar?: (expandSidebar: boolean) => void;
32
- /**
33
- * Disables sidebar.
34
- */
35
- hideSidebarMenu?: boolean;
36
- /**
37
- * Registers pages for the built-in routing system. Example: `[{name: "home", component: <HomePage />}]`
38
- */
39
- pages?: {
40
- name: string;
41
- component: JSX.Element;
42
- }[];
43
- /**
44
- * When `true`, always the "home" route will be rendered.
45
- */
46
- unrouteable?: boolean;
47
- /**
48
- * Extends `className`.
49
- */
50
- className?: string;
51
- /**
52
- * By default, the document title will automatically set. Set this prop to `true` to disable this behaviour.
53
- */
54
- disableTitleSet?: boolean;
55
- /**
56
- * If you don't use blueicon, you can define another icon element for the sidebar toggle button.
57
- */
58
- sidebarToggleIconComponent?: any;
59
- /**
60
- * Set `true` if you want to use the Utilities functions for status and alert.
61
- * Set `false` if you want to use `StatusProvider` instead.
62
- */
63
- enableStatus?: boolean;
64
- /**
65
- * Will replace status icons with custom ones. This will also overwrite the `useBlueicons` option.
66
- * This can be a SVG component or a normal element component.
67
- */
68
- statusIcons?: {
69
- danger: any;
70
- info: any;
71
- success: any;
72
- warning: any;
73
- };
74
- /**
75
- * Disables the header bars on pages.
76
- */
77
- disableHeaders?: boolean;
78
- /**
79
- * Define a function, that will be fired when switching routes. When your function returns `true`, the default route behaviour will be blocked.
80
- * You can use something like `window.blueLayoutRef.setState({ blockRouting: onHashChange })` globally to set the value from anywhere in your app.
81
- */
82
- blockRouting?: (newMatch: string[], currentMatch: string[]) => void | boolean;
83
- children?: any;
84
- }
85
- export interface LayoutState {
86
- sidebarIn: boolean;
87
- expandSidebar: boolean;
88
- match: any;
89
- history: string[];
90
- hash: string;
91
- hashHistory: string[];
92
- blockRouting?: (newMatch: string[], currentMatch: string[]) => void | boolean;
93
- }
94
- /**
95
- * @deprecated Consider to use the new `Layout` component instead.
96
- * The main component. As soon this component is mounted, it is globally available under `window.blueLayoutRef`.
97
- * You can also append your own event listeners.
98
- *
99
- * Allowed events:
100
- *
101
- * * **componentDidUpdate** - Component was updated.
102
- * Example: `window.blueLayoutRef.addEventListener("componentDidUpdate", (prevProps, prevState) => { })`
103
- * * **pageDidShowAgain** - Page appeared again with the same old state. In the callback function you can reinitialize things.
104
- * Example: `window.blueLayoutRef.addEventListener("pageDidShowAgain", "home", (prevProps, prevState) => { })`
105
- * * **pageDidHide** - This page disappeared and another page appears instead.
106
- * Example: `window.blueLayoutRef.addEventListener("pageDidHide", "home", (prevProps, prevState) => { })`
107
- *
108
- * Method to add event listeners:
109
- * * `window.blueLayoutRef.`**addEventListener**`(eventName: string, param2: any, param3: any, listenerId?: string)`
110
- *
111
- * Methods to remove event listeners:
112
- * * `window.blueLayoutRef.`**removeEventListener**`(eventName: string, listenerId: string)`
113
- * * `window.blueLayoutRef.`**removeDuplicatedEventListeners**`()` - Will automatically be called when running `addEventListener`
114
- */
115
- export default class LegacyLayout extends Component<LayoutProps, LayoutState> {
116
- defaultMatch: string[];
117
- eventListeners: any[];
118
- constructor(props: LayoutProps);
119
- onHashChange(): void;
120
- static get defaultProps(): {
121
- hideSidebarMenu: boolean;
122
- unrouteable: boolean;
123
- disableTitleSet: boolean;
124
- sidebarToggleIconComponent: JSX.Element;
125
- enableStatus: boolean;
126
- statusIcons: {
127
- danger: JSX.Element;
128
- info: JSX.Element;
129
- success: JSX.Element;
130
- warning: JSX.Element;
131
- };
132
- hideToggleExpandSidebar: boolean;
133
- };
134
- componentDidMount(): void;
135
- componentWillUnmount(): void;
136
- componentDidUpdate(prevProps: LayoutProps, prevState: LayoutState): void;
137
- toggleSidebar(event: any): void;
138
- hideSidebar(e: any): void;
139
- initMatch(): void;
140
- addEventListener(param1: any, param2: any, param3: any, listenerId?: string): void;
141
- removeEventListener(type: string, listenerId: string): void;
142
- removeDuplicatedEventListeners(): void;
143
- toggleExpandSidebar(): void;
144
- render(): JSX.Element;
145
- }
@@ -1,33 +0,0 @@
1
- /// <reference types="react" />
2
- export interface SidebarMenuProps {
3
- /**
4
- * Extends the class name by the sidebar.
5
- */
6
- sidebarClass?: string;
7
- /**
8
- * Sets the `style` prop by the sidebar.
9
- */
10
- sidebarStyle?: object;
11
- /**
12
- * Extends the class name by the menu.
13
- */
14
- menuClass?: string;
15
- /**
16
- * Sets the `style` prop by the menu.
17
- */
18
- menuStyle?: object;
19
- /**
20
- * Content on top of the menu.
21
- */
22
- topContent?: any;
23
- /**
24
- * Content for the bottom part of the sidebar.
25
- */
26
- bottomContent?: any;
27
- children?: any;
28
- }
29
- /**
30
- * @deprecated Use the new `SidebarMenu` component instead.
31
- * Sidebar for the `Layout` component.
32
- */
33
- export default function LegacySidebarMenu(props: SidebarMenuProps): JSX.Element;