@danxbot/ui 3.12.2 → 3.13.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/dist/index.js +2881 -2860
- package/dist/index.js.map +1 -1
- package/dist/types/components/provenance/ProvenanceDetail.d.ts +62 -0
- package/dist/types/components/provenance/ProvenanceDisclosure.d.ts +6 -50
- package/dist/types/components/provenance/absence.d.ts +36 -0
- package/dist/types/components/provenance/index.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { ProvenanceRecord } from "./types";
|
|
3
|
+
/** The level the field name renders at. See "NO DIALOG ASSUMPTIONS" above. */
|
|
4
|
+
export type ProvenanceDetailTitleAs = "h2" | "h3" | "h4" | "h5" | "h6";
|
|
5
|
+
export interface ProvenanceDetailProps {
|
|
6
|
+
record: ProvenanceRecord;
|
|
7
|
+
/**
|
|
8
|
+
* Rendered at the foot — sign-off, correction, the cited pages themselves.
|
|
9
|
+
*
|
|
10
|
+
* A slot rather than props, because the actions a consumer offers over an
|
|
11
|
+
* extracted value are theirs: this library has no idea who is allowed to sign
|
|
12
|
+
* one, or what correcting it should do. It is also where a consumer puts the
|
|
13
|
+
* evidence it had to go and FETCH — the cited pages, their thumbnails, the
|
|
14
|
+
* audit trail — none of which this library can name.
|
|
15
|
+
*/
|
|
16
|
+
actions?: ReactNode;
|
|
17
|
+
/** Shown in place of the value when there is none and it did not fail. */
|
|
18
|
+
emptyLabel?: string;
|
|
19
|
+
/** Shown in place of the value when the viewer may not see it. */
|
|
20
|
+
redactedLabel?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Draw the VALUE yourself — an editor, most usefully.
|
|
23
|
+
*
|
|
24
|
+
* This replaces the one paragraph that prints the value, and nothing else:
|
|
25
|
+
* the field name above it, the state badge beside it, the confidence meter
|
|
26
|
+
* under it, and every row below the separator are still the component's.
|
|
27
|
+
*
|
|
28
|
+
* IT MAY BE INTERACTIVE. An `InlineEdit`, a select, a confirm/cancel pair are
|
|
29
|
+
* all legitimate — correcting a value in the surface somebody opened to judge
|
|
30
|
+
* it is the whole point of opening it, and the observed alternative is a
|
|
31
|
+
* consumer putting its editor in `actions`, which reads as "here is the
|
|
32
|
+
* value, and separately, down here, a form about some value".
|
|
33
|
+
*
|
|
34
|
+
* IT OVERRIDES THE ABSENCES TOO — redacted, empty and failed alike. A slot
|
|
35
|
+
* that disappeared whenever the value was missing would vanish in exactly the
|
|
36
|
+
* case a value editor is most wanted: a field that was never extracted is the
|
|
37
|
+
* one somebody actually has to type.
|
|
38
|
+
*
|
|
39
|
+
* The redaction gate cannot police a node you built yourself, so a consumer
|
|
40
|
+
* rendering this against a redactable record owns that one decision —
|
|
41
|
+
* `record.redacted` is right there to branch on.
|
|
42
|
+
*
|
|
43
|
+
* Passing `null` or `undefined` falls back to the built-in paragraph, so
|
|
44
|
+
* gating editability is `canEdit ? <Editor … /> : null` rather than two
|
|
45
|
+
* spellings of the whole component.
|
|
46
|
+
*/
|
|
47
|
+
valueContent?: ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Put a known id on the field-name heading, so something WRAPPING this can be
|
|
50
|
+
* labelled by it.
|
|
51
|
+
*
|
|
52
|
+
* `ProvenanceDisclosure` passes one: its popup takes `role="dialog"`, and an
|
|
53
|
+
* unlabelled dialog announces itself as nothing. An inline render normally
|
|
54
|
+
* has nothing to label and can leave this alone — a generated id is used, so
|
|
55
|
+
* the heading always has one.
|
|
56
|
+
*/
|
|
57
|
+
titleId?: string;
|
|
58
|
+
/** @default "h2" */
|
|
59
|
+
titleAs?: ProvenanceDetailTitleAs;
|
|
60
|
+
className?: string;
|
|
61
|
+
}
|
|
62
|
+
export declare function ProvenanceDetail({ record, actions, emptyLabel, redactedLabel, valueContent, titleId, titleAs: Title, className, }: ProvenanceDetailProps): import("react").JSX.Element;
|
|
@@ -4,13 +4,7 @@ import type { ProvenanceRecord } from "./types";
|
|
|
4
4
|
export type ProvenanceTriggerBadge = "icon" | "word" | "none";
|
|
5
5
|
export interface ProvenanceDisclosureProps {
|
|
6
6
|
record: ProvenanceRecord;
|
|
7
|
-
/**
|
|
8
|
-
* Rendered at the foot of the panel — sign-off, correction, "open the source".
|
|
9
|
-
*
|
|
10
|
-
* A slot rather than props, because the actions a consumer offers over an
|
|
11
|
-
* extracted value are theirs: this library has no idea who is allowed to sign
|
|
12
|
-
* one, or what correcting it should do.
|
|
13
|
-
*/
|
|
7
|
+
/** Rendered at the foot of the panel. {@link ProvenanceDetailProps.actions} */
|
|
14
8
|
actions?: ReactNode;
|
|
15
9
|
/** Shown in place of the value when there is none and it did not fail. */
|
|
16
10
|
emptyLabel?: string;
|
|
@@ -61,50 +55,12 @@ export interface ProvenanceDisclosureProps {
|
|
|
61
55
|
triggerContent?: ReactNode;
|
|
62
56
|
/**
|
|
63
57
|
* Draw the PANEL HEADER'S VALUE yourself — an editor, most usefully.
|
|
58
|
+
* {@link ProvenanceDetailProps.valueContent}
|
|
64
59
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* page is still drawn from `record`, still truncated or wrapped per
|
|
70
|
-
* `valueWrap`, still announced as part of the trigger's own name. The
|
|
71
|
-
* closed page does not change because a consumer supplied this.
|
|
72
|
-
*
|
|
73
|
-
* UNLIKE `triggerContent`, THIS MAY BE INTERACTIVE, and that is the entire
|
|
74
|
-
* reason it exists. `triggerContent` sits inside the disclosure's `<button>`,
|
|
75
|
-
* so a control there would nest a control inside a control — invalid and
|
|
76
|
-
* unfocusable. This sits in the panel body, which Base UI gives
|
|
77
|
-
* `role="dialog"` and full focus management: an `InlineEdit`, a select, a
|
|
78
|
-
* confirm/cancel pair are all legitimate here.
|
|
79
|
-
*
|
|
80
|
-
* WHY A SLOT AND NOT AN `onCorrect` PROP. The same reason `actions` is a
|
|
81
|
-
* slot: this library has no idea who is allowed to correct an extracted
|
|
82
|
-
* value, what the permitted values are, or what writing one costs. What it
|
|
83
|
-
* does know is WHERE the correction belongs — against the value, in the
|
|
84
|
-
* surface someone opened to judge it — and the observed alternative is a
|
|
85
|
-
* consumer putting its editor in `actions`, which reads as "here is the
|
|
86
|
-
* value, and separately, down here, a form about some value".
|
|
87
|
-
*
|
|
88
|
-
* IT OVERRIDES THE ABSENCES TOO — redacted, empty and failed alike — and
|
|
89
|
-
* that is a deliberate choice rather than an oversight. A slot that
|
|
90
|
-
* disappeared whenever the value was missing would vanish in exactly the
|
|
91
|
-
* case a value editor is most wanted: a field that was never extracted is
|
|
92
|
-
* the one somebody actually has to type. It would also make the header's
|
|
93
|
-
* shape depend on a state the consumer did not ask about, so an editor would
|
|
94
|
-
* silently become a read-only word for reasons invisible at the call site.
|
|
95
|
-
* The absence vocabulary is not lost — the struck-through eye, the dash and
|
|
96
|
-
* the triangle still do their whole job on the trigger, which is the surface
|
|
97
|
-
* the density argument was ever about.
|
|
98
|
-
*
|
|
99
|
-
* The redaction gate is unchanged and still worth knowing about: the panel
|
|
100
|
-
* keeps withholding the quote, the reasoning and the sign-off note from a
|
|
101
|
-
* record marked `redacted`. It cannot police a node you built yourself, so
|
|
102
|
-
* a consumer rendering this against a redactable record owns that one
|
|
103
|
-
* decision — `record.redacted` is right there to branch on.
|
|
104
|
-
*
|
|
105
|
-
* Passing `null` or `undefined` falls back to the built-in paragraph, so
|
|
106
|
-
* gating editability is `canEdit ? <Editor … /> : null` rather than two
|
|
107
|
-
* spellings of the whole component.
|
|
60
|
+
* It does not touch the trigger — the value on the page is still drawn from
|
|
61
|
+
* `record`, still truncated or wrapped per `valueWrap`, still announced as
|
|
62
|
+
* part of the trigger's own name. The closed page does not change because a
|
|
63
|
+
* consumer supplied this.
|
|
108
64
|
*/
|
|
109
65
|
valueContent?: ReactNode;
|
|
110
66
|
/**
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type IconName } from "../Icon";
|
|
3
|
+
import type { ProvenanceRecord } from "./types";
|
|
4
|
+
declare const ABSENCE: Record<"redacted" | "empty" | "failed", {
|
|
5
|
+
icon: IconName;
|
|
6
|
+
className: string;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function Absence({ kind, children }: {
|
|
9
|
+
kind: keyof typeof ABSENCE;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
/** Whether the record is withheld from this viewer. The first gate, everywhere. */
|
|
13
|
+
export declare function isRedacted(record: ProvenanceRecord): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the record's own check disproved it.
|
|
16
|
+
*
|
|
17
|
+
* Precedence matters and is asserted: a record that is BOTH withheld and failed
|
|
18
|
+
* reads as withheld, because that is the fact about this viewer. The failure is
|
|
19
|
+
* still true, but it is not theirs to act on — and showing them a failure reason
|
|
20
|
+
* drawn from a value they may not see is the leak the panel is supposed to
|
|
21
|
+
* close.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isFailed(record: ProvenanceRecord): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* What a reader is shown IN PLACE OF the value — or the value itself.
|
|
26
|
+
*
|
|
27
|
+
* Each of the three absences says which one it is: withheld from you, never
|
|
28
|
+
* extracted, or extracted and disproved. Rendering all three as an empty cell
|
|
29
|
+
* would make them indistinguishable, and they call for completely different
|
|
30
|
+
* next actions.
|
|
31
|
+
*/
|
|
32
|
+
export declare function shownValue(record: ProvenanceRecord, { emptyLabel, redactedLabel }: {
|
|
33
|
+
emptyLabel: string;
|
|
34
|
+
redactedLabel: string;
|
|
35
|
+
}): ReactNode;
|
|
36
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -109,7 +109,7 @@ export { AmbiguousTimeError, addDays, addDuration, addMonths, atMidnight, atTime
|
|
|
109
109
|
export { allDayBandSegment, dayKey, daySlots, isAllDay, packBand, packLanes, snapFractionToInstant, timeSegments, timedBandSegment, type AllDayEvent, type BandInput, type BandOptions, type BandPlacement, type BandResult, type BandSegment, type CalendarEvent, type CalendarEventId, type CalendarView, type DaySlot, type DragKind, type EventDraft, type EventPalette, type LaneInput, type LaneOptions, type LanePlacement, type PaletteEntry, type TimeSegment, type TimedEvent, type VisibleRange, } from "./lib/calendar";
|
|
110
110
|
export { RBACProvider, useRBAC, AccountMenu, DevToolsPopover, RolePermissionMatrix, ProfilePage, RolesPermissionsPage, type RBACProviderProps, type RBACHookResult, type AccountMenuProps, type DevToolsPopoverProps, type RolePermissionMatrixProps, type Permission, type Role, type User, type Team, type TeamMembership, } from "./components/rbac";
|
|
111
111
|
export { UseCaseCard, RoadmapItemCard, RoadmapSwimlaneBoard, UseCaseLedgerPage, RoadmapPage, PhaseManager, TrackManager, deriveRoadmapItemStatus, isFullyBuilt, isUnbuilt, trackIds, trackProgress, toneForIndex, CATEGORY_TONES, type Domain, type Phase, type Track, type RoadmapItem, type RoadmapItemStatus, type UseCase, type UseCaseStatus, type UseCaseDecision, type UseCaseCardProps, type RoadmapItemCardProps, type RoadmapSwimlaneBoardProps, type UseCaseLedgerPageProps, type RoadmapPageProps, type PhaseManagerProps, type TrackManagerProps, } from "./components/roadmap";
|
|
112
|
-
export { ProvenanceDisclosure, ProvenanceBadge, ConfidenceMeter, provenanceStateLabel, confidenceBand, type ProvenanceRecord, type ProvenanceState, type ProvenanceSource, type ProvenanceCheck, type ProvenanceCall, type ProvenanceSignoff, type ConfidenceBand, type ProvenanceDisclosureProps, type ProvenanceTriggerBadge, type ProvenanceBadgeProps, type ProvenanceBadgeAppearance, type ConfidenceMeterProps, } from "./components/provenance";
|
|
112
|
+
export { ProvenanceDisclosure, ProvenanceDetail, ProvenanceBadge, ConfidenceMeter, provenanceStateLabel, confidenceBand, type ProvenanceRecord, type ProvenanceState, type ProvenanceSource, type ProvenanceCheck, type ProvenanceCall, type ProvenanceSignoff, type ConfidenceBand, type ProvenanceDisclosureProps, type ProvenanceDetailProps, type ProvenanceDetailTitleAs, type ProvenanceTriggerBadge, type ProvenanceBadgeProps, type ProvenanceBadgeAppearance, type ConfidenceMeterProps, } from "./components/provenance";
|
|
113
113
|
export { createSimStore, resetSimStores, useSimSettings, setSimSettings, getNetworkSpeed, getDataSource, simulateLatency, SimNetworkError, type SimStore, type SimStoreOptions, type SimSettings, type NetworkSpeed, type DataSource, type SimNamespace, } from "./lib/sim";
|
|
114
114
|
export { NodeCanvas, LAYOUT_DEFAULTS, layoutTree, pathToNode, type NodeCanvasProps, type CanvasEdge, type CanvasLayout, type CanvasNode, type CanvasOrientation, type LayoutOptions, type NodeRenderContext, type NodeRenderer, type PlacedNode, } from "./components/node-canvas";
|
|
115
115
|
export { defineRecordType, resetRecordTypes, useRecord, useRecords, useStaleness, write, writeAll, peekRecord, readState, readStaleness, subscribeToKey, subscribeToStaleness, retainKeys, sweepRecords, setRecordStoreTenant, getRecordStoreTenant, flushRecordNotifications, resetRecordStore, recordStoreStats, UNKNOWN_STATE, normalizeTypeName, normalizeTimestamp, recordKey, isRecordRef, type RecordRef, type ReadOptions, type RecordPayload, type RecordState, type RecordTypeOptions, type RecordTypeToken, type StalenessEntry, type WriteAllResult, type WriteOptions, type WriteResult, type WriteSource, type WriteVerdict, } from "./lib/records";
|