@factorialco/f0-react 4.41.0 → 4.42.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/component-status.d.ts +75 -8
- package/dist/component-status.js +198 -48
- package/dist/experimental.js +2 -2
- package/dist/f0.js +2 -2
- package/dist/{index-BOxXUdnM.js → index-a2kVa3ul.js} +6253 -6242
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Component Status API
|
|
3
5
|
* ====================
|
|
@@ -36,11 +38,31 @@ export declare interface ComponentEntry {
|
|
|
36
38
|
tags: string[];
|
|
37
39
|
hasStories: boolean;
|
|
38
40
|
hasUnitTests: boolean;
|
|
41
|
+
hasPlayFunction: boolean;
|
|
39
42
|
hasMdxDocs: boolean;
|
|
40
43
|
docQuality: DocQuality;
|
|
44
|
+
docSignals: DocSignals;
|
|
41
45
|
storyFile: string;
|
|
42
46
|
}
|
|
43
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Renders a component's maturity status and Definition-of-Done checklist. All
|
|
50
|
+
* text (badge label, summary, checklist labels and hints) comes from the
|
|
51
|
+
* `component-status` data so Storybook and any consuming app stay identical.
|
|
52
|
+
*
|
|
53
|
+
* Renders nothing when the name doesn't resolve to a tracked component.
|
|
54
|
+
*/
|
|
55
|
+
export declare function ComponentStability({ componentName, components, className, }: ComponentStabilityProps): default_2.JSX.Element | null;
|
|
56
|
+
|
|
57
|
+
export declare interface ComponentStabilityProps {
|
|
58
|
+
/** Component name to look up (e.g. "Card", "F0Alert", "Components/Card"). */
|
|
59
|
+
componentName: string;
|
|
60
|
+
/** Optional dataset override; defaults to the build-time data. */
|
|
61
|
+
components?: ComponentEntry[];
|
|
62
|
+
/** Extra classes for the outer container (e.g. spacing). */
|
|
63
|
+
className?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
44
66
|
export declare interface ComponentStatus extends ComponentEntry {
|
|
45
67
|
/** The full Definition-of-Done checklist with pass/fail per item. */
|
|
46
68
|
requirements: RequirementResult[];
|
|
@@ -59,6 +81,20 @@ export declare interface ComponentStatus extends ComponentEntry {
|
|
|
59
81
|
* - null: tag and bar agree
|
|
60
82
|
*/
|
|
61
83
|
discrepancy: "tagged-but-below-bar" | "meets-bar-not-tagged" | null;
|
|
84
|
+
/**
|
|
85
|
+
* The maturity level the component *actually* has, per the Definition of Done.
|
|
86
|
+
* A component is only "stable" when it is both tagged stable AND meets the
|
|
87
|
+
* full checklist; anything else (untagged, below the bar, or meeting the bar
|
|
88
|
+
* without the tag) is "experimental". `deprecated`/`internal` pass through.
|
|
89
|
+
* This is what the badge shows — `apiStatus` is the raw declared tag.
|
|
90
|
+
*/
|
|
91
|
+
effectiveStatus: ApiStatus;
|
|
92
|
+
/** Human-readable badge label for `effectiveStatus`. */
|
|
93
|
+
label: string;
|
|
94
|
+
/** One-line human summary shown above the checklist. */
|
|
95
|
+
summary: string;
|
|
96
|
+
/** Whether the DoD checklist is meaningful for this maturity level. */
|
|
97
|
+
showChecklist: boolean;
|
|
62
98
|
}
|
|
63
99
|
|
|
64
100
|
/** The full generated dataset. */
|
|
@@ -80,8 +116,26 @@ export declare interface ComponentStatusStats {
|
|
|
80
116
|
withMdxDocs: number;
|
|
81
117
|
}
|
|
82
118
|
|
|
119
|
+
/** A sub-check enumerated under a requirement, with its own pass/fail. */
|
|
120
|
+
export declare interface CriterionResult {
|
|
121
|
+
label: string;
|
|
122
|
+
met: boolean;
|
|
123
|
+
}
|
|
124
|
+
|
|
83
125
|
export declare type DocQuality = "none" | "stub" | "acceptable" | "good" | "gold";
|
|
84
126
|
|
|
127
|
+
/** Granular MDX signals used to score the doc tier and its per-criterion checks. */
|
|
128
|
+
export declare interface DocSignals {
|
|
129
|
+
/** How many of Anatomy / Guidelines / Accessibility are present (0–3). */
|
|
130
|
+
sectionsCount: number;
|
|
131
|
+
hasProps: boolean;
|
|
132
|
+
hasWhenToUse: boolean;
|
|
133
|
+
hasWhenNotToUse: boolean;
|
|
134
|
+
hasDoDonts: boolean;
|
|
135
|
+
/** Number of `<Canvas>` example blocks. */
|
|
136
|
+
exampleCount: number;
|
|
137
|
+
}
|
|
138
|
+
|
|
85
139
|
/**
|
|
86
140
|
* Evaluate a single raw component entry against the stable checklist. Pure —
|
|
87
141
|
* exported so it can be unit-tested and reused over arbitrary datasets.
|
|
@@ -113,8 +167,9 @@ export declare function getComponentStatus(name: string, components?: ComponentE
|
|
|
113
167
|
export declare function getStatusGeneratedAt(): string;
|
|
114
168
|
|
|
115
169
|
/**
|
|
116
|
-
* Minimum doc-quality tier a component must reach
|
|
117
|
-
*
|
|
170
|
+
* Minimum doc-quality tier a stable component must reach. Per the Definition of
|
|
171
|
+
* Done, promotion to stable requires the "good" tier (Gold encouraged);
|
|
172
|
+
* "acceptable" is only the experimental Build bar.
|
|
118
173
|
*/
|
|
119
174
|
export declare const MIN_DOC_QUALITY: DocQuality;
|
|
120
175
|
|
|
@@ -127,24 +182,36 @@ export declare interface RequirementResult {
|
|
|
127
182
|
met: boolean;
|
|
128
183
|
/** What is missing / how to satisfy it when unmet. */
|
|
129
184
|
detail: string;
|
|
185
|
+
/** Concrete sub-criteria (each with its own pass/fail) enumerated under
|
|
186
|
+
* `detail`, when the requirement is made up of several checks. */
|
|
187
|
+
criteria?: CriterionResult[];
|
|
130
188
|
}
|
|
131
189
|
|
|
132
190
|
/**
|
|
133
|
-
* The Definition of Done for a stable component
|
|
134
|
-
*
|
|
191
|
+
* The Definition of Done for a stable component — the mechanically-checkable
|
|
192
|
+
* subset of the lifecycle DoD (Lifecycle/Definition of Done). Each requirement
|
|
193
|
+
* inspects a raw entry and reports whether it is met. `detail` is a neutral
|
|
194
|
+
* description of the requirement (shown for met and unmet points alike).
|
|
135
195
|
*
|
|
136
|
-
* Scope note:
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
196
|
+
* Scope note: some DoD items are not statically verifiable and are NOT gated
|
|
197
|
+
* here — the axe a11y test passing, adoption by ≥3 product teams, no breaking
|
|
198
|
+
* changes for 60 days, and Foundations approval. Those remain manual promotion
|
|
199
|
+
* gates (see Lifecycle/Definition of Done).
|
|
140
200
|
*/
|
|
141
201
|
export declare const STABLE_REQUIREMENTS: ReadonlyArray<{
|
|
142
202
|
key: string;
|
|
143
203
|
label: string;
|
|
144
204
|
detail: string;
|
|
205
|
+
criteria?: Array<{
|
|
206
|
+
label: string;
|
|
207
|
+
isMet: (c: ComponentEntry) => boolean;
|
|
208
|
+
}>;
|
|
145
209
|
isMet: (c: ComponentEntry) => boolean;
|
|
146
210
|
}>;
|
|
147
211
|
|
|
212
|
+
/** Human-readable badge label per maturity level. */
|
|
213
|
+
export declare const STATUS_LABELS: Record<ApiStatus, string>;
|
|
214
|
+
|
|
148
215
|
export { }
|
|
149
216
|
|
|
150
217
|
|