@danxbot/ui 7.1.0 → 7.3.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.
@@ -0,0 +1,17 @@
1
+ export declare const startOfDay: (d: Date) => Date;
2
+ export type DateRange = {
3
+ from: Date | null;
4
+ to: Date | null;
5
+ };
6
+ export interface DateCalendarProps {
7
+ /** A single date, or a range when `range` is set. */
8
+ value?: Date | DateRange | null;
9
+ onValueChange?: (value: Date | DateRange | null) => void;
10
+ range?: boolean;
11
+ min?: Date;
12
+ max?: Date;
13
+ /** Disable specific days — weekends, holidays, taken slots. */
14
+ isDateDisabled?: (date: Date) => boolean;
15
+ className?: string;
16
+ }
17
+ export declare function DateCalendar({ value, onValueChange, range, min, max, isDateDisabled, className, }: DateCalendarProps): import("react").JSX.Element;
@@ -0,0 +1,29 @@
1
+ export interface DateFieldProps {
2
+ /** The stored ISO calendar date (`YYYY-MM-DD`), or null for none. */
3
+ value: string | null;
4
+ /** Reports the new ISO date, or null when the person cleared it. Only on commit. */
5
+ onValueChange: (value: string | null) => void;
6
+ /** Told when the box gains and loses focus — i.e. while the person's own text is on screen. */
7
+ onEditingChange?: (editing: boolean) => void;
8
+ /** The accessible name. Required: a date box with no name is a box nobody can find. */
9
+ "aria-label": string;
10
+ /** @default "MM/DD/YYYY" */
11
+ placeholder?: string;
12
+ disabled?: boolean;
13
+ /** The sentence shown for typed text that is not a date. */
14
+ invalidMessage?: string;
15
+ className?: string;
16
+ }
17
+ export declare function DateField({ value, onValueChange, onEditingChange, "aria-label": ariaLabel, placeholder, disabled, invalidMessage, className, }: DateFieldProps): import("react").JSX.Element;
18
+ export interface DateTimeFieldProps {
19
+ /** The stored ISO instant, or null for none. */
20
+ value: string | null;
21
+ /** Reports the new ISO instant, or null when the date was cleared. Only on commit. */
22
+ onValueChange: (value: string | null) => void;
23
+ /** Told while either half has focus. */
24
+ onEditingChange?: (editing: boolean) => void;
25
+ "aria-label": string;
26
+ disabled?: boolean;
27
+ className?: string;
28
+ }
29
+ export declare function DateTimeField({ value, onValueChange, onEditingChange, "aria-label": ariaLabel, disabled, className, }: DateTimeFieldProps): import("react").JSX.Element;
@@ -1,7 +1,5 @@
1
- export type DateRange = {
2
- from: Date | null;
3
- to: Date | null;
4
- };
1
+ import { type DateRange } from "./DateCalendar";
2
+ export type { DateRange };
5
3
  export interface DatePickerProps {
6
4
  /** A single date, or a range when `range` is set. */
7
5
  value?: Date | DateRange | null;
@@ -134,20 +134,4 @@ export declare function ratedConfidence(rating: number, scale: number): Provenan
134
134
  /** 0..1 to a band. A bare percentage invites false precision. */
135
135
  export type ConfidenceBand = "high" | "moderate" | "low";
136
136
  export declare function confidenceBand(confidence: ConfidenceScore): ConfidenceBand;
137
- /** One of the five steps of the confidence scale — see `ConfidenceBar` for the colours. */
138
- export type ConfidenceLevel = 1 | 2 | 3 | 4 | 5;
139
- /**
140
- * A RATING to one of the five confidence steps, or null when there is no
141
- * rating on a real scale to draw.
142
- *
143
- * A five-point rating maps one-to-one. Any other scale is mapped by its
144
- * fraction, so a colour keeps one meaning whatever scale a consumer rates on.
145
- * A rating below one step is "not rated", never level 1: a zero is the absence
146
- * of a rating, and drawing it as the lowest earned level would claim a
147
- * judgement nobody made.
148
- *
149
- * The fraction feeds a COLOUR, never a printed figure — a step is a judgement
150
- * five values wide and survives the trip; a percentage is a figure and does not.
151
- */
152
- export declare function confidenceLevel(rating: number, scale: number): ConfidenceLevel | null;
153
137
  export {};
@@ -35,6 +35,8 @@ export { ThemeMenu, type ThemeMenuProps } from "./components/ThemeMenu";
35
35
  export { AppShell, type AppShellProps, type NavItem, type NavSection, } from "./components/AppShell";
36
36
  export { FileUpload, type FileUploadProps, type UploadFile } from "./components/FileUpload";
37
37
  export { DatePicker, type DatePickerProps, type DateRange } from "./components/DatePicker";
38
+ export { DateCalendar, type DateCalendarProps } from "./components/DateCalendar";
39
+ export { DateField, DateTimeField, type DateFieldProps, type DateTimeFieldProps, } from "./components/DateField";
38
40
  export { Tree, type TreeProps, type TreeNode } from "./components/Tree";
39
41
  export { CommandPalette, useCommandPalette, type CommandPaletteProps, type CommandItem, } from "./components/CommandPalette";
40
42
  export { Slider, type SliderProps, type SliderMark } from "./components/Slider";
@@ -115,7 +117,8 @@ export { AmbiguousTimeError, addDays, addDuration, addMonths, atMidnight, atTime
115
117
  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";
116
118
  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";
117
119
  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";
118
- export { ProvenanceDisclosure, ProvenanceDetail, ProvenanceBadge, ConfidenceReadout, ConfidenceMeter, ConfidenceBar, provenanceStateLabel, confidenceBand, confidenceLevel, confidenceScore, scoredConfidence, ratedConfidence, type ProvenanceRecord, type ProvenanceState, type ProvenanceSource, type ProvenanceCheck, type ProvenanceCall, type ProvenanceSignoff, type ConfidenceBand, type ConfidenceScore, type ProvenanceConfidence, type ConfidenceReadoutProps, type ConfidenceLevel, type ConfidenceBarProps, type ConfidenceBarSize, type ProvenanceDisclosureProps, type ProvenanceDetailProps, type ProvenanceDetailTitleAs, type ProvenanceTriggerBadge, type ProvenanceBadgeProps, type ProvenanceBadgeAppearance, type ConfidenceMeterProps, } from "./components/provenance";
120
+ export { ProvenanceDisclosure, ProvenanceDetail, ProvenanceBadge, ConfidenceReadout, ConfidenceMeter, ConfidenceBar, provenanceStateLabel, confidenceBand, confidenceScore, scoredConfidence, ratedConfidence, type ProvenanceRecord, type ProvenanceState, type ProvenanceSource, type ProvenanceCheck, type ProvenanceCall, type ProvenanceSignoff, type ConfidenceBand, type ConfidenceScore, type ProvenanceConfidence, type ConfidenceReadoutProps, type ConfidenceBarProps, type ConfidenceBarSize, type ProvenanceDisclosureProps, type ProvenanceDetailProps, type ProvenanceDetailTitleAs, type ProvenanceTriggerBadge, type ProvenanceBadgeProps, type ProvenanceBadgeAppearance, type ConfidenceMeterProps, } from "./components/provenance";
121
+ export { confidenceLevel, CONFIDENCE_LEVEL_LABELS, type ConfidenceLevel } from "./lib/confidence";
119
122
  export { createSimStore, resetSimStores, useSimSettings, setSimSettings, getNetworkSpeed, getDataSource, simulateLatency, SimNetworkError, type SimStore, type SimStoreOptions, type SimSettings, type NetworkSpeed, type DataSource, type SimNamespace, } from "./lib/sim";
120
123
  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";
121
124
  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";
@@ -0,0 +1,23 @@
1
+ /** One of the five steps of the confidence scale — see `ConfidenceBar` for how each is drawn. */
2
+ export type ConfidenceLevel = 1 | 2 | 3 | 4 | 5;
3
+ /**
4
+ * A RATING to one of the five confidence steps, or null when there is no
5
+ * rating on a real scale to draw.
6
+ *
7
+ * A five-point rating maps one-to-one. Any other scale is mapped by its
8
+ * fraction, so a colour and a length keep one meaning whatever scale a consumer
9
+ * rates on. A rating below one step is "not rated", never level 1: a zero is
10
+ * the absence of a rating, and drawing it as the lowest earned level would
11
+ * claim a judgement nobody made.
12
+ *
13
+ * The fraction feeds a COLOUR and a LENGTH, never a printed figure — a step is
14
+ * a judgement five values wide and survives the trip; a percentage is a figure
15
+ * and does not.
16
+ */
17
+ export declare function confidenceLevel(rating: number, scale: number): ConfidenceLevel | null;
18
+ /**
19
+ * Each level's own word, the operator's scale (SG-843): 4 is "Confident" and 5
20
+ * is "Highly confident", so the two readings of "fine" stay distinguishable in
21
+ * words exactly as they are in colour and length.
22
+ */
23
+ export declare const CONFIDENCE_LEVEL_LABELS: Readonly<Record<ConfidenceLevel, string>>;
@@ -40,3 +40,4 @@
40
40
  */
41
41
  export { formatBytes, formatTokens, formatCompactNumber } from "./lib/format";
42
42
  export { formatDate, parseDate, formatDateTime, parseDateTime, type FormatDateTimeOptions, type ParseDateTimeOptions, formatCurrency, parseCurrency, formatPhone, parsePhone, formatNumber, parseNumber, type FormatNumberOptions, formatBoolean, parseBoolean, type FormatBooleanOptions, } from "./lib/values";
43
+ export { confidenceLevel, CONFIDENCE_LEVEL_LABELS, type ConfidenceLevel } from "./lib/confidence";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danxbot/ui",
3
- "version": "7.1.0",
3
+ "version": "7.3.0",
4
4
  "type": "module",
5
5
  "description": "Danxbot — a domain-agnostic React design system with motion as a first-class primitive.",
6
6
  "license": "MIT",