@dloizides/ui-feedback 1.19.2 → 1.20.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 CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.20.0
4
+
5
+ - `ToastHost`: new toast type `warning` (AML-TOAST-1 "Manual screening banner colour follows the result"), filled from `theme.semantic.warning` with an ink at 4.5:1 or better and its own glyph (▲), announced politely like success and info. A theme without a `warning` scale uses the `info` colours, never `error`.
6
+ - `createToastBus`: new `warning(text)`.
7
+
3
8
  ## 1.19.0
4
9
 
5
10
  - Error reference (OBS-1 "Every app ships metrics, production-grade logs and alerts with working links", D-OBS-23 option A): `ErrorState` takes `error` and `AsyncSurface` passes its new `error` prop through; when the error carries a `traceId` (`@dloizides/bff-web-client` >= 1.4.0) a row "Error reference: <id>" + Copy (56x48 hit box, Copied / Copy failed for 1.5 s) sits below Retry / Back. Hidden without an id, so existing callers render the same tree.
package/README.md CHANGED
@@ -98,6 +98,7 @@ export const toastBus = createToastBus();
98
98
  // anywhere — no provider needed:
99
99
  useMutation({ onSuccess: () => toastBus.success(FM('menu.saved')) });
100
100
  toastBus.error(FM('menu.saveFailed'));
101
+ toastBus.warning(FM('menu.needsReview'));
101
102
  toastBus.emit(FM('menu.queued'), 'info'); // explicit type; defaults to 'info'
102
103
  ```
103
104
 
package/dist/index.d.mts CHANGED
@@ -252,7 +252,7 @@ declare const ConfirmDialog: ({ visible, title, message, onConfirm, onCancel, co
252
252
  * `@dloizides/ui-forms` `menuPortal` and `@dloizides/ui-tables` `SizeDropdown`. Native stays in-tree.
253
253
  */
254
254
 
255
- type ToastType = 'success' | 'info' | 'error';
255
+ type ToastType = 'success' | 'info' | 'error' | 'warning';
256
256
  /** What the app pushes through the `subscribe` port. */
257
257
  interface ToastInput {
258
258
  text: string;
@@ -379,6 +379,8 @@ interface ToastBus {
379
379
  error(text: string, cause?: unknown): void;
380
380
  /** Emit an informational toast. */
381
381
  info(text: string): void;
382
+ /** Emit a warning toast. */
383
+ warning(text: string): void;
382
384
  }
383
385
  /**
384
386
  * Create an independent toast bus. Emitting with no subscriber is a silent no-op
package/dist/index.d.ts CHANGED
@@ -252,7 +252,7 @@ declare const ConfirmDialog: ({ visible, title, message, onConfirm, onCancel, co
252
252
  * `@dloizides/ui-forms` `menuPortal` and `@dloizides/ui-tables` `SizeDropdown`. Native stays in-tree.
253
253
  */
254
254
 
255
- type ToastType = 'success' | 'info' | 'error';
255
+ type ToastType = 'success' | 'info' | 'error' | 'warning';
256
256
  /** What the app pushes through the `subscribe` port. */
257
257
  interface ToastInput {
258
258
  text: string;
@@ -379,6 +379,8 @@ interface ToastBus {
379
379
  error(text: string, cause?: unknown): void;
380
380
  /** Emit an informational toast. */
381
381
  info(text: string): void;
382
+ /** Emit a warning toast. */
383
+ warning(text: string): void;
382
384
  }
383
385
  /**
384
386
  * Create an independent toast bus. Emitting with no subscriber is a silent no-op
package/dist/index.js CHANGED
@@ -763,11 +763,13 @@ var TOAST_TOP_WEB = APP_HEADER_HEIGHT + HEADER_GAP;
763
763
  var GLYPHS = {
764
764
  success: "\u2713",
765
765
  error: "!",
766
- info: "i"
766
+ info: "i",
767
+ warning: "\u25B2"
767
768
  };
768
769
  function scaleFor(theme, type) {
769
770
  if (type === "error") return theme.semantic.error;
770
771
  if (type === "success") return theme.semantic.success ?? theme.palette.primary;
772
+ if (type === "warning") return theme.semantic.warning ?? theme.palette.primary;
771
773
  return theme.palette.primary;
772
774
  }
773
775
  function readableInk(fill) {
@@ -919,7 +921,8 @@ var ToastHost = ({
919
921
  () => ({
920
922
  success: resolveToastTone(theme, "success"),
921
923
  error: resolveToastTone(theme, "error"),
922
- info: resolveToastTone(theme, "info")
924
+ info: resolveToastTone(theme, "info"),
925
+ warning: resolveToastTone(theme, "warning")
923
926
  }),
924
927
  [theme]
925
928
  );
@@ -1108,6 +1111,9 @@ function createToastBus() {
1108
1111
  },
1109
1112
  info(text) {
1110
1113
  emit2(text, "info");
1114
+ },
1115
+ warning(text) {
1116
+ emit2(text, "warning");
1111
1117
  }
1112
1118
  };
1113
1119
  }