@dloizides/ui-feedback 1.8.0 → 1.12.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/CHANGELOG.md +37 -0
- package/dist/index.d.mts +38 -6
- package/dist/index.d.ts +38 -6
- package/dist/index.js +252 -156
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +236 -136
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.12.0
|
|
4
|
+
|
|
5
|
+
Opt-in additions to `ErrorState` for full-screen error surfaces (an import-error or
|
|
6
|
+
load-error screen that needs a heading, an icon and a way out other than retry). Every
|
|
7
|
+
prop is optional: a caller passing none of them renders the same element tree as 1.11.0,
|
|
8
|
+
pinned by `ErrorState.test.tsx` baseline snapshots recorded before the change.
|
|
9
|
+
|
|
10
|
+
- **Add `title?: string`** — rendered above the message with `accessibilityRole="header"`
|
|
11
|
+
(`role="heading"` on web), testID `${testID}-title`. When a title is present the message
|
|
12
|
+
uses `theme.colors.textSecondary` instead of the error colour.
|
|
13
|
+
- **Add `icon?: React.ReactNode`** — rendered inside a circular well tinted with
|
|
14
|
+
`theme.semantic.error['500']` at low opacity; the well is `aria-hidden`, testID `${testID}-icon`.
|
|
15
|
+
- **Add `secondaryAction?: ErrorStateAction`** (`{ label, hint, onPress, testID }`) — an
|
|
16
|
+
outline button (`theme.colors.border`) laid out in a row beside retry.
|
|
17
|
+
- **Export type `ErrorStateAction`.** No new colour literals; no new dependencies.
|
|
18
|
+
|
|
19
|
+
## 1.11.0
|
|
20
|
+
|
|
21
|
+
Adopts `@dloizides/ui-motion` for `PageSkeleton`: the loader now shows a moving
|
|
22
|
+
**shimmer** (a highlight band sweeping across each block) instead of an opacity pulse,
|
|
23
|
+
so loading states read as modern/ant-design-like. There is now ONE shimmer
|
|
24
|
+
implementation in the kit — the ui-motion `<Skeleton>` primitive — and `PageSkeleton`
|
|
25
|
+
owns only the page LAYOUT (how many bars/blocks, their sizes and spacing).
|
|
26
|
+
|
|
27
|
+
- **Add runtime dependency `@dloizides/ui-motion` (`^1.0.1`).**
|
|
28
|
+
- **`PageSkeleton` internals reimplemented on ui-motion `<Skeleton>`.** Each placeholder
|
|
29
|
+
block (header bar, list-row avatar + text lines, card) is now a `<Skeleton>` with the
|
|
30
|
+
same `width`/`height`/`borderRadius`/base colour it had before. The bespoke
|
|
31
|
+
`Animated.loop` opacity pulse (and its `Animated`/`Easing`/`Platform` imports) is gone.
|
|
32
|
+
- **Reduced-motion is now handled by `<Skeleton>`** (via `@dloizides/rn-web-hooks`
|
|
33
|
+
`useReducedMotion`): the sweep is suppressed and a static block is shown.
|
|
34
|
+
- **Public API unchanged.** `PageSkeletonProps` (`rows`, `showHeader`, `variant`), the
|
|
35
|
+
rendered layout, and the `page-skeleton` testID are identical to 1.9.0. Only the
|
|
36
|
+
internal animated primitive was swapped.
|
|
37
|
+
- `ToastHost` (fade+slide) is intentionally left as-is — it remains the reference
|
|
38
|
+
enter/exit pattern.
|
|
39
|
+
|
|
3
40
|
## 1.7.0
|
|
4
41
|
|
|
5
42
|
Closes the API gap that kept `kefi-web`, `erevna-web` and `katalogos-web` on their
|
package/dist/index.d.mts
CHANGED
|
@@ -80,16 +80,37 @@ declare const FEEDBACK_TEST_IDS: {
|
|
|
80
80
|
readonly errorBoundary: "error-boundary";
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Opt-in pieces of ErrorState: the decorative icon well and the outline secondary action.
|
|
85
|
+
* Both read colours only from the injected theme.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
interface ErrorStateAction {
|
|
89
|
+
label: string;
|
|
90
|
+
hint: string;
|
|
91
|
+
onPress: () => void;
|
|
92
|
+
testID: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
83
95
|
/**
|
|
84
96
|
* ErrorState - generic error display with optional retry button.
|
|
97
|
+
*
|
|
98
|
+
* Opt-in (1.12.0): `title`, a decorative `icon` well and a `secondaryAction`. A caller
|
|
99
|
+
* passing none of them renders the same element tree as before.
|
|
85
100
|
*/
|
|
86
101
|
|
|
87
102
|
interface ErrorStateProps {
|
|
88
103
|
message: string;
|
|
89
104
|
onRetry?: () => void;
|
|
90
105
|
testID?: string;
|
|
106
|
+
/** Heading above the message (role="heading" on web). */
|
|
107
|
+
title?: string;
|
|
108
|
+
/** Rendered inside a circular well above the title; decorative (aria-hidden). */
|
|
109
|
+
icon?: React.ReactNode;
|
|
110
|
+
/** Outline button beside retry, e.g. "Back to library". */
|
|
111
|
+
secondaryAction?: ErrorStateAction;
|
|
91
112
|
}
|
|
92
|
-
declare const ErrorState: ({ message, onRetry, testID, }: ErrorStateProps) => React.ReactElement;
|
|
113
|
+
declare const ErrorState: ({ message, onRetry, testID, title, icon, secondaryAction, }: ErrorStateProps) => React.ReactElement;
|
|
93
114
|
|
|
94
115
|
/**
|
|
95
116
|
* EmptyListState - empty-collection message with an optional call-to-action.
|
|
@@ -127,6 +148,12 @@ declare const LoadingFallback: React.FC<LoadingFallbackProps>;
|
|
|
127
148
|
*
|
|
128
149
|
* Improves perceived performance (Speed Index) by showing immediate visual
|
|
129
150
|
* feedback while page content loads.
|
|
151
|
+
*
|
|
152
|
+
* Each placeholder block is a `@dloizides/ui-motion` <Skeleton> — a rounded block
|
|
153
|
+
* with a highlight band that sweeps across it (translateX shimmer). This is the ONE
|
|
154
|
+
* shimmer implementation in the kit: PageSkeleton owns only the page LAYOUT (how many
|
|
155
|
+
* bars/blocks, their sizes and spacing), not the animation. Under reduced-motion the
|
|
156
|
+
* <Skeleton> suppresses the sweep and renders a static block on its own.
|
|
130
157
|
*/
|
|
131
158
|
|
|
132
159
|
interface PageSkeletonProps {
|
|
@@ -463,10 +490,15 @@ interface AppErrorBoundaryProps {
|
|
|
463
490
|
retryable?: (error: Error) => boolean;
|
|
464
491
|
/**
|
|
465
492
|
* Called from `componentDidMount` ONLY when the mount was clean (nothing caught).
|
|
466
|
-
*
|
|
467
|
-
*
|
|
468
|
-
*
|
|
469
|
-
*
|
|
493
|
+
* Deliberately NOT called on an errored mount.
|
|
494
|
+
*
|
|
495
|
+
* ⚠️ A CLEAN MOUNT DOES NOT PROVE THE PAGE LOADED. On a lazy route the boundary commits
|
|
496
|
+
* clean because a Suspense fallback rendered, and the dynamic import rejects AFTER this
|
|
497
|
+
* fires. A guard released here is therefore released mid-failure, which is how the
|
|
498
|
+
* chunk-reload loop went unbounded. Anything wired here must be safe to call during the
|
|
499
|
+
* failure it bounds — `clearChunkRecoveryFlag` from `@dloizides/utils` >= 1.8.0 is
|
|
500
|
+
* (it refuses to release a record still inside its cooldown); a plain "reset my
|
|
501
|
+
* counter" callback is not.
|
|
470
502
|
*/
|
|
471
503
|
onMount?: () => void;
|
|
472
504
|
/**
|
|
@@ -504,4 +536,4 @@ declare class AppErrorBoundary extends Component<AppErrorBoundaryProps, AppError
|
|
|
504
536
|
render(): ReactNode;
|
|
505
537
|
}
|
|
506
538
|
|
|
507
|
-
export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, ConfirmDialog, type ConfirmDialogProps, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorState, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, createToastBus, getWarmingSnapshot, notifyWarming, settleWarming, subscribeWarming, useFeedbackUi, useFeedbackUi as useUi };
|
|
539
|
+
export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, ConfirmDialog, type ConfirmDialogProps, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorState, type ErrorStateAction, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, createToastBus, getWarmingSnapshot, notifyWarming, settleWarming, subscribeWarming, useFeedbackUi, useFeedbackUi as useUi };
|
package/dist/index.d.ts
CHANGED
|
@@ -80,16 +80,37 @@ declare const FEEDBACK_TEST_IDS: {
|
|
|
80
80
|
readonly errorBoundary: "error-boundary";
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Opt-in pieces of ErrorState: the decorative icon well and the outline secondary action.
|
|
85
|
+
* Both read colours only from the injected theme.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
interface ErrorStateAction {
|
|
89
|
+
label: string;
|
|
90
|
+
hint: string;
|
|
91
|
+
onPress: () => void;
|
|
92
|
+
testID: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
83
95
|
/**
|
|
84
96
|
* ErrorState - generic error display with optional retry button.
|
|
97
|
+
*
|
|
98
|
+
* Opt-in (1.12.0): `title`, a decorative `icon` well and a `secondaryAction`. A caller
|
|
99
|
+
* passing none of them renders the same element tree as before.
|
|
85
100
|
*/
|
|
86
101
|
|
|
87
102
|
interface ErrorStateProps {
|
|
88
103
|
message: string;
|
|
89
104
|
onRetry?: () => void;
|
|
90
105
|
testID?: string;
|
|
106
|
+
/** Heading above the message (role="heading" on web). */
|
|
107
|
+
title?: string;
|
|
108
|
+
/** Rendered inside a circular well above the title; decorative (aria-hidden). */
|
|
109
|
+
icon?: React.ReactNode;
|
|
110
|
+
/** Outline button beside retry, e.g. "Back to library". */
|
|
111
|
+
secondaryAction?: ErrorStateAction;
|
|
91
112
|
}
|
|
92
|
-
declare const ErrorState: ({ message, onRetry, testID, }: ErrorStateProps) => React.ReactElement;
|
|
113
|
+
declare const ErrorState: ({ message, onRetry, testID, title, icon, secondaryAction, }: ErrorStateProps) => React.ReactElement;
|
|
93
114
|
|
|
94
115
|
/**
|
|
95
116
|
* EmptyListState - empty-collection message with an optional call-to-action.
|
|
@@ -127,6 +148,12 @@ declare const LoadingFallback: React.FC<LoadingFallbackProps>;
|
|
|
127
148
|
*
|
|
128
149
|
* Improves perceived performance (Speed Index) by showing immediate visual
|
|
129
150
|
* feedback while page content loads.
|
|
151
|
+
*
|
|
152
|
+
* Each placeholder block is a `@dloizides/ui-motion` <Skeleton> — a rounded block
|
|
153
|
+
* with a highlight band that sweeps across it (translateX shimmer). This is the ONE
|
|
154
|
+
* shimmer implementation in the kit: PageSkeleton owns only the page LAYOUT (how many
|
|
155
|
+
* bars/blocks, their sizes and spacing), not the animation. Under reduced-motion the
|
|
156
|
+
* <Skeleton> suppresses the sweep and renders a static block on its own.
|
|
130
157
|
*/
|
|
131
158
|
|
|
132
159
|
interface PageSkeletonProps {
|
|
@@ -463,10 +490,15 @@ interface AppErrorBoundaryProps {
|
|
|
463
490
|
retryable?: (error: Error) => boolean;
|
|
464
491
|
/**
|
|
465
492
|
* Called from `componentDidMount` ONLY when the mount was clean (nothing caught).
|
|
466
|
-
*
|
|
467
|
-
*
|
|
468
|
-
*
|
|
469
|
-
*
|
|
493
|
+
* Deliberately NOT called on an errored mount.
|
|
494
|
+
*
|
|
495
|
+
* ⚠️ A CLEAN MOUNT DOES NOT PROVE THE PAGE LOADED. On a lazy route the boundary commits
|
|
496
|
+
* clean because a Suspense fallback rendered, and the dynamic import rejects AFTER this
|
|
497
|
+
* fires. A guard released here is therefore released mid-failure, which is how the
|
|
498
|
+
* chunk-reload loop went unbounded. Anything wired here must be safe to call during the
|
|
499
|
+
* failure it bounds — `clearChunkRecoveryFlag` from `@dloizides/utils` >= 1.8.0 is
|
|
500
|
+
* (it refuses to release a record still inside its cooldown); a plain "reset my
|
|
501
|
+
* counter" callback is not.
|
|
470
502
|
*/
|
|
471
503
|
onMount?: () => void;
|
|
472
504
|
/**
|
|
@@ -504,4 +536,4 @@ declare class AppErrorBoundary extends Component<AppErrorBoundaryProps, AppError
|
|
|
504
536
|
render(): ReactNode;
|
|
505
537
|
}
|
|
506
538
|
|
|
507
|
-
export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, ConfirmDialog, type ConfirmDialogProps, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorState, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, createToastBus, getWarmingSnapshot, notifyWarming, settleWarming, subscribeWarming, useFeedbackUi, useFeedbackUi as useUi };
|
|
539
|
+
export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, ConfirmDialog, type ConfirmDialogProps, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorState, type ErrorStateAction, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, createToastBus, getWarmingSnapshot, notifyWarming, settleWarming, subscribeWarming, useFeedbackUi, useFeedbackUi as useUi };
|