@declarion/react 0.32.0 → 0.34.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.
Files changed (33) hide show
  1. package/dist-lib/{ActionRunner-CaSrGpBi.js → ActionRunner-UGGvGypS.js} +676 -543
  2. package/dist-lib/{DraggableChildrenTable-CAHg7paQ.js → DraggableChildrenTable-CljdYXd_.js} +30 -30
  3. package/dist-lib/DynamicIcon-BWO6QtNF.js +261 -0
  4. package/dist-lib/{Grid-DDbBhqcl.js → Grid-5Y_iPqNW.js} +2 -2
  5. package/dist-lib/{LayoutRenderer-CelsqsZ6.js → LayoutRenderer-CoTMmvNW.js} +712 -712
  6. package/dist-lib/{MarkdownRenderer-DThy2ixe.js → MarkdownRenderer-unbncYEV.js} +1 -1
  7. package/dist-lib/RefreshControl-oeKhCjEC.js +837 -0
  8. package/dist-lib/SmartDetailPage.impl-Caxd97q6.js +1771 -0
  9. package/dist-lib/{SmartRecordListPage.impl-BKIpTNK7.js → SmartRecordListPage.impl-BF_ieDc2.js} +258 -258
  10. package/dist-lib/components/pages/DocumentsMenu.d.ts +22 -0
  11. package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +42 -0
  12. package/dist-lib/components/pages/list/ListHeader.d.ts +1 -11
  13. package/dist-lib/components/primitives/Icons.d.ts +1 -0
  14. package/dist-lib/components/primitives/Tooltip.d.ts +30 -0
  15. package/dist-lib/components/primitives/index.d.ts +2 -0
  16. package/dist-lib/components/shared/ActionResultDialog.d.ts +4 -0
  17. package/dist-lib/components/shared/RecordHeader.d.ts +2 -1
  18. package/dist-lib/components/shared/ResponsiveActionBar.d.ts +9 -1
  19. package/dist-lib/icons.js +1 -1
  20. package/dist-lib/index.js +2288 -2334
  21. package/dist-lib/lib/document-templates.d.ts +12 -0
  22. package/dist-lib/lib/download.d.ts +20 -0
  23. package/dist-lib/lib/record-documents-key.d.ts +1 -0
  24. package/dist-lib/{registry-KQyyL5Gt.js → registry-DnPK3Msj.js} +826 -826
  25. package/dist-lib/testing.js +25 -25
  26. package/dist-lib/types/api.d.ts +1 -9
  27. package/dist-lib/types/schema.d.ts +17 -1
  28. package/dist-lib/{useProperties-D74hyWIa.js → useProperties-CgRhBh0k.js} +52 -52
  29. package/dist-lib/{value-BfXXl5EE.js → value-GmL5BVFm.js} +29 -29
  30. package/package.json +1 -1
  31. package/dist-lib/DynamicIcon-DCRdxxZ7.js +0 -260
  32. package/dist-lib/RefreshControl-CorluL6r.js +0 -582
  33. package/dist-lib/SmartDetailPage.impl-USIxbl-8.js +0 -1532
