@estiva-app/ui 0.22.0 → 0.23.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.
Files changed (82) hide show
  1. package/README.md +21 -0
  2. package/dist/Banner.d.ts +20 -2
  3. package/dist/Banner.d.ts.map +1 -1
  4. package/dist/ContainerHeader.d.ts +25 -0
  5. package/dist/ContainerHeader.d.ts.map +1 -0
  6. package/dist/EmptyState.d.ts +10 -1
  7. package/dist/EmptyState.d.ts.map +1 -1
  8. package/dist/gates/app-checks.d.ts.map +1 -1
  9. package/dist/gates/{chunk-ZGJ2J5NU.js → chunk-EA33NP5B.js} +275 -11
  10. package/dist/gates/chunk-EA33NP5B.js.map +7 -0
  11. package/dist/gates/{chunk-AUXD4GCY.js → chunk-GTQZEHPC.js} +15 -1
  12. package/dist/gates/chunk-GTQZEHPC.js.map +7 -0
  13. package/dist/gates/cli.js +1 -1
  14. package/dist/gates/create-app.d.ts +2 -0
  15. package/dist/gates/create-app.d.ts.map +1 -1
  16. package/dist/gates/create-app.js +1 -1
  17. package/dist/gates/index.js +25 -3
  18. package/dist/gates/index.js.map +2 -2
  19. package/dist/gates/status.d.ts +2 -0
  20. package/dist/gates/status.d.ts.map +1 -1
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +69 -48
  24. package/dist/index.js.map +4 -4
  25. package/dist/registry/app-DQI6WLHR.js +10 -0
  26. package/dist/registry/app.d.ts +21 -0
  27. package/dist/registry/app.d.ts.map +1 -0
  28. package/dist/registry/build-LGFCCOLR.js +27 -0
  29. package/dist/registry/build-LGFCCOLR.js.map +7 -0
  30. package/dist/registry/build.d.ts +68 -2
  31. package/dist/registry/build.d.ts.map +1 -1
  32. package/dist/registry/{chunk-MRSBS5OP.js → chunk-E4JNV7PC.js} +68 -12
  33. package/dist/registry/chunk-E4JNV7PC.js.map +7 -0
  34. package/dist/registry/{chunk-QDYGB3QN.js → chunk-NJN4MQAM.js} +60 -15
  35. package/dist/registry/chunk-NJN4MQAM.js.map +7 -0
  36. package/dist/registry/{chunk-IJNCYVH4.js → chunk-W2B2G7OE.js} +34 -9
  37. package/dist/registry/chunk-W2B2G7OE.js.map +7 -0
  38. package/dist/registry/chunk-WMFF3MPP.js +648 -0
  39. package/dist/registry/chunk-WMFF3MPP.js.map +7 -0
  40. package/dist/registry/cli.js +81 -26
  41. package/dist/registry/cli.js.map +3 -3
  42. package/dist/registry/find.d.ts +12 -1
  43. package/dist/registry/find.d.ts.map +1 -1
  44. package/dist/registry/index.d.ts +5 -2
  45. package/dist/registry/index.d.ts.map +1 -1
  46. package/dist/registry/index.js +11 -3
  47. package/dist/registry/schema.d.ts +83 -6
  48. package/dist/registry/schema.d.ts.map +1 -1
  49. package/package.json +2 -2
  50. package/registry.json +233 -88
  51. package/src/Banner.mdx +17 -4
  52. package/src/Banner.stories.tsx +22 -0
  53. package/src/Banner.test.tsx +35 -0
  54. package/src/Banner.tsx +34 -9
  55. package/src/ContainerHeader.mdx +56 -0
  56. package/src/ContainerHeader.stories.tsx +62 -0
  57. package/src/ContainerHeader.test.tsx +47 -0
  58. package/src/ContainerHeader.tsx +45 -0
  59. package/src/EmptyState.mdx +12 -0
  60. package/src/EmptyState.stories.tsx +6 -1
  61. package/src/EmptyState.test.tsx +18 -1
  62. package/src/EmptyState.tsx +14 -1
  63. package/src/gates/app-checks.ts +23 -1
  64. package/src/gates/create-app.test.ts +77 -6
  65. package/src/gates/create-app.ts +288 -15
  66. package/src/gates/status.ts +16 -0
  67. package/src/index.ts +1 -0
  68. package/src/registry/app.test.ts +562 -0
  69. package/src/registry/app.ts +854 -0
  70. package/src/registry/build.ts +114 -25
  71. package/src/registry/cli.ts +105 -42
  72. package/src/registry/find.ts +45 -8
  73. package/src/registry/index.ts +8 -1
  74. package/src/registry/registry.test.ts +5 -5
  75. package/src/registry/schema.ts +163 -12
  76. package/dist/gates/chunk-AUXD4GCY.js.map +0 -7
  77. package/dist/gates/chunk-ZGJ2J5NU.js.map +0 -7
  78. package/dist/registry/build-GOVLABI6.js +0 -13
  79. package/dist/registry/chunk-IJNCYVH4.js.map +0 -7
  80. package/dist/registry/chunk-MRSBS5OP.js.map +0 -7
  81. package/dist/registry/chunk-QDYGB3QN.js.map +0 -7
  82. /package/dist/registry/{build-GOVLABI6.js.map → app-DQI6WLHR.js.map} +0 -0
