@starci/eslint-grammar-core 0.43.1 → 0.45.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/CHANGELOG.md +17 -0
- package/README.md +4 -2
- package/dist/app-shell.js +30 -10
- package/dist/card-content.js +8 -19
- package/dist/{single-child-card.d.ts → card-is-object.d.ts} +2 -2
- package/dist/card-is-object.js +141 -0
- package/dist/choice-controls.d.ts +1 -1
- package/dist/choice-controls.js +5 -5
- package/dist/data-table-surface.d.ts +18 -0
- package/dist/data-table-surface.js +57 -0
- package/dist/index.js +4 -2
- package/dist/lib/why.js +26 -21
- package/dist/no-card-lead-description.js +3 -3
- package/dist/rows-in-card.d.ts +1 -1
- package/dist/rows-in-card.js +13 -12
- package/dist/surface-card-list.d.ts +1 -2
- package/dist/surface-card-list.js +1 -2
- package/dist/surface-card.d.ts +1 -1
- package/dist/surface-card.js +8 -63
- package/dist/surface-depth.js +1 -1
- package/dist/surface-in-surface.js +1 -1
- package/dist/tabs.d.ts +3 -2
- package/dist/tabs.js +26 -19
- package/docs/app-shell.md +5 -2
- package/docs/card-content.md +5 -6
- package/docs/card-is-object.md +42 -0
- package/docs/choice-controls.md +4 -4
- package/docs/data-table-surface.md +27 -0
- package/docs/layout-two-axis.md +3 -3
- package/docs/no-card-lead-description.md +2 -2
- package/docs/no-nested-label.md +3 -3
- package/docs/rows-in-card.md +5 -4
- package/docs/surface-card-list.md +1 -2
- package/docs/surface-card.md +4 -8
- package/docs/surface-depth.md +6 -7
- package/docs/surface-in-surface.md +2 -2
- package/docs/tabs.md +26 -5
- package/package.json +3 -3
- package/runtime/knowledge/ui/presentation/grammar-laws.yaml +33 -23
- package/dist/single-child-card.js +0 -90
- package/docs/single-child-card.md +0 -37
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# A lone DataTable, chart or list is the surface, never a card
|
|
2
|
-
|
|
3
|
-
Law module: `single-child-card.ts`. Knowledge: `knowledge/ui/presentation/grammar-laws.yaml#SINGLE-CHILD-CARD`. Finding code: `FE_SINGLE_CHILD_CARD`.
|
|
4
|
-
|
|
5
|
-
A card (`SurfaceCard`) groups two or more different parts (figures + list + actions), or carries zones (tabs, search, head actions). A card of key-value or choice rows (`kind="table"`, `kind="select"`, `kind="details"`, a `ListBox`, `DisclosureList`, `Timeline`, a `DescriptionList`) is valid alone or not (0.37.8). A standalone `DataTable` (`surface="card"`) or chart IS the surface: its title sits above it as a `Section` head and one line under it as `Section caption`, so a card around it is a second card. A list is a flat `Section kind="list"` that titles itself (0.43.0, LIST-ONE-LOOK), so a card around a lone list is refused the same way.
|
|
6
|
-
|
|
7
|
-
Every rule below is an error in `coreGrammarConfig`; none can be switched off or suppressed inline.
|
|
8
|
-
|
|
9
|
-
## `starci-grammar/single-child-card`
|
|
10
|
-
|
|
11
|
-
A Grammar `SurfaceCard` is refused when it has no zones (no `headers` or `footers` prop, an empty array counts as none, and no `labelEnd`) and its only body child (looked through fragments, `cond && x`, `cond ? x : y` and `.map`; blank text ignored) is:
|
|
12
|
-
|
|
13
|
-
- table: `DataTable`
|
|
14
|
-
- chart: `BarChart`, `ProportionBar`, `BubbleMap`, `FlowGraph`, `MermaidDiagram`
|
|
15
|
-
- list: `Section kind="list"`
|
|
16
|
-
|
|
17
|
-
Not flagged: any key-value or choice card (`kind="table"`, `kind="select"`, `ListBox`, `DisclosureList`, `Timeline`, `DescriptionList`), a card with two or more body children, a card with zones or `labelEnd`, a card with a JSX spread, `kind` `figures`, `details`, `accordion` or `tile`, a non-Grammar `SurfaceCard`, and non-product source. `Meter` and `Progress` are single values, not charts.
|
|
18
|
-
|
|
19
|
-
**Invalid**
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
<SurfaceCard label="Runs"><DataTable columns={columns} rows={runs} /></SurfaceCard>
|
|
23
|
-
<SurfaceCard label="Usage"><BarChart data={usage} /></SurfaceCard>
|
|
24
|
-
<SurfaceCard label="Runs"><Section kind="list" ariaLabel="Runs" items={runs} empty={null} /></SurfaceCard>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
**Valid**
|
|
28
|
-
|
|
29
|
-
```tsx
|
|
30
|
-
<Section title="Runs" caption="Last 30 days"><DataTable columns={columns} rows={runs} /></Section>
|
|
31
|
-
<Section kind="list" title="Runs" items={runs} empty={null} />
|
|
32
|
-
<SurfaceCard label="Runs"><ListBox items={runs} /></SurfaceCard>
|
|
33
|
-
<SurfaceCard label="Runs" headers={[{ kind: "search", /* ... */ }]}><DataTable columns={columns} rows={runs} /></SurfaceCard>
|
|
34
|
-
<SurfaceCard label="Runs"><Text>3 failed</Text><DataTable columns={columns} rows={runs} /></SurfaceCard>
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Rule ownership: [FE-RULE-OWNERSHIP](../../../contexts/code/fe/README.md#the-placement-test-fe-rule-ownership).
|