@@ -0,0 +1,22 @@
1
+ import { type Entity } from "../../types/schema";
2
+ import { type ListViewState } from "./exportRequest";
3
+ export interface DocumentsMenuProps {
4
+ entityCode: string;
5
+ scope: "detail" | "list";
6
+ objectIds?: string[];
7
+ viewState?: ListViewState;
8
+ selectedIds?: string[];
9
+ locale?: string;
10
+ /** Static system-template capability from the schema projection
11
+ * (`entity.documents`). Absent/both-falsy means no SYSTEM template
12
+ * applies for this caller/tenant/entity - the button still renders if
13
+ * the lazy tenant-template probe (below) finds one. */
14
+ capability?: Entity["documents"];
15
+ /** True when the caller can manage tenant document templates (heuristic:
16
+ * `document_template` is present & readable in `schema.entities`). Gates
17
+ * the lazy `document.templates.available` visibility probe so a
18
+ * template-less, non-manager caller (the Haia default) makes ZERO extra
19
+ * network calls - Business Case 6. */
20
+ canManageTemplates?: boolean;
21
+ }
22
+ export declare function DocumentsMenu({ entityCode, scope, objectIds, viewState, selectedIds, capability, canManageTemplates, }: DocumentsMenuProps): import("react").JSX.Element | null;
@@ -0,0 +1,42 @@
1
+ import { type LocalizedString } from "../../types/schema";
2
+ interface RecordDocumentsPanelProps {
3
+ entityCode: string;
4
+ objectId: string;
5
+ /** Static system-template capability for this entity's detail scope
6
+ * (`entity.documents.generate_one` from the schema projection). When
7
+ * true the shelf always mounts (even with zero attachments yet, since a
8
+ * template applies and the caller may generate one from Generate). When
9
+ * false/absent the shelf mounts ONLY if the record already has >=1
10
+ * attached document - it never orphans visible history, but it also
11
+ * never shows an empty "no documents" shelf on an entity with nothing to
12
+ * generate and nothing generated (the Haia case). */
13
+ canGenerateOne?: boolean;
14
+ /** True when the caller can manage tenant document templates. Together with
15
+ * canGenerateOne this gates whether the attachment fetch runs at all: a
16
+ * template-less, non-manager caller (the Haia default) makes ZERO
17
+ * document.object_links calls per record view. The rare orphaned-attachment
18
+ * case (a template was removed but its current-attached docs remain) then
19
+ * surfaces only to managers on the record and to everyone via My Documents,
20
+ * which is the right trade for the stakeholder's "no gratuitous cost" bar. */
21
+ canManageTemplates?: boolean;
22
+ }
23
+ interface RecordDocument {
24
+ generated_document_id: string;
25
+ template_code: string;
26
+ template_source: string;
27
+ input?: Record<string, unknown>;
28
+ title?: LocalizedString;
29
+ output_format: string;
30
+ status: string;
31
+ download_url?: string;
32
+ filename?: string;
33
+ created_at: string;
34
+ ready_at?: string;
35
+ error_text?: string;
36
+ }
37
+ /** Pure refetchInterval predicate, exported for direct unit testing (a
38
+ * timer-driven integration test through the full useQuery/React lifecycle
39
+ * is slow and flaky; this is the actual decision logic). */
40
+ export declare function pendingPollInterval(rows: Array<Pick<RecordDocument, "status">> | undefined): number | false;
41
+ export declare function RecordDocumentsPanel({ entityCode, objectId, canGenerateOne, canManageTemplates }: RecordDocumentsPanelProps): import("react").JSX.Element | null;
42
+ export {};
@@ -8,16 +8,6 @@ export interface ListHeaderProps {
8
8
  * description). Empty = no affordance, header renders identically. The
9
9
  * affordance is inline with the title baseline: zero height delta. */
10
10
  description?: string;
