@stack-spot/portal-layout 0.0.48 → 0.0.50

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 (95) hide show
  1. package/dist/Layout.d.ts +2 -2
  2. package/dist/Layout.js +1 -1
  3. package/dist/LayoutOverlayManager.js +6 -6
  4. package/dist/LayoutOverlayManager.js.map +1 -1
  5. package/dist/components/Dialog.d.ts +1 -1
  6. package/dist/components/Dialog.js +1 -1
  7. package/dist/components/Header.d.ts +1 -1
  8. package/dist/components/Header.js +1 -1
  9. package/dist/components/OverlayContent.d.ts +1 -1
  10. package/dist/components/OverlayContent.js +20 -20
  11. package/dist/components/PortalSwitcher.d.ts +1 -1
  12. package/dist/components/PortalSwitcher.js +54 -54
  13. package/dist/components/SelectionList.d.ts +1 -1
  14. package/dist/components/SelectionList.js +54 -54
  15. package/dist/components/SelectionList.js.map +1 -1
  16. package/dist/components/Toaster.d.ts +1 -1
  17. package/dist/components/Toaster.js +1 -1
  18. package/dist/components/UserMenu.d.ts +1 -1
  19. package/dist/components/UserMenu.js +42 -42
  20. package/dist/components/UserMenu.js.map +1 -1
  21. package/dist/components/error/ErrorBoundary.d.ts +1 -1
  22. package/dist/components/error/ErrorBoundary.js +1 -1
  23. package/dist/components/error/ErrorFeedback.d.ts +1 -1
  24. package/dist/components/error/ErrorFeedback.js +1 -1
  25. package/dist/components/error/SilentErrorBoundary.d.ts +1 -1
  26. package/dist/components/error/SilentErrorBoundary.js +1 -1
  27. package/dist/components/menu/MenuContent.d.ts +12 -10
  28. package/dist/components/menu/MenuContent.d.ts.map +1 -1
  29. package/dist/components/menu/MenuContent.js +147 -147
  30. package/dist/components/menu/MenuContent.js.map +1 -1
  31. package/dist/components/menu/MenuSections.d.ts +1 -1
  32. package/dist/components/menu/MenuSections.js +1 -1
  33. package/dist/components/menu/MenuSections.js.map +1 -1
  34. package/dist/components/menu/PageSelector.d.ts +1 -1
  35. package/dist/components/menu/PageSelector.js +65 -65
  36. package/dist/components/menu/PageSelector.js.map +1 -1
  37. package/dist/components/menu/use-check-text-overflow.js.map +1 -1
  38. package/dist/layout.css +465 -465
  39. package/dist/svg/AI.d.ts +1 -1
  40. package/dist/svg/AI.js +1 -1
  41. package/dist/svg/EDP.d.ts +1 -1
  42. package/dist/svg/EDP.js +1 -1
  43. package/dist/svg/Forbidden.d.ts +1 -1
  44. package/dist/svg/Forbidden.js +1 -1
  45. package/dist/svg/HUB.d.ts +1 -1
  46. package/dist/svg/HUB.js +1 -1
  47. package/dist/svg/Logo.d.ts +1 -1
  48. package/dist/svg/Logo.js +1 -1
  49. package/dist/svg/NotFound.d.ts +1 -1
  50. package/dist/svg/NotFound.js +1 -1
  51. package/dist/svg/ServerError.d.ts +1 -1
  52. package/dist/svg/ServerError.js +1 -1
  53. package/dist/svg/Unauthenticated.d.ts +1 -1
  54. package/dist/svg/Unauthenticated.js +1 -1
  55. package/dist/toaster.js +2 -2
  56. package/dist/toaster.js.map +1 -1
  57. package/dist/utils.js.map +1 -1
  58. package/package.json +2 -2
  59. package/src/Layout.tsx +103 -103
  60. package/src/LayoutOverlayManager.tsx +273 -273
  61. package/src/components/Dialog.tsx +93 -93
  62. package/src/components/Header.tsx +29 -29
  63. package/src/components/OverlayContent.tsx +58 -58
  64. package/src/components/PortalSwitcher.tsx +147 -147
  65. package/src/components/SelectionList.tsx +268 -268
  66. package/src/components/Toaster.tsx +16 -16
  67. package/src/components/UserMenu.tsx +111 -111
  68. package/src/components/error/ErrorBoundary.tsx +38 -38
  69. package/src/components/error/ErrorFeedback.tsx +114 -114
  70. package/src/components/error/ErrorManager.ts +31 -31
  71. package/src/components/error/SilentErrorBoundary.tsx +54 -54
  72. package/src/components/menu/MenuContent.tsx +293 -293
  73. package/src/components/menu/MenuSections.tsx +268 -268
  74. package/src/components/menu/PageSelector.tsx +152 -152
  75. package/src/components/menu/constants.ts +2 -2
  76. package/src/components/menu/types.ts +112 -112
  77. package/src/components/menu/use-check-text-overflow.tsx +26 -26
  78. package/src/components/menu/use-keyboard-controls.tsx +70 -70
  79. package/src/components/types.ts +15 -15
  80. package/src/dictionary.ts +25 -25
  81. package/src/elements.ts +24 -24
  82. package/src/errors.ts +11 -11
  83. package/src/index.ts +17 -17
  84. package/src/layout.css +465 -465
  85. package/src/svg/AI.tsx +37 -37
  86. package/src/svg/EDP.tsx +35 -35
  87. package/src/svg/Forbidden.tsx +22 -22
  88. package/src/svg/HUB.tsx +35 -35
  89. package/src/svg/Logo.tsx +35 -35
  90. package/src/svg/NotFound.tsx +16 -16
  91. package/src/svg/ServerError.tsx +33 -33
  92. package/src/svg/Unauthenticated.tsx +16 -16
  93. package/src/toaster.tsx +76 -76
  94. package/src/utils.ts +114 -114
  95. package/tsconfig.json +8 -8
