@declarion/react 0.2.0 → 0.2.2

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 (40) hide show
  1. package/dist-lib/DraggableChildrenTable-BFkRqNSe.js +261 -0
  2. package/dist-lib/DraggableChildrenTable-BFkRqNSe.js.map +1 -0
  3. package/dist-lib/{Grid-C69-4exi.js → Grid-pE2-dvug.js} +2 -2
  4. package/dist-lib/{Grid-C69-4exi.js.map → Grid-pE2-dvug.js.map} +1 -1
  5. package/dist-lib/api/client.d.ts +7 -0
  6. package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +2 -1
  7. package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +13 -0
  8. package/dist-lib/components/detail-layout/DetailHighlights.d.ts +15 -0
  9. package/dist-lib/components/detail-layout/ErrorSummary.d.ts +11 -0
  10. package/dist-lib/components/detail-layout/FieldRow.d.ts +22 -0
  11. package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +2 -0
  12. package/dist-lib/components/detail-layout/LayoutTabs.d.ts +1 -3
  13. package/dist-lib/components/detail-layout/blockMeta.d.ts +4 -0
  14. package/dist-lib/components/detail-layout/index.d.ts +4 -0
  15. package/dist-lib/components/fields/JsonField.d.ts +1 -0
  16. package/dist-lib/components/fields/cells/factories/emptyCell.d.ts +2 -0
  17. package/dist-lib/components/primitives/SectionCard.d.ts +6 -1
  18. package/dist-lib/components/primitives/dataTableStyles.d.ts +4 -0
  19. package/dist-lib/components/primitives/index.d.ts +1 -1
  20. package/dist-lib/components/shared/AuditMetaStrip.d.ts +11 -0
  21. package/dist-lib/components/shared/HighlightsStrip.d.ts +10 -0
  22. package/dist-lib/components/shared/RecordHeader.d.ts +15 -0
  23. package/dist-lib/components/shared/StatusStepper.d.ts +13 -0
  24. package/dist-lib/components/shared/toast/DeclarionToast.d.ts +31 -0
  25. package/dist-lib/{useUserLocale-GBIXbEE6.js → dataTableStyles-B40JEa-3.js} +1778 -1678
  26. package/dist-lib/dataTableStyles-B40JEa-3.js.map +1 -0
  27. package/dist-lib/declarion-react.css +1 -1
  28. package/dist-lib/index.js +6183 -5176
  29. package/dist-lib/index.js.map +1 -1
  30. package/dist-lib/lib/toast.d.ts +49 -16
  31. package/dist-lib/stores/appearance.d.ts +3 -0
  32. package/dist-lib/types/schema.d.ts +13 -0
  33. package/dist-lib/{value-DFpIiSZ-.js → value-qao1rdkR.js} +149 -120
  34. package/dist-lib/value-qao1rdkR.js.map +1 -0
  35. package/package.json +1 -1
  36. package/dist-lib/DraggableChildrenTable-IfspXSFA.js +0 -281
  37. package/dist-lib/DraggableChildrenTable-IfspXSFA.js.map +0 -1
  38. package/dist-lib/useUserLocale-GBIXbEE6.js.map +0 -1
  39. package/dist-lib/value-DFpIiSZ-.js.map +0 -1
  40. /package/dist-lib/components/fields/cells/factories/{markdownToPlainText.d.ts → markdownPreview.d.ts} +0 -0