11
- /** Total matching rows, from the separate count query. Undefined while
12
- * the count is in flight or after it failed. */
13
- total: number | undefined;
14
- /** Strategy used to produce `total` ("exact" | "estimated"). Drives
15
- * display precision. Undefined when no count has resolved. */
16
- countMode?: "exact" | "estimated";
17
- /** True while the count query is in flight - render a loading affordance
18
- * in the count slot instead of a number. */
19
- countPending?: boolean;
20
- loaded: number;
21
11
  toolbarActions: {
22
12
  code: string;
23
13
  action: Action;
@@ -33,4 +23,4 @@ export interface ListHeaderProps {
33
23
  /** Dispatch surface threaded into ResponsiveActionBar (plan §8 Task 10). */
34
24
  widgetContext: WidgetContext;
35
25
  }
36
- export declare function ListHeader({ title, description, total, countMode, countPending, loaded, toolbarActions, screenActionLayout, entityActionLayout, selectedIds, data, rowKey, onActionSuccess, widgetContext, }: ListHeaderProps): import("react").JSX.Element | null;
26
+ export declare function ListHeader({ title, description, toolbarActions, screenActionLayout, entityActionLayout, selectedIds, data, rowKey, onActionSuccess, widgetContext, }: ListHeaderProps): import("react").JSX.Element | null;
@@ -48,6 +48,7 @@ export declare const Icon: {
48
48
  field: FC<IconProps>;
49
49
  file: FC<IconProps>;
50
50
  "file-diff": FC<IconProps>;
51
+ filePlus: FC<IconProps>;
51
52
  filter: FC<IconProps>;
52
53
  flow: FC<IconProps>;
53
54
  folder: FC<IconProps>;
@@ -0,0 +1,30 @@
1
+ import type { FocusEventHandler, ReactNode, RefObject } from "react";
2
+ export interface AnchoredTooltip {
3
+ open: boolean;
4
+ /** Spread onto the trigger element (button, span, ...). */
5
+ triggerHandlers: {
6
+ onMouseEnter: () => void;
7
+ onMouseLeave: () => void;
8
+ onFocus: FocusEventHandler;
9
+ onBlur: () => void;
10
+ };
11
+ /** aria-describedby value for the trigger while the tooltip is open. */
12
+ describedBy: string | undefined;
13
+ /** The tooltip portal; render as a sibling of the trigger. null when empty. */
14
+ portal: ReactNode;
15
+ }
16
+ export declare function useAnchoredTooltip(ref: RefObject<HTMLElement | null>, content: string | undefined): AnchoredTooltip;
17
+ export interface TooltipProps {
18
+ /** Tooltip text. Empty/absent renders the trigger with no tooltip. */
19
+ content?: string;
20
+ children: ReactNode;
21
+ /** Extra props forwarded to the trigger wrapper (e.g. data-testid). */
22
+ triggerProps?: React.HTMLAttributes<HTMLSpanElement>;
23
+ }
24
+ export declare function Tooltip({ content, children, triggerProps }: TooltipProps): import("react").JSX.Element;
25
+ export interface InfoTooltipProps {
26
+ label: string;
27
+ size?: number;
28
+ "data-testid"?: string;
29
+ }
30
+ export declare function InfoTooltip({ label, size, ...rest }: InfoTooltipProps): import("react").JSX.Element;
@@ -15,6 +15,8 @@ export { Dropdown } from "./Dropdown";
15
15
  export type { DropdownProps } from "./Dropdown";
16
16
  export { HoverCard } from "./HoverCard";
17
17
  export type { HoverCardProps, HoverCardAlign } from "./HoverCard";
18
+ export { Tooltip, InfoTooltip } from "./Tooltip";
19
+ export type { TooltipProps, InfoTooltipProps } from "./Tooltip";
18
20
  export { Chip } from "./Chip";
19
21
  export type { ChipProps } from "./Chip";
20
22
  export { SectionCard } from "./SectionCard";
@@ -1,6 +1,10 @@
1
1
  export interface DisplayField {
2
2
  label: string;
3
3
  value: string;
4
+ type?: "text" | "download" | "link";
5
+ href?: string;
6
+ download_url?: string;
7
+ filename?: string;
4
8
  copyable?: boolean;
5
9
  monospace?: boolean;
6
10
  }
@@ -4,6 +4,7 @@ interface RecordHeaderProps {
4
4
  avatarName?: string;
5
5
  title: string;
6
6
  recordId?: string;
7
+ description?: string;
7
8
  highlights?: ReactNode;
8
9
  mode: "display" | "edit" | "create";
9
10
  dirty?: boolean;
@@ -12,5 +13,5 @@ interface RecordHeaderProps {
12
13
  right?: ReactNode;
13
14
  showTitle?: boolean;
14
15
  }
15
- export declare function RecordHeader({ icon, avatarName, title, recordId, highlights, mode, dirty, showBack, onBack, right, showTitle, }: RecordHeaderProps): import("react").JSX.Element;
16
+ export declare function RecordHeader({ icon, avatarName, title, recordId, description, highlights, mode, dirty, showBack, onBack, right, showTitle, }: RecordHeaderProps): import("react").JSX.Element;
16
17
  export {};
@@ -117,6 +117,14 @@ export interface ResponsiveActionBarProps {
117
117
  reservedRightWidth?: number;
118
118
  /** Rendering density / measurement strategy. */
119
119
  kind?: "detail" | "toolbar" | "row";
120
+ /**
121
+ * When true (default) a kind="detail" bar stretches to `width: 100%` so it
122
+ * can measure the available width and overflow into a "More" menu. Set false
123
+ * when the bar shares a single flex row with other controls (e.g. the detail
124
+ * header's Refresh/Live pill): a 100%-width bar would wrap onto its own line.
125
+ * Content-sized is safe for the header slot, which carries few actions.
126
+ */
127
+ fillContainer?: boolean;
120
128
  /**
121
129
  * Test seam: when provided, overrides the measurement decision for each
122
130
  * node. Return true = node fits inline; false = overflows to More.
@@ -176,4 +184,4 @@ export interface ResponsiveActionBarProps {
176
184
  * kind="row": single kebab "⋮" with all actions in dropdown.
177
185
  * kind default: "toolbar".
178
186
  */
179
- export declare function ResponsiveActionBar({ layout, row, rowSelection, onRun, reservedRightWidth, kind, measurementOverride, entityActions, globalActions, ariaLabel, trailingNormalItems, trailingDestructiveItems, widgetContext, onActionClick, }: ResponsiveActionBarProps): import("react").JSX.Element | null;
187
+ export declare function ResponsiveActionBar({ layout, row, rowSelection, onRun, reservedRightWidth, kind, fillContainer, measurementOverride, entityActions, globalActions, ariaLabel, trailingNormalItems, trailingDestructiveItems, widgetContext, onActionClick, }: ResponsiveActionBarProps): import("react").JSX.Element | null;
package/dist-lib/icons.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./DynamicIcon-DCRdxxZ7.js";
1
+ import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./DynamicIcon-BWO6QtNF.js";
2
2
  export { o as DynamicIcon, a as Icon, n as LucideIcon, i as getIcon, t as getIconRegistryVersion, e as setIconRegistry, r as subscribeIconRegistry };