@@ -1,54 +1,54 @@
1
- import { theme } from '@stack-spot/portal-theme'
2
- import { Component } from 'react'
3
- import { ErrorDescription, ErrorManager } from './ErrorManager'
4
-
5
- interface State extends ErrorDescription {
6
- hasError: boolean,
7
- message?: string,
8
- }
9
-
10
- interface Props {
11
- children: React.ReactNode,
12
- }
13
-
14
- export class SilentErrorBoundary extends Component<Props, State> {
15
- constructor(props: Props) {
16
- super(props)
17
- this.state = { hasError: false }
18
- }
19
-
20
- static getDerivedStateFromError(error: any) {
21
- return { hasError: true, ...ErrorManager.describe(error) }
22
- }
23
-
24
- componentDidCatch(error: any, errorInfo: any) {
25
- // eslint-disable-next-line no-console
26
- console.error(error, errorInfo)
27
- ErrorManager.runErrorHandler(error)
28
- }
29
-
30
- componentDidUpdate(prevProps: Readonly<Props>) {
31
- if (this.props.children !== prevProps.children) this.setState({ hasError: false })
32
- }
33
-
34
- render() {
35
- return this.state.hasError
36
- ? <div
37
- title={this.state.message ? `Error: ${this.state.message}` : undefined}
38
- style={{
39
- width: '16px',
40
- height: '16px',
41
- margin: '16px',
42
- background: theme.color.danger[500],
43
- color: theme.color.danger.contrastText,
44
- display: this.state.debug ? 'flex' : 'none',
45
- justifyContent: 'center',
46
- alignItems: 'center',
47
- fontWeight: 'bold',
48
- fontSize: '10px',
49
- borderRadius: '50%',
50
- }}
51
- >!</div>
52
- : this.props.children
53
- }
54
- }
1
+ import { theme } from '@stack-spot/portal-theme'
2
+ import { Component } from 'react'
3
+ import { ErrorDescription, ErrorManager } from './ErrorManager'
4
+
5
+ interface State extends ErrorDescription {
6
+ hasError: boolean,
7
+ message?: string,
8
+ }
9
+
10
+ interface Props {
11
+ children: React.ReactNode,
12
+ }
13
+
14
+ export class SilentErrorBoundary extends Component<Props, State> {
15
+ constructor(props: Props) {
16
+ super(props)
17
+ this.state = { hasError: false }
18
+ }
19
+
20
+ static getDerivedStateFromError(error: any) {
21
+ return { hasError: true, ...ErrorManager.describe(error) }
22
+ }
23
+
24
+ componentDidCatch(error: any, errorInfo: any) {
25
+ // eslint-disable-next-line no-console
26
+ console.error(error, errorInfo)
27
+ ErrorManager.runErrorHandler(error)
28
+ }
29
+
30
+ componentDidUpdate(prevProps: Readonly<Props>) {
31
+ if (this.props.children !== prevProps.children) this.setState({ hasError: false })
32
+ }
33
+
34
+ render() {
35
+ return this.state.hasError
36
+ ? <div
37
+ title={this.state.message ? `Error: ${this.state.message}` : undefined}
38
+ style={{
39
+ width: '16px',
40
+ height: '16px',
41
+ margin: '16px',
42
+ background: theme.color.danger[500],
43
+ color: theme.color.danger.contrastText,
44
+ display: this.state.debug ? 'flex' : 'none',
45
+ justifyContent: 'center',
46
+ alignItems: 'center',
47
+ fontWeight: 'bold',
48
+ fontSize: '10px',
49
+ borderRadius: '50%',
50
+ }}
51
+ >!</div>
52
+ : this.props.children
53
+ }
54
+ }