@@ -16,7 +16,7 @@
16
16
  * reader that knows version N and is handed N+1 must be able to say so rather
17
17
  * than silently read a field that moved.
18
18
  */
19
- export declare const SCHEMA_VERSION = 1;
19
+ export declare const SCHEMA_VERSION = 2;
20
20
  /** What a name is, which decides how a reader offers it. */
21
21
  export type EntryKind =
22
22
  /** Draws something. Used in JSX. */
@@ -30,7 +30,65 @@ export type PurposeSource =
30
30
  /** The `.mdx` page's opening paragraph — the name has a page of its own. */
31
31
  'page'
32
32
  /** The doc comment above the export — the name is documented on a sibling's page. */
33
- | 'comment';
33
+ | 'comment'
34
+ /** An app's file that holds this one part: the comment at the top of the file (UIG-13). */
35
+ | 'file'
36
+ /** An app's pass-on: the part is the package's, and says so (UIG-13). */
37
+ | 'package';
38
+ /**
39
+ * Which of four kinds an app's part is (UIG-13), or that nothing uses it.
40
+ *
41
+ * Worked out from the code, never from the folder a file sits in: Peek's
42
+ * `components/ui` holds one-line pass-ons beside 187-line components.
43
+ */
44
+ export type EntryClass =
45
+ /** Its file only hands a package part on, so the app keeps its own import path. */
46
+ 're-export'
47
+ /** Used in two or more places in the app. Gets a usage page (UIG-17, UIG-18). */
48
+ | 'reusable'
49
+ /** Used in one place. Needs only its purpose line. */
50
+ | 'one-off'
51
+ /** Reusable, and everything it uses is already in the package: it could move there. Katerina rules. */
52
+ | 'promote-candidate'
53
+ /** No file of the app uses it: only its stories or tests, or nothing. Listed, never deleted by the catalogue. */
54
+ | 'unused';
55
+ /**
56
+ * What the catalogue knows about a part that lives in an app (UIG-13). `null`
57
+ * on the package's own entries.
58
+ */
59
+ export interface AppFacts {
60
+ class: EntryClass;
61
+ /** Why it has that class, in words: the evidence, or the written reason. */
62
+ reason: string;
63
+ /**
64
+ * `true` when the class is written beside the part (`@registry <class>: <reason>`
65
+ * in its comment) rather than worked out — "general, though one screen uses it yet".
66
+ */
67
+ written: boolean;
68
+ /** A pass-on's part, as `Name` for the package's and `Name from <package>` for another's. `null` otherwise. */
69
+ handsOn: string | null;
70
+ /**
71
+ * The app's files that use it, relative to the app: every file that imports it,
72
+ * and its own file when something else there draws it. Stories and tests are not
73
+ * uses — a part only they reach is unused.
74
+ */
75
+ usedIn: string[];
76
+ /**
77
+ * What ties it to this app: each import that is neither in the package's own
78
+ * dependencies nor an app file that is itself untied. Empty means it could
79
+ * live in the package as it is.
80
+ */
81
+ tiedTo: string[];
82
+ /** The package part with the same name, when there is one: the reader should see both. */
83
+ packageNamesake: string | null;
84
+ /** Imported as `import X from …` rather than `import { X } from …`. */
85
+ defaultExport: boolean;
86
+ }
87
+ /** A file in an app's target set that holds no part, and why, in words. */
88
+ export interface FileWithoutPart {
89
+ file: string;
90
+ reason: string;
91
+ }
34
92
  export type EntryStatus = 'stable' | 'migrating' | 'deprecated';
35
93
  /** A prop that takes one of a known set of words, and the set. */
