@danxbot/ui 3.13.0 → 4.1.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 +3719 -3634
- package/dist/index.js.map +1 -1
- package/dist/types/components/provenance/ConfidenceMeter.d.ts +8 -2
- package/dist/types/components/provenance/ConfidenceReadout.d.ts +17 -0
- package/dist/types/components/provenance/ProvenanceDetail.d.ts +15 -1
- package/dist/types/components/provenance/ProvenanceDisclosure.d.ts +3 -1
- package/dist/types/components/provenance/RatingPips.d.ts +109 -0
- package/dist/types/components/provenance/index.d.ts +2 -0
- package/dist/types/components/provenance/types.d.ts +74 -3
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { type ConfidenceScore } from "./types";
|
|
1
2
|
export interface ConfidenceMeterProps {
|
|
2
|
-
/**
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* A 0–1 score from `confidenceScore()`, or null when nothing scored it.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately NOT a plain number — see the header. A raw literal will not
|
|
7
|
+
* type-check, which is what keeps a "4 out of 5" out of a percentage.
|
|
8
|
+
*/
|
|
9
|
+
confidence: ConfidenceScore | null;
|
|
4
10
|
/**
|
|
5
11
|
* What to say when there is no score.
|
|
6
12
|
*
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ProvenanceConfidence } from "./types";
|
|
2
|
+
export interface ConfidenceReadoutProps {
|
|
3
|
+
confidence: ProvenanceConfidence | null;
|
|
4
|
+
/**
|
|
5
|
+
* What to say when nothing scored it.
|
|
6
|
+
*
|
|
7
|
+
* Text rather than an empty bar, because a bar at zero and a bar with nothing
|
|
8
|
+
* to show look identical and mean opposite things.
|
|
9
|
+
*/
|
|
10
|
+
unscoredLabel?: string;
|
|
11
|
+
/** What a RATING is of, at the head of its accessible name. @default "Confidence" */
|
|
12
|
+
ratingLabel?: string;
|
|
13
|
+
/** Hides the band name on a SCORE, for dense rows where the bar is enough. */
|
|
14
|
+
compact?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function ConfidenceReadout({ confidence, unscoredLabel, ratingLabel, compact, className, }: ConfidenceReadoutProps): import("react").JSX.Element;
|
|
@@ -18,6 +18,20 @@ export interface ProvenanceDetailProps {
|
|
|
18
18
|
emptyLabel?: string;
|
|
19
19
|
/** Shown in place of the value when the viewer may not see it. */
|
|
20
20
|
redactedLabel?: string;
|
|
21
|
+
/**
|
|
22
|
+
* YOUR word for what a discrete rating is a rating OF — "Self-rated
|
|
23
|
+
* certainty", "Reviewer score" — at the head of its accessible name and
|
|
24
|
+
* tooltip.
|
|
25
|
+
*
|
|
26
|
+
* A rating is drawn as pips and pips carry no words on their face, so this is
|
|
27
|
+
* the only place its meaning is stated to a reader who stops on it. The
|
|
28
|
+
* library's own default is the blandest true word, because a default naming
|
|
29
|
+
* anybody's domain would be a lie in everybody else's. Ignored for a
|
|
30
|
+
* continuous score, which says its own band aloud.
|
|
31
|
+
*
|
|
32
|
+
* @default "Confidence"
|
|
33
|
+
*/
|
|
34
|
+
ratingLabel?: string;
|
|
21
35
|
/**
|
|
22
36
|
* Draw the VALUE yourself — an editor, most usefully.
|
|
23
37
|
*
|
|
@@ -59,4 +73,4 @@ export interface ProvenanceDetailProps {
|
|
|
59
73
|
titleAs?: ProvenanceDetailTitleAs;
|
|
60
74
|
className?: string;
|
|
61
75
|
}
|
|
62
|
-
export declare function ProvenanceDetail({ record, actions, emptyLabel, redactedLabel, valueContent, titleId, titleAs: Title, className, }: ProvenanceDetailProps): import("react").JSX.Element;
|
|
76
|
+
export declare function ProvenanceDetail({ record, actions, emptyLabel, redactedLabel, ratingLabel, valueContent, titleId, titleAs: Title, className, }: ProvenanceDetailProps): import("react").JSX.Element;
|
|
@@ -10,6 +10,8 @@ export interface ProvenanceDisclosureProps {
|
|
|
10
10
|
emptyLabel?: string;
|
|
11
11
|
/** Shown in place of the value when the viewer may not see it. */
|
|
12
12
|
redactedLabel?: string;
|
|
13
|
+
/** Your word for what a discrete rating is OF. {@link ProvenanceDetailProps.ratingLabel} */
|
|
14
|
+
ratingLabel?: string;
|
|
13
15
|
/**
|
|
14
16
|
* How the state reads ON THE TRIGGER. The panel always shows icon + word.
|
|
15
17
|
*
|
|
@@ -83,4 +85,4 @@ export interface ProvenanceDisclosureProps {
|
|
|
83
85
|
onOpenChange?: (open: boolean) => void;
|
|
84
86
|
className?: string;
|
|
85
87
|
}
|
|
86
|
-
export declare function ProvenanceDisclosure({ record, actions, emptyLabel, redactedLabel, triggerBadge, valueWrap, triggerContent, valueContent, onOpenChange, className, }: ProvenanceDisclosureProps): import("react").JSX.Element;
|
|
88
|
+
export declare function ProvenanceDisclosure({ record, actions, emptyLabel, redactedLabel, ratingLabel, triggerBadge, valueWrap, triggerContent, valueContent, onOpenChange, className, }: ProvenanceDisclosureProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
declare const pips: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
size: {
|
|
4
|
+
xs: {
|
|
5
|
+
root: string;
|
|
6
|
+
pip: string;
|
|
7
|
+
};
|
|
8
|
+
sm: {
|
|
9
|
+
root: string;
|
|
10
|
+
pip: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
band: {
|
|
14
|
+
high: {
|
|
15
|
+
pip: string;
|
|
16
|
+
};
|
|
17
|
+
moderate: {
|
|
18
|
+
pip: string;
|
|
19
|
+
};
|
|
20
|
+
low: {
|
|
21
|
+
pip: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}, {
|
|
25
|
+
root: string;
|
|
26
|
+
pip: string;
|
|
27
|
+
}, undefined, {
|
|
28
|
+
size: {
|
|
29
|
+
xs: {
|
|
30
|
+
root: string;
|
|
31
|
+
pip: string;
|
|
32
|
+
};
|
|
33
|
+
sm: {
|
|
34
|
+
root: string;
|
|
35
|
+
pip: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
band: {
|
|
39
|
+
high: {
|
|
40
|
+
pip: string;
|
|
41
|
+
};
|
|
42
|
+
moderate: {
|
|
43
|
+
pip: string;
|
|
44
|
+
};
|
|
45
|
+
low: {
|
|
46
|
+
pip: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}, {
|
|
50
|
+
root: string;
|
|
51
|
+
pip: string;
|
|
52
|
+
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
53
|
+
size: {
|
|
54
|
+
xs: {
|
|
55
|
+
root: string;
|
|
56
|
+
pip: string;
|
|
57
|
+
};
|
|
58
|
+
sm: {
|
|
59
|
+
root: string;
|
|
60
|
+
pip: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
band: {
|
|
64
|
+
high: {
|
|
65
|
+
pip: string;
|
|
66
|
+
};
|
|
67
|
+
moderate: {
|
|
68
|
+
pip: string;
|
|
69
|
+
};
|
|
70
|
+
low: {
|
|
71
|
+
pip: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
}, {
|
|
75
|
+
root: string;
|
|
76
|
+
pip: string;
|
|
77
|
+
}>>;
|
|
78
|
+
/** How big the ticks are. See the two variants above for where each is used. */
|
|
79
|
+
export type RatingPipsSize = NonNullable<VariantProps<typeof pips>["size"]>;
|
|
80
|
+
export interface RatingPipsProps {
|
|
81
|
+
/**
|
|
82
|
+
* The rating itself, on `scale`. Null when nothing rated it — which draws the
|
|
83
|
+
* empty box rather than nothing at all, so the row keeps its height.
|
|
84
|
+
*/
|
|
85
|
+
rating: number | null;
|
|
86
|
+
/** The top of the scale — the "5" in "4 out of 5". */
|
|
87
|
+
scale: number;
|
|
88
|
+
/**
|
|
89
|
+
* What the rating is OF, used verbatim at the head of the accessible name and
|
|
90
|
+
* the tooltip: `"<label> 3 of 5"`.
|
|
91
|
+
*
|
|
92
|
+
* A default that named the consumer's domain would be a lie in every other
|
|
93
|
+
* consumer, so it is the blandest true word.
|
|
94
|
+
*
|
|
95
|
+
* @default "Confidence"
|
|
96
|
+
*/
|
|
97
|
+
label?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Draw the pips at full marks too.
|
|
100
|
+
*
|
|
101
|
+
* @default false — see "FULL MARKS DRAW NOTHING" above.
|
|
102
|
+
*/
|
|
103
|
+
showWhenFull?: boolean;
|
|
104
|
+
/** @default "sm" */
|
|
105
|
+
size?: RatingPipsSize;
|
|
106
|
+
className?: string;
|
|
107
|
+
}
|
|
108
|
+
export declare function RatingPips({ rating, scale, label, showWhenFull, size, className, }: RatingPipsProps): import("react").JSX.Element;
|
|
109
|
+
export {};
|
|
@@ -56,8 +56,12 @@ export interface ProvenanceRecord {
|
|
|
56
56
|
/** Null when it failed, or when the viewer may not see it. */
|
|
57
57
|
value: ReactNode | null;
|
|
58
58
|
state: ProvenanceState;
|
|
59
|
-
/**
|
|
60
|
-
|
|
59
|
+
/**
|
|
60
|
+
* How sure the author was, on whichever scale they said it — `scoredConfidence`
|
|
61
|
+
* for a continuous 0–1 figure, `ratedConfidence` for "4 out of 5". Null when
|
|
62
|
+
* nothing scored it, which is a different claim from a score of zero.
|
|
63
|
+
*/
|
|
64
|
+
confidence: ProvenanceConfidence | null;
|
|
61
65
|
source: ProvenanceSource | null;
|
|
62
66
|
reasoning: string | null;
|
|
63
67
|
check: ProvenanceCheck | null;
|
|
@@ -73,6 +77,73 @@ export interface ProvenanceRecord {
|
|
|
73
77
|
*/
|
|
74
78
|
redacted?: boolean;
|
|
75
79
|
}
|
|
80
|
+
declare const CONFIDENCE_SCORE: unique symbol;
|
|
81
|
+
/**
|
|
82
|
+
* A confidence on the CONTINUOUS 0–1 scale — the one thing that may be drawn as
|
|
83
|
+
* a percentage.
|
|
84
|
+
*
|
|
85
|
+
* Nominal on purpose. It IS a number at runtime and arithmetic on it behaves
|
|
86
|
+
* exactly as it reads, but a raw `0.94` is not assignable to it. `confidenceScore`
|
|
87
|
+
* is the only way in, and is therefore the one place a range can be checked.
|
|
88
|
+
*/
|
|
89
|
+
export type ConfidenceScore = number & {
|
|
90
|
+
readonly [CONFIDENCE_SCORE]: "score";
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Mint a 0–1 score.
|
|
94
|
+
*
|
|
95
|
+
* Out of range is CLAMPED and warned about rather than thrown: the caller most
|
|
96
|
+
* likely to be out of range is one holding a rating on some other scale, and a
|
|
97
|
+
* blank page is a worse outcome than a bar at one end with a line in the console
|
|
98
|
+
* naming the function that fixes it.
|
|
99
|
+
*/
|
|
100
|
+
export declare function confidenceScore(value: number): ConfidenceScore;
|
|
101
|
+
/**
|
|
102
|
+
* HOW SURE THE AUTHOR WAS, carrying WHICH KIND OF SCALE it was said on.
|
|
103
|
+
*
|
|
104
|
+
* Never written as a literal — see the brand above. `scoredConfidence` and
|
|
105
|
+
* `ratedConfidence` are the two doors, and which door a value came through is
|
|
106
|
+
* what the renderer dispatches on.
|
|
107
|
+
*/
|
|
108
|
+
export type ProvenanceConfidence =
|
|
109
|
+
/** Continuous 0–1. Drawn as a banded meter with its percentage. */
|
|
110
|
+
{
|
|
111
|
+
readonly kind: "score";
|
|
112
|
+
readonly score: ConfidenceScore;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* `rating` out of `scale`, both whole numbers. Drawn as pips — one per point
|
|
116
|
+
* — because the scale's own granularity is the finest thing that can honestly
|
|
117
|
+
* be shown.
|
|
118
|
+
*/
|
|
119
|
+
| {
|
|
120
|
+
readonly kind: "rating";
|
|
121
|
+
readonly rating: number;
|
|
122
|
+
readonly scale: number;
|
|
123
|
+
};
|
|
124
|
+
/** A continuous 0–1 confidence, for a record. */
|
|
125
|
+
export declare function scoredConfidence(value: number): ProvenanceConfidence;
|
|
126
|
+
/**
|
|
127
|
+
* A discrete `rating` out of `scale`, for a record.
|
|
128
|
+
*
|
|
129
|
+
* The denominator travels WITH the number, because "4" means nothing on its own
|
|
130
|
+
* and every consumer that has had to pass a rating around without one has ended
|
|
131
|
+
* up hard-coding the scale at the far end.
|
|
132
|
+
*/
|
|
133
|
+
export declare function ratedConfidence(rating: number, scale: number): ProvenanceConfidence;
|
|
76
134
|
/** 0..1 to a band. A bare percentage invites false precision. */
|
|
77
135
|
export type ConfidenceBand = "high" | "moderate" | "low";
|
|
78
|
-
export declare function confidenceBand(confidence:
|
|
136
|
+
export declare function confidenceBand(confidence: ConfidenceScore): ConfidenceBand;
|
|
137
|
+
/**
|
|
138
|
+
* A RATING to the same three bands, so pips and a meter agree about what
|
|
139
|
+
* "moderate" looks like.
|
|
140
|
+
*
|
|
141
|
+
* Full marks are their own band — `high` — and the rest fall where the same
|
|
142
|
+
* thresholds put them once the rating is read as a fraction of its own scale.
|
|
143
|
+
* That is the only conversion to a fraction anywhere in this file, and it feeds
|
|
144
|
+
* a COLOUR rather than a printed figure, which is the distinction the whole
|
|
145
|
+
* split rests on: a band is a judgement three values wide and survives the trip;
|
|
146
|
+
* a percentage is a figure and does not.
|
|
147
|
+
*/
|
|
148
|
+
export declare function ratingBand(rating: number, scale: number): ConfidenceBand;
|
|
149
|
+
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, 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";
|
|
112
|
+
export { ProvenanceDisclosure, ProvenanceDetail, ProvenanceBadge, ConfidenceReadout, ConfidenceMeter, RatingPips, provenanceStateLabel, confidenceBand, ratingBand, confidenceScore, scoredConfidence, ratedConfidence, type ProvenanceRecord, type ProvenanceState, type ProvenanceSource, type ProvenanceCheck, type ProvenanceCall, type ProvenanceSignoff, type ConfidenceBand, type ConfidenceScore, type ProvenanceConfidence, type ConfidenceReadoutProps, type RatingPipsProps, type RatingPipsSize, 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";
|