@danxbot/ui 18.2.0 → 18.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.
- package/dist/index.js +12134 -11531
- package/dist/index.js.map +1 -1
- package/dist/types/components/Popover.d.ts +9 -8
- package/dist/types/components/chart/TimeSeriesChart.d.ts +62 -0
- package/dist/types/components/chart/time-series-scale.d.ts +29 -0
- package/dist/types/components/rbac/AccessRequestPanel.d.ts +35 -0
- package/dist/types/components/rbac/RoleKeyPicker.d.ts +22 -0
- package/dist/types/components/rbac/index.d.ts +2 -0
- package/dist/types/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -127,14 +127,15 @@ interface TooltipBaseProps {
|
|
|
127
127
|
* question about the popup ("can this be entered?"), never about a flag
|
|
128
128
|
* named after its own negation.
|
|
129
129
|
*
|
|
130
|
-
* DEFAULT
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
130
|
+
* DEFAULT FALSE (DX-4349). A tooltip is a label, not a surface (see
|
|
131
|
+
* `content`: "anything interactive belongs in a Popover"), and a label
|
|
132
|
+
* that holds itself open under the pointer is a trap wherever marks sit
|
|
133
|
+
* side by side: the popup is drawn right over the neighbouring marks, so
|
|
134
|
+
* moving toward the next one lands on the popup, keeps it open and blocks
|
|
135
|
+
* the mark underneath. Opt IN only for a tooltip whose text a reader must
|
|
136
|
+
* be able to point into and keep reading (WCAG 1.4.13 "hoverable") and that
|
|
137
|
+
* sits clear of other controls.
|
|
138
|
+
* @default false
|
|
138
139
|
*/
|
|
139
140
|
enterable?: boolean;
|
|
140
141
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type Ref } from "react";
|
|
2
|
+
export type TimeSeriesRole = "member" | "other";
|
|
3
|
+
export interface TimeSeriesSeries {
|
|
4
|
+
/** Unique within the chart. */
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
/** `other` is the neutral remainder: drawn last, in a neutral tone, never selectable. @default "member" */
|
|
8
|
+
role?: TimeSeriesRole;
|
|
9
|
+
/** One value per bucket, same order. Finite and >= 0 — anything else throws. */
|
|
10
|
+
points: readonly number[];
|
|
11
|
+
}
|
|
12
|
+
/** A named kind of unmeasured span: its label is its legend entry. At most two (45 and 135 degree hatching). */
|
|
13
|
+
export interface TimeSeriesBlockKind {
|
|
14
|
+
key: string;
|
|
15
|
+
label: string;
|
|
16
|
+
}
|
|
17
|
+
/** A span the chart cannot place in time, drawn hatched in the bucket that holds `at`. */
|
|
18
|
+
export interface TimeSeriesBlock {
|
|
19
|
+
/** Unique within the chart. */
|
|
20
|
+
id: string;
|
|
21
|
+
/** Epoch ms; must fall inside one of the buckets. */
|
|
22
|
+
at: number;
|
|
23
|
+
/** Finite and >= 0. Counts toward the bucket total. */
|
|
24
|
+
value: number;
|
|
25
|
+
/** What this span is, for its tooltip line and the table. */
|
|
26
|
+
label: string;
|
|
27
|
+
/** A `TimeSeriesBlockKind.key`. */
|
|
28
|
+
kind: string;
|
|
29
|
+
}
|
|
30
|
+
export interface TimeSeriesChartProps {
|
|
31
|
+
/** Each bucket's start, epoch ms, strictly ascending. */
|
|
32
|
+
buckets: readonly number[];
|
|
33
|
+
/** The width of one bucket in ms; null only when there are no buckets. */
|
|
34
|
+
bucketMs: number | null;
|
|
35
|
+
/** In stacking order, bottom first; also the palette order. */
|
|
36
|
+
series: readonly TimeSeriesSeries[];
|
|
37
|
+
blocks?: readonly TimeSeriesBlock[];
|
|
38
|
+
blockKinds?: readonly TimeSeriesBlockKind[];
|
|
39
|
+
/** What the chart measures, e.g. "Tokens over time". Names the group and captions the table. */
|
|
40
|
+
label: string;
|
|
41
|
+
/** @default "bar" */
|
|
42
|
+
variant?: "bar" | "area";
|
|
43
|
+
/** How a raw value reads in the tooltip and the table. @default locale-formatted number */
|
|
44
|
+
formatValue?: (value: number) => string;
|
|
45
|
+
/** How a value reads on the y axis; use a compact form here. @default `formatValue` */
|
|
46
|
+
formatAxis?: (value: number) => string;
|
|
47
|
+
/** Locale of the time labels. @default the viewer's */
|
|
48
|
+
locale?: string;
|
|
49
|
+
/** IANA zone the buckets are labelled in, e.g. "UTC". @default the viewer's */
|
|
50
|
+
timeZone?: string;
|
|
51
|
+
/** Called with a member series' key when its band or its legend name is clicked. */
|
|
52
|
+
onSelectSeries?: (key: string) => void;
|
|
53
|
+
/** Plot height in px. @default 240 */
|
|
54
|
+
height?: number;
|
|
55
|
+
/** Said when there is nothing to draw. @default "No data" */
|
|
56
|
+
emptyLabel?: string;
|
|
57
|
+
/** Said over the axis when every value is zero. @default "All values are zero" */
|
|
58
|
+
zeroLabel?: string;
|
|
59
|
+
className?: string;
|
|
60
|
+
ref?: Ref<HTMLDivElement>;
|
|
61
|
+
}
|
|
62
|
+
export declare function TimeSeriesChart(props: TimeSeriesChartProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const MINUTE_MS = 60000;
|
|
2
|
+
export declare const DAY_MS = 86400000;
|
|
3
|
+
/**
|
|
4
|
+
* A value axis that starts at zero and ends on a round number at or above
|
|
5
|
+
* `max`, with about `count` intervals: steps of 1, 2 or 5 times a power of ten.
|
|
6
|
+
* No data (`max <= 0`) is a 0-to-1 axis, never a zero-height one.
|
|
7
|
+
*/
|
|
8
|
+
export declare function niceTicks(max: number, count?: number): {
|
|
9
|
+
ticks: number[];
|
|
10
|
+
max: number;
|
|
11
|
+
};
|
|
12
|
+
export interface TimeFormatters {
|
|
13
|
+
/** The label under a tick: a primary line, and a secondary line when the day (or year) changed since the last tick. */
|
|
14
|
+
tick: (ms: number, previousMs: number | null) => {
|
|
15
|
+
primary: string;
|
|
16
|
+
secondary: string | null;
|
|
17
|
+
};
|
|
18
|
+
/** The whole instant, for the tooltip and the table. */
|
|
19
|
+
full: (ms: number) => string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* How a bucket start reads for a bucket this wide. Under a day the time is the
|
|
23
|
+
* label and the date appears where it changes; a day or wider is labelled by
|
|
24
|
+
* its date; a month or wider by month and year. `timeZone` is passed straight
|
|
25
|
+
* to `Intl` (an unknown zone throws, loudly); undefined is the viewer's own.
|
|
26
|
+
*/
|
|
27
|
+
export declare function timeFormatters(bucketMs: number, locale: string | undefined, timeZone: string | undefined): TimeFormatters;
|
|
28
|
+
/** The index of the bucket whose span `[start, start + bucketMs)` holds `at`, or -1. */
|
|
29
|
+
export declare function bucketIndexAt(buckets: readonly number[], bucketMs: number, at: number): number;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Permission, Role } from "./types";
|
|
2
|
+
export type AccessRequestKind = "session" | "worker";
|
|
3
|
+
export type AccessRequestState = "pending" | "approved" | "denied" | "expired" | "claimed";
|
|
4
|
+
export interface AccessRequest {
|
|
5
|
+
kind: AccessRequestKind;
|
|
6
|
+
/** The session title or the worker id: what the requester calls itself. */
|
|
7
|
+
label: string;
|
|
8
|
+
repo?: string;
|
|
9
|
+
machine?: string;
|
|
10
|
+
/** The address the request came from. */
|
|
11
|
+
requesterIp?: string;
|
|
12
|
+
clientVersion?: string;
|
|
13
|
+
/** ISO instant. */
|
|
14
|
+
requestedAt: string;
|
|
15
|
+
/** ISO instant. Shown while the request is pending. */
|
|
16
|
+
expiresAt?: string;
|
|
17
|
+
/** The short code the requester also displays. Compared by eye, never entered. */
|
|
18
|
+
confirmCode: string;
|
|
19
|
+
/** The label of the role granted. Shown once the request is approved or claimed. */
|
|
20
|
+
roleLabel?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface AccessRequestPanelProps {
|
|
23
|
+
request: AccessRequest;
|
|
24
|
+
state: AccessRequestState;
|
|
25
|
+
/** The roles the approver may grant. */
|
|
26
|
+
roles: Role[];
|
|
27
|
+
/** The permission catalog, used to name the permissions that make a role unavailable. */
|
|
28
|
+
permissions: Permission[];
|
|
29
|
+
/** What the approver holds. A role holding anything outside this set cannot be chosen. */
|
|
30
|
+
ownPermissionKeys: string[];
|
|
31
|
+
onApprove: (roleId: string) => Promise<void>;
|
|
32
|
+
onDeny: () => Promise<void>;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function AccessRequestPanel({ request, state, roles, permissions, ownPermissionKeys, onApprove, onDeny, className, }: AccessRequestPanelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Permission, Role } from "./types";
|
|
2
|
+
export interface RoleKeyPickerProps {
|
|
3
|
+
roles: Role[];
|
|
4
|
+
/** The permission catalog, used to name the permissions that make a role unavailable. */
|
|
5
|
+
permissions: Permission[];
|
|
6
|
+
/** What the issuer holds. A role holding anything outside this set cannot be chosen. */
|
|
7
|
+
ownPermissionKeys: string[];
|
|
8
|
+
/** The chosen role id, or `""` for none. */
|
|
9
|
+
value: string;
|
|
10
|
+
onValueChange: (roleId: string) => void;
|
|
11
|
+
/** The group's visible heading. */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** One line under the heading. */
|
|
14
|
+
description?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Whether `roleId` names a role in `roles` that the issuer may choose. */
|
|
19
|
+
export declare function isRoleSelectable(roleId: string, roles: Role[], own: ReadonlySet<string>): boolean;
|
|
20
|
+
/** The id of the selectable role holding the fewest permissions (the first of any tie), or `""` when none is selectable. */
|
|
21
|
+
export declare function leastPrivilegeRoleId(roles: Role[], own: ReadonlySet<string>): string;
|
|
22
|
+
export declare function RoleKeyPicker({ roles, permissions, ownPermissionKeys, value, onValueChange, label, description, disabled, className, }: RoleKeyPickerProps): import("react").JSX.Element;
|
|
@@ -12,7 +12,9 @@ export * from "./RolesPermissionsPage";
|
|
|
12
12
|
export * from "./MembersPanel";
|
|
13
13
|
export * from "./ChangePasswordForm";
|
|
14
14
|
export * from "./SessionsList";
|
|
15
|
+
export * from "./RoleKeyPicker";
|
|
15
16
|
export * from "./ApiKeysPanel";
|
|
17
|
+
export * from "./AccessRequestPanel";
|
|
16
18
|
export * from "./InvitationsList";
|
|
17
19
|
export * from "./InviteMembersDialog";
|
|
18
20
|
export * from "./Brand";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ export { ConcentricRing, type ConcentricRingProps, type ConcentricRingLevel, } f
|
|
|
75
75
|
export { Stat, StatRow, Sparkline, type StatProps, type StatRowProps, type SparklineProps, type StatSize, type StatTrend, type StatSentiment, } from "./components/Stat";
|
|
76
76
|
export { ShareBar, type ShareBarProps, type ShareBarSegment, } from "./components/chart/ShareBar";
|
|
77
77
|
export { BarList, type BarListProps, type BarListItem, } from "./components/chart/BarList";
|
|
78
|
+
export { TimeSeriesChart, type TimeSeriesChartProps, type TimeSeriesSeries, type TimeSeriesRole, type TimeSeriesBlock, type TimeSeriesBlockKind, } from "./components/chart/TimeSeriesChart";
|
|
78
79
|
export { CHART_SERIES_COUNT, CHART_SERIES_TOKENS, CHART_SEQUENTIAL_TOKEN, CHART_SEQUENTIAL_COLOR, chartSeriesColor, } from "./lib/chart-palette";
|
|
79
80
|
export { DataTable, TableEmptyState, CellStack, type DataTableProps, type TableDensity, } from "./components/Table";
|
|
80
81
|
export { CodeEditor, CodeEditorToolbar, CodeEditorCaption, CodeEditorCopyButton, CodeEditorWrapToggle, CodeEditorViewSwitch, type CodeEditorProps, type CodeEditorToolbarProps, type CodeEditorView, } from "./components/CodeEditor";
|
|
@@ -147,7 +148,7 @@ export { cellLabel, eventLabel, formatDateRange, longDate, monthTitle, timeOfDay
|
|
|
147
148
|
export { initialFocusDay, isInMonth, nextDayForKey, useGridNavigation, type GridNavigation, type GridNavigationOptions, } from "./components/calendar/use-grid-navigation";
|
|
148
149
|
export { AmbiguousTimeError, addDays, addDuration, addMonths, atMidnight, atTime, comparePlainDate, dayFraction, dayLengthMs, dayOfWeek, daysBetween, daysInMonth, endOfMonth, hoursInDay, instantAtFraction, instantToPlainDate, instantToPlainDateTime, isSameDate, isoDateString, isoDateTimeString, monthGridDays, nextDay, offsetAt, parsePlainDate, plainDateTimeToInstant, relativeAge, startOfDay, startOfMonth, startOfWeek, weekDays, type CalendarDuration, type Disambiguation, type Instant, type PlainDate, type PlainDateTime, type TimeZone, } from "./lib/time";
|
|
149
150
|
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";
|
|
150
|
-
export { RBACProvider, useRBAC, Can, useHasPermission, AccountMenu, AccountMenuSection, TeamSwitcher, DevToolsPopover, RolePermissionMatrix, RoleEditorDialog, ProfileForm, ProfilePage, RolesPermissionsPage, MembersPanel, ChangePasswordForm, SessionsList, ApiKeysPanel, InvitationsList, InviteMembersDialog, Brand, TeamSettingsForm, DangerZone, type RBACProviderProps, type RBACHookResult, type CanProps, type AccountMenuProps, type TeamSwitcherProps, type DevToolsPopoverProps, type RolePermissionMatrixProps, type RoleEditorDialogProps, type RoleEditorDialogSubmitInput, type ProfileFormProps, type ProfileFormAccount, type ProfileFormSaveInput, type ProfilePageProps, type RolesPermissionsPageProps, type MembersPanelProps, type MembersPanelMember, type ChangePasswordFormProps, type SessionsListProps, type Session, type ApiKeysPanelProps, type ApiKey, type InvitationsListProps, type InvitationsListItem, type InvitationStatus, type InviteMembersDialogProps, type Permission, type Role, type User, type Team, type TeamMembership, type BrandProps, type TeamSettingsFormProps, type TeamSettingsFormTeam, type TeamSettingsFormSaveInput, type DangerZoneProps, } from "./components/rbac";
|
|
151
|
+
export { RBACProvider, useRBAC, Can, useHasPermission, AccountMenu, AccountMenuSection, TeamSwitcher, DevToolsPopover, RolePermissionMatrix, RoleEditorDialog, ProfileForm, ProfilePage, RolesPermissionsPage, MembersPanel, ChangePasswordForm, SessionsList, ApiKeysPanel, AccessRequestPanel, RoleKeyPicker, isRoleSelectable, leastPrivilegeRoleId, InvitationsList, InviteMembersDialog, Brand, TeamSettingsForm, DangerZone, type RBACProviderProps, type RBACHookResult, type CanProps, type AccountMenuProps, type TeamSwitcherProps, type DevToolsPopoverProps, type RolePermissionMatrixProps, type RoleEditorDialogProps, type RoleEditorDialogSubmitInput, type ProfileFormProps, type ProfileFormAccount, type ProfileFormSaveInput, type ProfilePageProps, type RolesPermissionsPageProps, type MembersPanelProps, type MembersPanelMember, type ChangePasswordFormProps, type SessionsListProps, type Session, type ApiKeysPanelProps, type ApiKey, type AccessRequestPanelProps, type AccessRequest, type AccessRequestKind, type AccessRequestState, type RoleKeyPickerProps, type InvitationsListProps, type InvitationsListItem, type InvitationStatus, type InviteMembersDialogProps, type Permission, type Role, type User, type Team, type TeamMembership, type BrandProps, type TeamSettingsFormProps, type TeamSettingsFormTeam, type TeamSettingsFormSaveInput, type DangerZoneProps, } from "./components/rbac";
|
|
151
152
|
export { AuthLayout, AcceptInvitationCard, SignupCard, TermsAcceptance, LoginForm, ForgotPasswordForm, ResetPasswordForm, type AuthLayoutProps, type AcceptInvitationCardProps, type SignupCardProps, type TermsAcceptanceProps, type LoginFormProps, type ForgotPasswordFormProps, type ResetPasswordFormProps, } from "./components/auth";
|
|
152
153
|
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";
|
|
153
154
|
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";
|