Skip to content

Commit c185f12

Browse files
committed
updated api-docs
1 parent c116c17 commit c185f12

File tree

2 files changed

+76
-47
lines changed

2 files changed

+76
-47
lines changed

src/__tests__/snapshot-tests/__snapshots__/documenter.test.ts.snap

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`Components definition for alert matches the snapshot: alert 1`] = `
44
{
@@ -11373,19 +11373,24 @@ exports[`Components definition for error-boundary matches the snapshot: error-bo
1137311373
"name": "ErrorBoundary",
1137411374
"properties": [
1137511375
{
11376-
"description": "Optional error boundary identifier that is passed as detail to the \`onError\` callback.
11377-
The content passed to the error boundary is wrapped in a div with \`data-awsui-boundary-id={errorBoundaryId}\`.",
11376+
"description": "Optional identifier for the error boundary instance.
11377+
11378+
When provided, the identifier is included in the \`onError\` callback payload.
11379+
In the rendered output, the boundary wraps its content in a \`<div>\` with the
11380+
attribute \`data-awsui-boundary-id={errorBoundaryId}\` to support debugging.",
1137811381
"name": "errorBoundaryId",
1137911382
"optional": true,
1138011383
"type": "string",
1138111384
},
1138211385
{
11383-
"description": "An object containing all the localized strings required by the component:
11384-
* \`headerText\` (string): The text of the fallback message header.
11385-
* \`descriptionText\` (string): The text of the fallback message description. You can inject inline feedback action
11386-
here by providing \`components.Feedback\`, and using <Feedback>custom text</Feedback> pseudo-tag in the text.
11387-
* \`refreshActionText\` (string): The text of the default refresh action button.
11388-
* \`components.Feedback\` (React.ComponentType<I18nFeedbackProps>): The inline action to be injected into the description text.",
11386+
"description": "Localized strings and components used in the fallback UI.
11387+
11388+
* \`headerText\` (string): Header text displayed in the fallback view.
11389+
* \`descriptionText\` (string): Description text displayed in the fallback view. Supports embedding inline
11390+
feedback actions by including \`<Feedback>\` pseudo-tags when \`components.Feedback\` is provided.
11391+
* \`refreshActionText\` (string): Text for the default refresh action button.
11392+
* \`components.Feedback\` (React.ComponentType<I18nFeedbackProps>): A component used to render
11393+
inline feedback actions within the description text.",
1138911394
"i18nTag": true,
1139011395
"inlineType": {
1139111396
"name": "ErrorBoundaryProps.I18nStrings",
@@ -11437,11 +11442,13 @@ here by providing \`components.Feedback\`, and using <Feedback>custom text</Feed
1143711442
"type": "ErrorBoundaryProps.I18nStrings",
1143811443
},
1143911444
{
11440-
"description": "This function is invoked when an error is captured. Use it to report errors for telemetry.
11441-
The detail include:
11442-
* \`error\` (Error) - the error object.
11443-
* \`errorInfo\` (React.ErrorInfo) - additional error meta-information from React.
11444-
* \`errorBoundaryId\` (optional, string) - the \`errorBoundaryId\` if defined.",
11445+
"description": "Callback invoked when an error is intercepted by the boundary.
11446+
Use this function to record, log, or report errors (for example, to telemetry or monitoring systems).
11447+
11448+
The callback receives a \`detail\` object containing:
11449+
* \`error\` (Error): The thrown error instance.
11450+
* \`errorInfo\` (React.ErrorInfo): Additional metadata captured by React.
11451+
* \`errorBoundaryId\` (optional, string): The boundary identifier, if defined.",
1144511452
"inlineType": {
1144611453
"name": "(detail: ErrorBoundaryProps.OnErrorDetail) => void",
1144711454
"parameters": [
@@ -11458,10 +11465,14 @@ The detail include:
1145811465
"type": "(detail: ErrorBoundaryProps.OnErrorDetail) => void",
1145911466
},
1146011467
{
11461-
"description": "Custom render function for the fallback message. It takes the default i18n slots as input, including:
11462-
* \`header\` (ReactNode) - the fallback header taken from the definition or i18n.
11463-
* \`description\` (ReactNode) - the fallback description taken from the definition or i18n.
11464-
* \`action\` (ReactNode) - the fallback action taken from the definition or default refresh action.",
11468+
"description": "Optional custom renderer for the fallback UI displayed when an error occurs.
11469+
11470+
The function receives the default slots derived from i18n configuration:
11471+
* \`header\` (ReactNode): The fallback header text.
11472+
* \`description\` (ReactNode): The fallback description text.
11473+
* \`action\` (ReactNode): The fallback action element (a refresh button by default).
11474+
11475+
Return a React node to fully override the default fallback presentation.",
1146511476
"inlineType": {
1146611477
"name": "(props: ErrorBoundaryProps.FallbackProps) => React.ReactNode",
1146711478
"parameters": [
@@ -11479,20 +11490,23 @@ The detail include:
1147911490
},
1148011491
{
1148111492
"defaultValue": "false",
11482-
"description": "Some components including app layout, container, modal, and more have built-in error boundaries.
11483-
They activate when there is an error boundary component up in the hierarchy. When active, they will
11484-
use the configuration of the closest error boundary up in the hierarchy.
11493+
"description": "Controls how nested error boundaries behave.
11494+
11495+
Several components—such as app layout, container, and modal include built-in
11496+
error boundaries. These boundaries activate automatically when they detect
11497+
an ancestor boundary, inheriting configuration from the closest one.
1148511498

11486-
The nested error boundaries, built-in and standalone can be deactivated by using \`suppressNested=true\`. In that
11487-
case, any error originating from the error boundary content will be captured by this error boundary.",
11499+
When \`suppressNested\` is set to \`true\`, nested built-in or standalone
11500+
boundaries are disabled. In this mode, all errors originating from within
11501+
the boundary’s content are captured exclusively by this boundary.",
1148811502
"name": "suppressNested",
1148911503
"optional": true,
1149011504
"type": "boolean",
1149111505
},
1149211506
],
1149311507
"regions": [
1149411508
{
11495-
"description": "Content rendered when no error is captured.",
11509+
"description": "Child content rendered when no error has been captured.",
1149611510
"isDefault": true,
1149711511
"name": "children",
1149811512
},

src/error-boundary/interfaces.ts

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,66 @@ import { ErrorInfo } from 'react';
55

66
export interface ErrorBoundaryProps {
77
/**
8-
* Optional error boundary identifier that is passed as detail to the `onError` callback.
9-
* The content passed to the error boundary is wrapped in a div with `data-awsui-boundary-id={errorBoundaryId}`.
8+
* Optional identifier for the error boundary instance.
9+
*
10+
* When provided, the identifier is included in the `onError` callback payload.
11+
* In the rendered output, the boundary wraps its content in a `<div>` with the
12+
* attribute `data-awsui-boundary-id={errorBoundaryId}` to support debugging.
1013
*/
1114
errorBoundaryId?: string;
1215

1316
/**
14-
* This function is invoked when an error is captured. Use it to report errors for telemetry.
15-
* The detail include:
16-
* * `error` (Error) - the error object.
17-
* * `errorInfo` (React.ErrorInfo) - additional error meta-information from React.
18-
* * `errorBoundaryId` (optional, string) - the `errorBoundaryId` if defined.
17+
* Callback invoked when an error is intercepted by the boundary.
18+
* Use this function to record, log, or report errors (for example, to telemetry or monitoring systems).
19+
*
20+
* The callback receives a `detail` object containing:
21+
* * `error` (Error): The thrown error instance.
22+
* * `errorInfo` (React.ErrorInfo): Additional metadata captured by React.
23+
* * `errorBoundaryId` (optional, string): The boundary identifier, if defined.
1924
*/
2025
onError: (detail: ErrorBoundaryProps.OnErrorDetail) => void;
2126

2227
/**
23-
* Some components including app layout, container, modal, and more have built-in error boundaries.
24-
* They activate when there is an error boundary component up in the hierarchy. When active, they will
25-
* use the configuration of the closest error boundary up in the hierarchy.
28+
* Controls how nested error boundaries behave.
2629
*
27-
* The nested error boundaries, built-in and standalone can be deactivated by using `suppressNested=true`. In that
28-
* case, any error originating from the error boundary content will be captured by this error boundary.
30+
* Several components—such as app layout, container, and modal include built-in
31+
* error boundaries. These boundaries activate automatically when they detect
32+
* an ancestor boundary, inheriting configuration from the closest one.
33+
*
34+
* When `suppressNested` is set to `true`, nested built-in or standalone
35+
* boundaries are disabled. In this mode, all errors originating from within
36+
* the boundary’s content are captured exclusively by this boundary.
2937
*/
3038
suppressNested?: boolean;
3139

3240
/**
33-
* Custom render function for the fallback message. It takes the default i18n slots as input, including:
34-
* * `header` (ReactNode) - the fallback header taken from the definition or i18n.
35-
* * `description` (ReactNode) - the fallback description taken from the definition or i18n.
36-
* * `action` (ReactNode) - the fallback action taken from the definition or default refresh action.
41+
* Optional custom renderer for the fallback UI displayed when an error occurs.
42+
*
43+
* The function receives the default slots derived from i18n configuration:
44+
* * `header` (ReactNode): The fallback header text.
45+
* * `description` (ReactNode): The fallback description text.
46+
* * `action` (ReactNode): The fallback action element (a refresh button by default).
47+
*
48+
* Return a React node to fully override the default fallback presentation.
3749
*/
3850
renderFallback?: (props: ErrorBoundaryProps.FallbackProps) => React.ReactNode;
3951

4052
/**
41-
* An object containing all the localized strings required by the component:
42-
* * `headerText` (string): The text of the fallback message header.
43-
* * `descriptionText` (string): The text of the fallback message description. You can inject inline feedback action
44-
* here by providing `components.Feedback`, and using <Feedback>custom text</Feedback> pseudo-tag in the text.
45-
* * `refreshActionText` (string): The text of the default refresh action button.
46-
* * `components.Feedback` (React.ComponentType<I18nFeedbackProps>): The inline action to be injected into the description text.
53+
* Localized strings and components used in the fallback UI.
54+
*
55+
* * `headerText` (string): Header text displayed in the fallback view.
56+
* * `descriptionText` (string): Description text displayed in the fallback view. Supports embedding inline
57+
* feedback actions by including `<Feedback>` pseudo-tags when `components.Feedback` is provided.
58+
* * `refreshActionText` (string): Text for the default refresh action button.
59+
* * `components.Feedback` (React.ComponentType<I18nFeedbackProps>): A component used to render
60+
* inline feedback actions within the description text.
61+
*
4762
* @i18n
4863
*/
4964
i18nStrings?: ErrorBoundaryProps.I18nStrings;
5065

5166
/**
52-
* Content rendered when no error is captured.
67+
* Child content rendered when no error has been captured.
5368
*/
5469
children: React.ReactNode;
5570
}

0 commit comments

Comments
 (0)