@stack-spot/portal-layout 0.0.51 → 0.0.52

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 (97) 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/components/Dialog.d.ts +1 -1
  5. package/dist/components/Dialog.js +1 -1
  6. package/dist/components/Header.d.ts +1 -1
  7. package/dist/components/Header.js +1 -1
  8. package/dist/components/OverlayContent.d.ts +1 -1
  9. package/dist/components/OverlayContent.js +20 -20
  10. package/dist/components/PortalSwitcher.d.ts +1 -1
  11. package/dist/components/PortalSwitcher.js +54 -54
  12. package/dist/components/SelectionList.d.ts +1 -1
  13. package/dist/components/SelectionList.js +54 -54
  14. package/dist/components/Toaster.d.ts +1 -1
  15. package/dist/components/Toaster.js +1 -1
  16. package/dist/components/UserMenu.d.ts +1 -1
  17. package/dist/components/UserMenu.js +41 -41
  18. package/dist/components/error/ErrorBoundary.d.ts +1 -1
  19. package/dist/components/error/ErrorBoundary.js +1 -1
  20. package/dist/components/error/ErrorFeedback.d.ts +1 -1
  21. package/dist/components/error/ErrorFeedback.js +1 -1
  22. package/dist/components/error/SilentErrorBoundary.d.ts +1 -1
  23. package/dist/components/error/SilentErrorBoundary.js +1 -1
  24. package/dist/components/menu/MenuContent.d.ts +12 -8
  25. package/dist/components/menu/MenuContent.d.ts.map +1 -1
  26. package/dist/components/menu/MenuContent.js +146 -146
  27. package/dist/components/menu/MenuSections.d.ts +1 -1
  28. package/dist/components/menu/MenuSections.js +1 -1
  29. package/dist/components/menu/PageSelector.d.ts +1 -1
  30. package/dist/components/menu/PageSelector.js +65 -65
  31. package/dist/layout-context.d.ts +1 -1
  32. package/dist/layout-context.js +1 -1
  33. package/dist/layout.css +466 -465
  34. package/dist/svg/AI.d.ts +1 -1
  35. package/dist/svg/AI.js +1 -1
  36. package/dist/svg/EDP.d.ts +1 -1
  37. package/dist/svg/EDP.js +1 -1
  38. package/dist/svg/Forbidden.d.ts +1 -1
  39. package/dist/svg/Forbidden.js +1 -1
  40. package/dist/svg/HUB.d.ts +1 -1
  41. package/dist/svg/HUB.js +1 -1
  42. package/dist/svg/Logo.d.ts +1 -1
  43. package/dist/svg/Logo.js +1 -1
  44. package/dist/svg/NotFound.d.ts +1 -1
  45. package/dist/svg/NotFound.js +1 -1
  46. package/dist/svg/ServerError.d.ts +1 -1
  47. package/dist/svg/ServerError.js +1 -1
  48. package/dist/svg/Unauthenticated.d.ts +1 -1
  49. package/dist/svg/Unauthenticated.js +1 -1
  50. package/dist/toaster.js +1 -1
  51. package/package.json +1 -1
  52. package/src/Layout.tsx +106 -106
  53. package/src/LayoutOverlayManager.tsx +273 -273
  54. package/src/components/Dialog.tsx +93 -93
  55. package/src/components/Header.tsx +34 -34
  56. package/src/components/OverlayContent.tsx +58 -58
  57. package/src/components/PortalSwitcher.tsx +147 -147
  58. package/src/components/SelectionList.tsx +272 -272
  59. package/src/components/Toaster.tsx +16 -16
  60. package/src/components/UserMenu.tsx +111 -111
  61. package/src/components/error/ErrorBoundary.tsx +38 -38
  62. package/src/components/error/ErrorFeedback.tsx +114 -114
  63. package/src/components/error/ErrorManager.ts +31 -31
  64. package/src/components/error/SilentErrorBoundary.tsx +54 -54
  65. package/src/components/menu/MenuContent.tsx +296 -296
  66. package/src/components/menu/MenuSections.tsx +270 -270
  67. package/src/components/menu/PageSelector.tsx +154 -154
  68. package/src/components/menu/constants.ts +2 -2
  69. package/src/components/menu/types.ts +112 -112
  70. package/src/components/menu/use-check-text-overflow.tsx +26 -26
  71. package/src/components/menu/use-keyboard-controls.tsx +70 -70
  72. package/src/components/types.ts +15 -15
  73. package/src/dictionary.ts +25 -25
  74. package/src/elements.ts +24 -24
  75. package/src/errors.ts +11 -11
  76. package/src/index.ts +17 -17
  77. package/src/layout-context.tsx +22 -22
  78. package/src/layout.css +466 -465
  79. package/src/svg/AI.tsx +37 -37
  80. package/src/svg/EDP.tsx +35 -35
  81. package/src/svg/Forbidden.tsx +22 -22
  82. package/src/svg/HUB.tsx +35 -35
  83. package/src/svg/Logo.tsx +35 -35
  84. package/src/svg/NotFound.tsx +16 -16
  85. package/src/svg/ServerError.tsx +33 -33
  86. package/src/svg/Unauthenticated.tsx +16 -16
  87. package/src/toaster.tsx +76 -76
  88. package/src/utils.ts +114 -114
  89. package/tsconfig.json +8 -8
  90. package/dist/components/error/ErrorDescriptor.d.ts +0 -12
  91. package/dist/components/error/ErrorDescriptor.d.ts.map +0 -1
  92. package/dist/components/error/ErrorDescriptor.js +0 -17
  93. package/dist/components/error/ErrorDescriptor.js.map +0 -1
  94. package/dist/components/menu/useCheckTextOverflow.d.ts +0 -6
  95. package/dist/components/menu/useCheckTextOverflow.d.ts.map +0 -1
  96. package/dist/components/menu/useCheckTextOverflow.js +0 -20
  97. package/dist/components/menu/useCheckTextOverflow.js.map +0 -1
@@ -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
+ }