@@ -1,16 +1,49 @@
1
- /**
2
- * Shared toast configuration constants.
3
- *
4
- * The toaster is mounted once in `app.tsx` (sonner `<Toaster>` with
5
- * `closeButton` + `visibleToasts={5}`). Every toast emitter - the central
6
- * `ActionRunner` and the handful of direct `toast.error` callsites in
7
- * `useMutations`, `useVersionWatcher`, and form gates in `SmartDetailPage` -
8
- * MUST import this constant rather than hardcoding `Infinity` (which
9
- * piles toasts up indefinitely and overwhelms the surface).
10
- *
11
- * 60s is the chosen balance: well past human read time, short enough that
12
- * walking away does not produce a stale wall of red on return. `closeButton`
13
- * on the Toaster and the in-description Copy button cover the explicit
14
- * read-and-keep flow for users who need longer than 60s.
15
- */
16
- export declare const ERROR_TOAST_DURATION_MS = 60000;
1
+ import { type ToastType } from "../components/shared/toast/DeclarionToast";
2
+ export type { ToastType, ToastAction } from "../components/shared/toast/DeclarionToast";
3
+ /** Per-call toast options. Severity sets the defaults; these override them. */
4
+ export interface ToastOptions {
5
+ /** Auto-dismiss after this many ms. 0 = sticky. Defaults to the variant's. */
6
+ duration?: number;
7
+ /** Force sticky (never auto-dismiss) regardless of duration. */
8
+ sticky?: boolean;
9
+ /** Trailing action button - e.g. View / Retry / Undo / Reload. */
10
+ action?: {
11
+ label: string;
12
+ onClick: () => void;
13
+ };
14
+ /** Correlation id, shown top-right in mono, included when the user copies. */
15
+ requestId?: string;
16
+ /** Expandable detail block (stack trace, server payload). */
17
+ details?: string;
18
+ /** Repeats sharing a `group` roll up into one toast with a ×N badge. */
19
+ group?: string;
20
+ /** Explicit id - reuse to replace an existing toast in place (idempotent). */
21
+ id?: string;
22
+ }
23
+ /** Fields a loading toast can morph into when its async work resolves. */
24
+ export interface ToastUpdate {
25
+ type?: ToastType;
26
+ title?: string;
27
+ message?: string;
28
+ duration?: number;
29
+ sticky?: boolean;
30
+ action?: {
31
+ label: string;
32
+ onClick: () => void;
33
+ };
34
+ requestId?: string;
35
+ details?: string;
36
+ }
37
+ /** Morph an existing toast in place - the loading -> success/error path. */
38
+ declare function update(id: string, patch: ToastUpdate): void;
39
+ /** The app-wide toast API. Import this - not `sonner` - everywhere. */
40
+ export declare const toast: {
41
+ success: (title: string, message?: string, opts?: ToastOptions) => string;
42
+ info: (title: string, message?: string, opts?: ToastOptions) => string;
43
+ warning: (title: string, message?: string, opts?: ToastOptions) => string;
44
+ error: (title: string, message?: string, opts?: ToastOptions) => string;
45
+ loading: (title: string, message?: string, opts?: ToastOptions) => string;
46
+ update: typeof update;
47
+ dismiss: (id: string) => string | number;
48
+ dismissAll: () => string | number;
49
+ };
@@ -5,6 +5,7 @@ export type SidebarMode = "wide" | "collapsed";
5
5
  export type TabsPosition = "top" | "bottom";
6
6
  export type AiSurface = "command" | "panel" | "both" | "off";
7
7
  export type FaviconSource = "google" | "direct" | "none";
8
+ export type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
8
9
  export interface Appearance {
9
10
  theme: ThemeId;
10
11
  accent: AccentId;
@@ -19,6 +20,8 @@ export interface Appearance {
19
20
  aiSurface: AiSurface;
20
21
  /** Favicon source for unknown hosts in URL cells. See ui_favicon_source. */
21
22
  faviconSource: FaviconSource;
23
+ /** Where toasts appear. Read by <Toaster> in app.tsx. See ui_toast_position. */
24
+ toastPosition: ToastPosition;
22
25
  }
23
26
  export declare function applyAppearance(a: Appearance): void;
24
27
  interface AppearanceState extends Appearance {
@@ -172,6 +172,7 @@ export interface StatusGroupDef {
172
172
  initial: string;
173
173
  statuses: StatusDef[];
174
174
  transitions?: Record<string, string[]>;
175
+ display_mode?: "pill" | "stepper";
175
176
  }
176
177
  export interface PropertyDef {
177
178
  name: LocalizedString;
@@ -338,6 +339,7 @@ export interface SectionNode {
338
339
  columns?: number;
339
340
  icon?: string;
340
341
  badge?: SectionBadgeConfig;
342
+ emphasis?: "primary" | "secondary";
341
343
  }
342
344
  export interface RowConfig {
343
345
  items: LayoutNode[];
@@ -389,6 +391,15 @@ export interface LayoutNode {
389
391
  position_field?: string;
390
392
  interaction?: "navigate" | "inline_edit" | "row_edit" | "readonly";
391
393
  }
394
+ export interface AuditLineDef {
395
+ label: LocalizedString;
396
+ at?: string;
397
+ by?: string;
398
+ }
399
+ export interface AuditConfig {
400
+ enabled?: boolean;
401
+ lines?: AuditLineDef[];
402
+ }
392
403
  export interface Screen {
393
404
  type: "list" | "detail" | "custom" | "record_list";
394
405
  entity?: string;
@@ -409,6 +420,8 @@ export interface Screen {
409
420
  items?: LayoutNode[];
410
421
  sidebar?: LayoutNode[];
411
422
  sidebar_width?: string;
423
+ highlights?: string[];
424
+ audit?: AuditConfig;
412
425
  self?: boolean;
413
426
  list_width?: string;
414
427
  list_resizable?: boolean;