@danxbot/ui 25.1.0 → 25.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 +11127 -10992
- package/dist/index.js.map +1 -1
- package/dist/types/components/Tabs.d.ts +14 -1
- package/dist/types/components/chart/ShareBar.d.ts +1 -1
- package/dist/types/components/chart/share-bar-labels.d.ts +17 -0
- package/dist/types/components/stepper/derive.d.ts +2 -1
- package/dist/types/components/stepper/types.d.ts +19 -3
- package/package.json +1 -1
|
@@ -113,8 +113,21 @@ export interface TabListProps {
|
|
|
113
113
|
className?: string;
|
|
114
114
|
children: ReactNode;
|
|
115
115
|
variant?: VariantProps<typeof tabs>["variant"];
|
|
116
|
+
/**
|
|
117
|
+
* The words for the two scroll buttons a strip that overflows grows on the edge that has more tabs. DX-4973.
|
|
118
|
+
*
|
|
119
|
+
* ABSENT MEANS FADE ONLY. A strip wider than its box always fades its content out at the edge that has more (that is the cue, and it
|
|
120
|
+
* needs no colour: it fades the tabs themselves, not a patch of the surface over them). The buttons are the part a keyboard or a
|
|
121
|
+
* screen reader can act on, and the library has no default language, so the caller supplies what they say ("Show earlier tabs",
|
|
122
|
+
* "Show later tabs") rather than the strip speaking English by itself. Pass them wherever a strip can overflow. A button shows
|
|
123
|
+
* only on the edge that has more.
|
|
124
|
+
*/
|
|
125
|
+
scrollLabels?: {
|
|
126
|
+
before: string;
|
|
127
|
+
after: string;
|
|
128
|
+
};
|
|
116
129
|
}
|
|
117
|
-
export declare function TabList({ className, children, variant }: TabListProps): import("react").JSX.Element;
|
|
130
|
+
export declare function TabList({ className, children, variant, scrollLabels }: TabListProps): import("react").JSX.Element;
|
|
118
131
|
export interface TabProps extends Omit<BaseTabs.Tab.Props, "className"> {
|
|
119
132
|
className?: string;
|
|
120
133
|
variant?: VariantProps<typeof tabs>["variant"];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** The smallest clear space, in px, left between two direct labels that sit side by side. */
|
|
2
|
+
export declare const LABEL_GAP = 4;
|
|
3
|
+
/** One direct label as laid out. All lengths are px, measured from the bar's LEFT edge (physical, also in RTL). */
|
|
4
|
+
export interface LabelBox {
|
|
5
|
+
key: string;
|
|
6
|
+
share: number;
|
|
7
|
+
/** Offset of the label's centre (its segment's centre) from the bar's left edge. */
|
|
8
|
+
center: number;
|
|
9
|
+
/** Width of the printed label. */
|
|
10
|
+
width: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The keys of the labels that must NOT be drawn: one whose box (`center ± width / 2`) leaves `[0, barWidth]`
|
|
14
|
+
* (a clipping ancestor would cut it to a wrong number), or that comes within `LABEL_GAP` of a larger-share
|
|
15
|
+
* label already kept. The larger share wins a contested spot, so the answer does not depend on input order.
|
|
16
|
+
*/
|
|
17
|
+
export declare function labelsToDrop(boxes: readonly LabelBox[], barWidth: number): Set<string>;
|
|
@@ -13,7 +13,8 @@ export declare function assertSteps(steps: readonly Step[], current: number): vo
|
|
|
13
13
|
/**
|
|
14
14
|
* What one step IS, given where the cursor is.
|
|
15
15
|
*
|
|
16
|
-
* PRECEDENCE,
|
|
16
|
+
* PRECEDENCE: failed, blocked, current, complete, unverified, skipped, incomplete, upcoming. DX-4973 puts `failed` first.
|
|
17
|
+
* The next rule is the interesting one. `blocked` outranks
|
|
17
18
|
* everything, including `complete`, wherever the step sits. Data saying both
|
|
18
19
|
* is contradictory, and when a record contradicts itself the exception is what
|
|
19
20
|
* the reader needs — the same call `ProvenanceBadge` makes when it stays quiet
|
|
@@ -35,6 +35,18 @@ export interface Step {
|
|
|
35
35
|
* An empty string throws, for the same reason an empty `blocked` does: the words ARE the spoken state.
|
|
36
36
|
*/
|
|
37
37
|
unverified?: string;
|
|
38
|
+
/**
|
|
39
|
+
* A check of this step ran and FAILED, and what it said. DX-4973.
|
|
40
|
+
*
|
|
41
|
+
* The VALUE is the reason, supplied by the caller ("Asana refused the token", "The bot is not in that channel"): the library cannot
|
|
42
|
+
* know what a flow checks, and the words are printed in red under the label and spoken as the step's state (so start with what
|
|
43
|
+
* happened, because no fixed word like "failed" is added). It is the one red marker a step can carry on purpose, distinct from
|
|
44
|
+
* `blocked` (cannot start yet, amber, and the only one that gates the forward control), `unverified` (done, nothing to test, grey),
|
|
45
|
+
* `skipped` (left on purpose, grey) and `incomplete` (passed over, red cross). A failed step does NOT gate forward movement by
|
|
46
|
+
* itself: add `blocked` as well when it must. It outranks every other state, `blocked` and the cursor included, because a failure is
|
|
47
|
+
* the thing a reader must not miss; it is counted in `StepperProgress.failed` and in neither chip. An empty string throws.
|
|
48
|
+
*/
|
|
49
|
+
failed?: string;
|
|
38
50
|
/**
|
|
39
51
|
* Why the flow cannot move on from here. Absent means it can.
|
|
40
52
|
*
|
|
@@ -56,14 +68,16 @@ export interface Step {
|
|
|
56
68
|
* What a step IS right now — derived from the steps and the cursor, never
|
|
57
69
|
* stored.
|
|
58
70
|
*
|
|
59
|
-
*
|
|
71
|
+
* Eight, not two, because "finished", "you are here", "done but unproven", "you left it on purpose",
|
|
60
72
|
* "you missed it", "not reached yet" and "this is what is stopping you" call for
|
|
61
73
|
* different next actions and one absence of action. Collapsing them to a boolean is what
|
|
62
74
|
* produces a rail where a skipped step and an untouched one look identical.
|
|
63
75
|
*/
|
|
64
76
|
export type StepStatus =
|
|
77
|
+
/** Carries `failed` words: a check ran and refused it. Beats every other reading, `blocked` included. Red. DX-4973. */
|
|
78
|
+
"failed"
|
|
65
79
|
/** `complete: true`. */
|
|
66
|
-
"complete"
|
|
80
|
+
| "complete"
|
|
67
81
|
/** Carries a `blocked` reason. Beats every other reading — see `stepStatus`. */
|
|
68
82
|
| "blocked"
|
|
69
83
|
/** The cursor is on it. */
|
|
@@ -91,12 +105,14 @@ export interface StepperProgress {
|
|
|
91
105
|
/** How many steps are `complete`, anywhere in the flow. */
|
|
92
106
|
complete: number;
|
|
93
107
|
/**
|
|
94
|
-
* Behind the cursor, not complete and marked
|
|
108
|
+
* Behind the cursor, not complete and marked none of `skipped`, `unverified` or `failed`: the steps missed, the ones the red chip counts. (Renamed in meaning by
|
|
95
109
|
* DX-4963: a step the person skipped on purpose is `acknowledged`, not counted here.)
|
|
96
110
|
*/
|
|
97
111
|
skipped: number;
|
|
98
112
|
/** Steps marked `skipped` that are not complete, anywhere in the flow: left on purpose, counted in the neutral chip. DX-4963. */
|
|
99
113
|
acknowledged: number;
|
|
114
|
+
/** Steps carrying `failed` words, anywhere in the flow. Counted in no chip. DX-4973. */
|
|
115
|
+
failed: number;
|
|
100
116
|
/** Steps carrying `unverified` words that are not complete, anywhere in the flow: done, with nothing to test. Counted in no chip. DX-4968. */
|
|
101
117
|
unverified: number;
|
|
102
118
|
}
|