@danxbot/ui 25.0.0 → 25.2.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.
@@ -70,6 +70,18 @@ export interface SettingRowBaseProps {
70
70
  * applying yet.
71
71
  */
72
72
  effect?: ReactNode;
73
+ /**
74
+ * Where the control sits. DX-4968.
75
+ *
76
+ * `inline` (the default): beside the text from `sm` (640px) up, under it below. Right for a switch, a select or a short input,
77
+ * which keeps its own width at the row's trailing edge.
78
+ *
79
+ * `stacked`: ALWAYS under the text, the full width of the row. Use it for a control whose value is long and must be seen or
80
+ * copied whole, such as a `CopyValue` holding a URL. Beside the text, a control that cannot shrink takes the row's whole width and
81
+ * leaves the label and description a word-per-line sliver (or runs past the card edge); stacked gives the value box the width
82
+ * to truncate or wrap inside, with the copy button still in view.
83
+ */
84
+ layout?: "inline" | "stacked";
73
85
  /**
74
86
  * Right-aligned indicator — a `Badge` showing the setting's current derived
75
87
  * state, most often. Rendered beside the control, not inside it, so it
@@ -1,4 +1,4 @@
1
- import type { Ref } from "react";
1
+ import { type Ref } from "react";
2
2
  export interface ShareBarSegment {
3
3
  /** Unique within the bar. */
4
4
  id: string;
@@ -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>;
@@ -59,8 +59,9 @@ export interface StepperProps {
59
59
  orientation?: "horizontal" | "vertical" | "side";
60
60
  /**
61
61
  * DX-4963 - the one-line form for a narrow screen: "Step 3 of 9: Project" in a button that opens the full list under it (and
62
- * closes again when the step changes). `true` always, `"auto"` below the `sm` breakpoint (640px) and the full rail above it,
63
- * `false` (the default) never. Nine steps stacked is about 530px tall; this keeps the step's own content on the first screen.
62
+ * closes again when the step changes). `true` always, `"auto"` wherever the full rail would not fit (below the `sm` breakpoint, 640px; with
63
+ * `orientation="side"` below `lg`, 1024px, DX-4968: between the two the stacked list would push the step's own content off the first
64
+ * screen), `false` (the default) never. Nine steps stacked is about 530px tall; this keeps the step's own content on the first screen.
64
65
  */
65
66
  compact?: boolean | "auto";
66
67
  /** The CURRENT step's content. */
@@ -24,6 +24,17 @@ export interface Step {
24
24
  * cursor outrank both. Like `complete`, absent means false.
25
25
  */
26
26
  skipped?: boolean;
27
+ /**
28
+ * Done, but there is nothing a server could test, so it cannot be called a tested success. DX-4968.
29
+ *
30
+ * The VALUE is the words, supplied by the caller ("Saved, not tested", "Confirmed when the token is saved"): the library cannot
31
+ * know what a flow's steps are for, and "skipped" would be false for a step that was done. The words are printed under the label
32
+ * and spoken as the step's state. It is its own neutral state: a grey marker with its own glyph, never the green of a tested
33
+ * result, never the red of a missed step, and counted in neither chip (`StepperProgress.unverified` carries the number for a
34
+ * caller that wants it). `complete` outranks it, and the cursor and `blocked` outrank both; it outranks `skipped`.
35
+ * An empty string throws, for the same reason an empty `blocked` does: the words ARE the spoken state.
36
+ */
37
+ unverified?: string;
27
38
  /**
28
39
  * Why the flow cannot move on from here. Absent means it can.
29
40
  *
@@ -45,7 +56,7 @@ export interface Step {
45
56
  * What a step IS right now — derived from the steps and the cursor, never
46
57
  * stored.
47
58
  *
48
- * Six, not two, because "finished", "you are here", "you left it on purpose",
59
+ * Seven, not two, because "finished", "you are here", "done but unproven", "you left it on purpose",
49
60
  * "you missed it", "not reached yet" and "this is what is stopping you" call for
50
61
  * different next actions and one absence of action. Collapsing them to a boolean is what
51
62
  * produces a rail where a skipped step and an untouched one look identical.
@@ -57,9 +68,11 @@ export type StepStatus =
57
68
  | "blocked"
58
69
  /** The cursor is on it. */
59
70
  | "current"
71
+ /** Carries `unverified` words and is not complete: done, with no result to show. Neutral, never a fault. DX-4968. */
72
+ | "unverified"
60
73
  /** `skipped: true` and not complete: left on purpose. Neutral, never a fault. DX-4963. */
61
74
  | "skipped"
62
- /** Behind the cursor, not complete and not marked `skipped`: passed over by accident. */
75
+ /** Behind the cursor, not complete and marked neither `skipped` nor `unverified`: passed over by accident. */
63
76
  | "incomplete"
64
77
  /** Ahead of the cursor. Not a fault — simply not reached. */
65
78
  | "upcoming";
@@ -78,10 +91,12 @@ export interface StepperProgress {
78
91
  /** How many steps are `complete`, anywhere in the flow. */
79
92
  complete: number;
80
93
  /**
81
- * Behind the cursor, not complete and NOT marked `skipped`: the steps missed, the ones the red chip counts. (Renamed in meaning by
94
+ * Behind the cursor, not complete and marked neither `skipped` nor `unverified`: the steps missed, the ones the red chip counts. (Renamed in meaning by
82
95
  * DX-4963: a step the person skipped on purpose is `acknowledged`, not counted here.)
83
96
  */
84
97
  skipped: number;
85
98
  /** Steps marked `skipped` that are not complete, anywhere in the flow: left on purpose, counted in the neutral chip. DX-4963. */
86
99
  acknowledged: number;
100
+ /** Steps carrying `unverified` words that are not complete, anywhere in the flow: done, with nothing to test. Counted in no chip. DX-4968. */
101
+ unverified: number;
87
102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danxbot/ui",
3
- "version": "25.0.0",
3
+ "version": "25.2.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",