36
94
  export interface EntryVariant {
@@ -66,7 +124,7 @@ export interface EntryBehaviour {
66
124
  export interface RegistryEntry {
67
125
  /** The exported name, exactly as `index.ts` exports it. */
68
126
  name: string;
69
- /** Which library it came from. One repo per registry until UIG-13 merges them. */
127
+ /** Which library it came from: `estiva-ui`, or the app that owns it. */
70
128
  repo: string;
71
129
  kind: EntryKind;
72
130
  /** What a caller actually types. */
@@ -106,6 +164,8 @@ export interface RegistryEntry {
106
164
  storyId: string | null;
107
165
  /** The `.mdx` path, relative to the repo, or `null`. */
108
166
  docPage: string | null;
167
+ /** An app's part: its class and the evidence for it (UIG-13). `null` on the package's own entries. */
168
+ app: AppFacts | null;
109
169
  }
110
170
  /** A name that is exported and deliberately not an entry. Empty today; the count still has to reconcile. */
111
171
  export interface RegistryExclusion {
@@ -115,14 +175,28 @@ export interface RegistryExclusion {
115
175
  export interface Registry {
116
176
  schemaVersion: number;
117
177
  builtFrom: {
178
+ /**
179
+ * `package`: the package's catalogue, committed and shipped. `app`: one app's,
180
+ * built fresh from its code each time and never committed — Peek and Ship are
181
+ * private, the package is public (Katerina, 18 September 2026).
182
+ */
183
+ kind: 'package' | 'app';
118
184
  repo: string;
119
- /** The npm package the entries are imported from. */
185
+ /** The package the entries are imported from, or the app's own name. */
120
186
  package: string;
121
187
  packageVersion: string;
122
- /** Value exports counted in `index.ts`. `entries + excluded` must equal it. */
188
+ /**
189
+ * The package: value exports counted in `index.ts`. An app: parts found in its
190
+ * files. `entries + excluded` must equal it.
191
+ */
123
192
  exports: number;
124
- /** Type-only exports, which are not entries. Recorded so the count reconciles. */
193
+ /** Type-only exports, which are not entries. Recorded so the count reconciles. `0` for an app. */
125
194
  typeExports: number;
195
+ /**
196
+ * An app only: its `.tsx` files outside stories and tests. Each one either holds
197
+ * an entry or is in `filesWithoutParts`. `null` for the package.
198
+ */
199
+ files: number | null;
126
200
  };
127
201
  /**
128
202
  * How to turn an id into a link. There is no Storybook on the internet yet
@@ -136,7 +210,10 @@ export interface Registry {
136
210
  };
137
211
  entries: RegistryEntry[];
138
212
  excluded: RegistryExclusion[];
213
+ /** An app's `.tsx` files that hold no part, each with its reason. Empty for the package. */
214
+ filesWithoutParts: FileWithoutPart[];
139
215
  }
216
+ export declare const CLASSES: EntryClass[];
140
217
  /**
141
218
  * Check a registry against this schema. Returns every problem, not the first:
142
219
  * a build that reports one missing purpose per run costs one run per entry.
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/registry/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH,eAAO,MAAM,cAAc,IAAI,CAAA;AAE/B,4DAA4D;AAC5D,MAAM,MAAM,SAAS;AACnB,oCAAoC;AAClC,WAAW;AACb,8DAA8D;GAC5D,MA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M,CAAA;QACnB;;;WAGG;QACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KACrB,CAAA;IACD;;;;OAIG;IACH,SAAS,EAAE;QACT,QAAQ,EAAE,MAAM,CAAA;QAChB,SAAS,EAAE,MAAM,CAAA;QACjB,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;IACD,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,QAAQ,EAAE,iBAAiB,EAAE,CAAA;IAC7B,4FAA4F;IAC5F,iBAAiB,EAAE,eAAe,EAAE,CAAA;CACrC;AAKD,eAAO,MAAM,OAAO,EAAE,UAAU,EAAwE,CAAA;AAKxG;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CA+IzD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estiva-app/ui",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "Estiva's design tokens (the contract) and a small set of primitives (a convenience) for every Estiva app.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -66,7 +66,7 @@
66
66
  "preregistry:check": "node build.mjs",
67
67
  "registry:check": "node dist/registry/cli.js check",
68
68
  "preui:find": "node build.mjs",
69
- "ui:find": "node dist/registry/cli.js find",
69
+ "ui:find": "node dist/registry/cli.js find --also peek=../peek --also ship=../ship/web",
70
70
  "prepublishOnly": "npm run build"
71
71
  },
72
72
  "peerDependencies": {