@starci/eslint-grammar-core 0.53.0 → 0.54.1
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 +9 -0
- package/README.md +8 -14
- package/dist/app-shell.d.ts +0 -11
- package/dist/app-shell.js +2 -190
- package/dist/button-arrow.d.ts +0 -7
- package/dist/button-arrow.js +1 -50
- package/dist/index.d.ts +13 -3
- package/dist/index.js +18 -19
- package/dist/lib/app-shell-scope.d.ts +0 -2
- package/dist/lib/app-shell-scope.js +0 -19
- package/dist/lib/app-shell.d.ts +0 -4
- package/dist/lib/app-shell.js +0 -25
- package/dist/lib/cross-file-inputs.js +2 -3
- package/dist/lib/why.js +5 -65
- package/dist/mascot.d.ts +0 -21
- package/dist/mascot.js +4 -69
- package/dist/no-raw-type-size.d.ts +27 -0
- package/dist/no-raw-type-size.js +107 -0
- package/dist/same-line-size.js +9 -0
- package/dist/table-cell-type.js +4 -0
- package/docs/app-shell.md +1 -37
- package/docs/button-arrow.md +1 -26
- package/docs/mascot.md +6 -34
- package/docs/no-raw-type-size.md +35 -0
- package/docs/rows-in-card.md +1 -1
- package/package.json +3 -3
- package/runtime/knowledge/patterns/fe/ui.yaml +0 -7
- package/runtime/knowledge/ui/composition/app-shell.yaml +4 -4
- package/runtime/knowledge/ui/presentation/grammar-laws.yaml +11 -0
- package/runtime/modules/goal/source-phrases.yaml +0 -4
- package/dist/chip-label.d.ts +0 -14
- package/dist/chip-label.js +0 -117
- package/dist/data-table-surface.d.ts +0 -18
- package/dist/data-table-surface.js +0 -57
- package/dist/lib/app-shell-cluster.d.ts +0 -6
- package/dist/lib/app-shell-cluster.js +0 -75
- package/dist/lib/app-shell-create.d.ts +0 -5
- package/dist/lib/app-shell-create.js +0 -37
- package/dist/lib/app-shell-owner.d.ts +0 -7
- package/dist/lib/app-shell-owner.js +0 -97
- package/dist/lib/status-tones.generated.d.ts +0 -2
- package/dist/lib/status-tones.generated.js +0 -8
- package/dist/message-surfaces.d.ts +0 -6
- package/dist/message-surfaces.js +0 -158
- package/dist/status-colors.d.ts +0 -19
- package/dist/status-colors.js +0 -217
- package/dist/suggestion-buttons.d.ts +0 -6
- package/dist/suggestion-buttons.js +0 -181
- package/dist/surface-card-list.d.ts +0 -20
- package/dist/surface-card-list.js +0 -47
- package/dist/tab-count-chip.d.ts +0 -7
- package/dist/tab-count-chip.js +0 -65
- package/docs/chip-label.md +0 -30
- package/docs/data-table-surface.md +0 -27
- package/docs/message-surfaces.md +0 -37
- package/docs/status-colors.md +0 -43
- package/docs/suggestion-buttons.md +0 -34
- package/docs/surface-card-list.md +0 -33
- package/docs/tab-count-chip.md +0 -26
package/dist/tab-count-chip.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Rule } from "eslint";
|
|
2
|
-
/** A tab label never carries its count as text: the count is the tab's `count`, drawn as a chip. */
|
|
3
|
-
export declare const tabCountChip: Rule.RuleModule;
|
|
4
|
-
/** The rules this law contributes to the plugin. */
|
|
5
|
-
export declare const rules: Record<string, Rule.RuleModule>;
|
|
6
|
-
/** Every rule of this law is an error. */
|
|
7
|
-
export declare const recommended: Record<string, "error">;
|
package/dist/tab-count-chip.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { isProductSource } from "@starci/eslint-canon-fe/lib/scope.mjs";
|
|
2
|
-
import { defineFamilyRules, defineRule } from "./lib/rule-contract.js";
|
|
3
|
-
/**
|
|
4
|
-
* THE TAB COUNT CHIP (owner, 2026-11-09, TAB-COUNT-CHIP). A count on any tab (page layer 1 or 2, a filter tab) is a 12px chip drawn by the tab from its
|
|
5
|
-
* `count`, never "· N" text in the label. The chip is grey; it is pink only when the number is work waiting for the owner (`isAttention`).
|
|
6
|
-
*
|
|
7
|
-
* WHAT IT READS. In product source that imports `@starci/grammar`, an object that carries `id` and `label` (a tab item, a filter option) whose `label`
|
|
8
|
-
* is a string ending in a middle dot and a number (`"All · 5"`), or a template literal that ends in a middle dot and an expression (`` `All · ${n}` ``).
|
|
9
|
-
*
|
|
10
|
-
* WHAT IT LEAVES ALONE. A label with no trailing "· N", objects without `id`, files that do not import Grammar, and non-product source.
|
|
11
|
-
*/
|
|
12
|
-
const TRAILING_COUNT = /·\s*\d+$/;
|
|
13
|
-
const TRAILING_SLOT = /·\s*$/;
|
|
14
|
-
const keyName = (property) => property.key.type === "Identifier" && !property.computed ? property.key.name : property.key.type === "Literal" && typeof property.key.value === "string" ? property.key.value : null;
|
|
15
|
-
/** A tab label never carries its count as text: the count is the tab's `count`, drawn as a chip. */
|
|
16
|
-
export const tabCountChip = defineRule({
|
|
17
|
-
meta: {
|
|
18
|
-
type: "problem",
|
|
19
|
-
docs: { description: "TAB-COUNT-CHIP: a tab count is the `count` prop drawn as a 12px chip, never \"· N\" text in the label." },
|
|
20
|
-
schema: [],
|
|
21
|
-
messages: {
|
|
22
|
-
label: "The tab label `{{label}}` carries its count as text. Pass `count` (and `isAttention` only when the number is work waiting for the owner): the tab draws the 12px chip.",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
create(context) {
|
|
26
|
-
if (!isProductSource(context))
|
|
27
|
-
return {};
|
|
28
|
-
let importsGrammar = false;
|
|
29
|
-
return {
|
|
30
|
-
ImportDeclaration(node) {
|
|
31
|
-
if (typeof node.source.value === "string" && /^@starci\/grammar(?:\/|$)/.test(node.source.value))
|
|
32
|
-
importsGrammar = true;
|
|
33
|
-
},
|
|
34
|
-
ObjectExpression(node) {
|
|
35
|
-
if (!importsGrammar)
|
|
36
|
-
return;
|
|
37
|
-
const properties = node.properties.filter((entry) => entry.type === "Property");
|
|
38
|
-
if (!properties.some((entry) => keyName(entry) === "id"))
|
|
39
|
-
return;
|
|
40
|
-
const label = properties.find((entry) => keyName(entry) === "label");
|
|
41
|
-
if (label === undefined)
|
|
42
|
-
return;
|
|
43
|
-
const value = label.value;
|
|
44
|
-
if (value.type === "Literal" && typeof value.value === "string" && TRAILING_COUNT.test(value.value)) {
|
|
45
|
-
context.report({ node: label, messageId: "label", data: { label: value.value } });
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (value.type === "TemplateLiteral" && value.expressions.length > 0) {
|
|
49
|
-
const lastQuasi = value.quasis[value.quasis.length - 1];
|
|
50
|
-
const before = value.quasis[value.quasis.length - 2];
|
|
51
|
-
if (lastQuasi !== undefined && before !== undefined && lastQuasi.value.cooked === "" && TRAILING_SLOT.test(before.value.cooked ?? "")) {
|
|
52
|
-
context.report({ node: label, messageId: "label", data: { label: context.sourceCode.getText(value) } });
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
/** The rules this law contributes to the plugin. */
|
|
60
|
-
export const rules = {
|
|
61
|
-
"tab-count-chip": tabCountChip,
|
|
62
|
-
};
|
|
63
|
-
defineFamilyRules(rules, "knowledge/ui/presentation/grammar-laws.yaml#TAB-COUNT-CHIP");
|
|
64
|
-
/** Every rule of this law is an error. */
|
|
65
|
-
export const recommended = Object.fromEntries(Object.keys(rules).map((name) => [`starci-grammar/${name}`, "error"]));
|
package/docs/chip-label.md
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# Chip labels start uppercase
|
|
2
|
-
|
|
3
|
-
Law module: `chip-label.ts`. Catalogue: R322 FE_CHIP_LABEL_CASE.
|
|
4
|
-
|
|
5
|
-
A status chip (`StatusDot` with text, a `Badge`, dot or not) is a label read at a glance beside the thing it qualifies, so it starts with an uppercase letter in every language, Vietnamese included. StatusDot capitalises the text it renders; the rule holds the literal where the source writes it.
|
|
6
|
-
|
|
7
|
-
Every rule below is an error in `coreGrammarConfig`; none can be switched off or suppressed inline.
|
|
8
|
-
|
|
9
|
-
## `starci-grammar/chip-label-starts-uppercase`
|
|
10
|
-
|
|
11
|
-
The children of a `StatusDot` or `Badge` that the source states literally (JSX text, a string literal, a template literal with no expression, and every branch of a conditional or logical expression made of them) do not start with a lowercase letter. The fix uppercases the first letter in place. Text the source cannot show (a translation call, a variable, a template with an expression), a label that starts with a digit or a symbol, and an uncased script are not judged.
|
|
12
|
-
|
|
13
|
-
**Invalid** (`src/components/blocks/RunList/component.tsx`)
|
|
14
|
-
|
|
15
|
-
```tsx
|
|
16
|
-
<StatusDot tone="success">running</StatusDot>
|
|
17
|
-
<Badge tone="warning" isDot>{"queued"}</Badge>
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
**Valid** (`src/components/blocks/RunList/component.tsx`)
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
<StatusDot tone="success">Running</StatusDot>
|
|
24
|
-
<Badge tone="warning" isDot>{t("status.queued")}</Badge>
|
|
25
|
-
<Badge>3 failed</Badge>
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
**Finding code:** `FE_CHIP_LABEL_CASE`
|
|
29
|
-
|
|
30
|
-
Rule ownership: [FE-RULE-OWNERSHIP](../../../contexts/code/fe/README.md#the-placement-test-fe-rule-ownership).
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# A table has one flat look
|
|
2
|
-
|
|
3
|
-
Law module: `data-table-surface.ts`. Finding code: `FE_DATA_TABLE_SURFACE`. Knowledge: `knowledge/ui/presentation/grammar-laws.yaml#DATA-TABLE-SURFACE`.
|
|
4
|
-
|
|
5
|
-
A `DataTable` has one flat look: no frame, no card, no fill; its title is the `Section` it stands under. The Grammar family 0.45.0 removed its `surface` prop (`card`, `frame`, `none`), so the compiler refuses it where the types are read; this rule names the fix, and applies it, where an app still writes it (a pinned older Grammar, a JavaScript file, an `any` prop).
|
|
6
|
-
|
|
7
|
-
Every rule below is an error in `coreGrammarConfig`; none can be switched off or suppressed inline.
|
|
8
|
-
|
|
9
|
-
## `starci-grammar/data-table-surface`
|
|
10
|
-
|
|
11
|
-
A Grammar `DataTable` (named or `G.DataTable`) with a `surface` attribute, whatever its value (message `surface`). A `surface` on another component (`Pane surface`), a non-Grammar `DataTable` and non-product source are not read.
|
|
12
|
-
|
|
13
|
-
AUTOFIX (`fixable: "code"`): the attribute and the whitespace before it are removed; the table keeps its columns, rows and `footer`.
|
|
14
|
-
|
|
15
|
-
**Invalid**
|
|
16
|
-
|
|
17
|
-
```tsx
|
|
18
|
-
<DataTable label="Runs" surface="card" columns={columns} rows={runs} />
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
**Valid**
|
|
22
|
-
|
|
23
|
-
```tsx
|
|
24
|
-
<Section title="Runs"><DataTable label="Runs" columns={columns} rows={runs} /></Section>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Rule ownership: [FE-RULE-OWNERSHIP](../../../contexts/code/fe/README.md#the-placement-test-fe-rule-ownership).
|
package/docs/message-surfaces.md
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# Message surfaces
|
|
2
|
-
|
|
3
|
-
Law module: `message-surfaces.ts`. Finding code: `FE_MESSAGE_SURFACES`. Knowledge: `knowledge/ui/presentation/grammar-laws.yaml#MESSAGE-SURFACES`. Grammar laws: `DNA-COMMON-CHAT-SURFACES` (0.37.31), `DNA-COMMON-CHAT-FRAME` (0.37.33).
|
|
4
|
-
|
|
5
|
-
Every chat (team chat, an agent's chat, an inbox thread, the assistant) draws the same three faces, and they belong to the Grammar: the thread is the page tone (`--background`; a `PaneSection scroll role="log"` paints it whatever `tone` says), a message of someone else (`MessageBubble` incoming, `MessageCard`) is one outlined look on every host (0.52.0: the 1px `--border` edge, no fill, no shadow), and the reader's own message is `--accent` with `--accent-foreground`. The replies a message card offers are `Section kind="list" layout="suggestions"` (one flat list, a pressable plain-text row per reply with a chevron); the pills by the composer stay `Button size="sm"` (`suggestion-buttons`).
|
|
6
|
-
|
|
7
|
-
A chat is one frame on any page (0.37.33): its head, its thread and its composer footer are `--background`, whether it stands in a white pane, the aside, a drawer, a dialog or a popover; the rest of the page keeps its own rule. The frame is a `Pane content="chat"` (a pane whose own stack holds a thread is drawn as one too); the app gives it no tone, and a message of someone else in it keeps its one outlined look.
|
|
8
|
-
|
|
9
|
-
The rule is an error in `coreGrammarConfig`; it cannot be switched off or suppressed inline.
|
|
10
|
-
|
|
11
|
-
## `starci-grammar/message-surfaces`
|
|
12
|
-
|
|
13
|
-
Flagged, in cheap static shapes only:
|
|
14
|
-
|
|
15
|
-
- a `className`, `class`, `style`, `UNSAFE_className` or `UNSAFE_style` attribute on a Grammar `MessageBubble` or `MessageCard`;
|
|
16
|
-
- a static class string (an attribute, a template without expressions, a `cn`/`clsx`/`cx`/`classNames`/`twMerge`/`twJoin` argument) or a style key in product source that names a Grammar message part (`starci-core-message-bubble…`, `starci-core-message-card…`);
|
|
17
|
-
- a `PaneSection` whose `scroll` object literal states `role: "log"` together with `tone: "surface"` (the Grammar ignores it: a thread is always the page tone);
|
|
18
|
-
- `surface` on a chat frame: a `Pane` with `content="chat"`, or a `Pane` whose own JSX children (fragments opened) hold a `PaneSection` with `scroll.role: "log"` (the frame is `--background`; the Grammar ignores the tone).
|
|
19
|
-
|
|
20
|
-
A spread, a computed class and a tone held in a variable are not read; a thread drawn by a component of the app's own (a `ChatThreadBand`) is not seen through, so such a pane states `content="chat"`.
|
|
21
|
-
|
|
22
|
-
**Invalid**
|
|
23
|
-
|
|
24
|
-
```tsx
|
|
25
|
-
<MessageBubble className="shadow-none" body={text} />
|
|
26
|
-
<div className="[&_.starci-core-message-bubble-body]:bg-white">{thread}</div>
|
|
27
|
-
<PaneSection scroll={{ label: "Thread", role: "log", tone: "surface" }}>{thread}</PaneSection>
|
|
28
|
-
<Pane area="room" surface content="chat" footer={composer}>{head}{thread}</Pane>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
**Valid**
|
|
32
|
-
|
|
33
|
-
```tsx
|
|
34
|
-
<Pane area="room" content="chat" label="Room" footer={composer}>{head}{thread}</Pane>
|
|
35
|
-
<PaneSection scroll={{ label: "Thread", role: "log", align: "end" }}>{thread}</PaneSection>
|
|
36
|
-
<MessageCard title="Workflow paused" body={<Section kind="list" layout="suggestions" ariaLabel="Suggestions" empty={null} items={replies} />} />
|
|
37
|
-
```
|
package/docs/status-colors.md
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# Status colors: content on a tone background takes the soft pair, a lone mark takes the tone
|
|
2
|
-
|
|
3
|
-
Law module: `status-colors.ts`. Catalogue: R61 FE_STYLE_TOKEN_ONLY (the status-pair rule for class names; no gate judges the colours an app's theme gives the pair).
|
|
4
|
-
|
|
5
|
-
A status tone `x` (`success`, `warning`, `danger`, `info`, read from `lib/status-tones.generated.ts`, which is generated from the grammar with the stylelint vocabulary) paints in two ways. Content that sits on a background of the tone uses the pair `x-soft` and `x-soft-foreground`, the way a HeroUI flat Chip does. A mark that stands alone, with no background of the tone behind it, uses `x` itself. A solid fill takes `x-foreground`.
|
|
6
|
-
|
|
7
|
-
Every rule below is an error in `coreGrammarConfig`; none can be switched off or suppressed inline.
|
|
8
|
-
|
|
9
|
-
## `starci-grammar/status-text-uses-soft-foreground`
|
|
10
|
-
|
|
11
|
-
Two findings, both read from `className`/`class`, from `cn()`/`clsx()` arguments, conditionals, arrays, constants and `classes` entries, with any variant, opacity or `!`:
|
|
12
|
-
|
|
13
|
-
- **on a tint** (message `onTint`): a class string that sets `bg-<tone>-soft` and also paints text, an icon or a text decoration with the solid tone of the same tone: `text-<tone>`, `fill-<tone>`, `stroke-<tone>`, `decoration-<tone>`. The content on the tint takes `text-<tone>-soft-foreground`.
|
|
14
|
-
- **alone** (message `alone`): `text-<tone>-soft-foreground` (or `fill-`, `stroke-`, `decoration-`) in the `className` of an element when neither that element nor an element that encloses it in the same file sets `bg-<tone>-soft`. A mark with no tint behind it takes `text-<tone>`. A constant, an array in a constant or a `classes` entry is not judged for this finding, since the element that wears it is not in view; a component that receives its tint from another file is judged where the tint is written.
|
|
15
|
-
|
|
16
|
-
On Offset Pop (`settings.starci.hfs.grammar` is `offset-pop`) the **alone** finding is not reported: the family's light-theme tones are pastel fills and a bare mark wears the soft foreground there; its dark theme keeps bare x, which the rule does not refuse either.
|
|
17
|
-
|
|
18
|
-
A bare solid tone (`text-success` with no `bg-success-soft` on the element), the pair on its tint, a solid fill with its own ink, a solid border, ring or outline, and a tone beside a tint of another tone are not findings.
|
|
19
|
-
|
|
20
|
-
**Invalid** (`src/components/leaves/StatusText/index.tsx`)
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
<span className="bg-success-soft text-success" />
|
|
24
|
-
<span className="text-danger-soft-foreground" />
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
**Valid** (`src/components/leaves/StatusText/index.tsx`)
|
|
28
|
-
|
|
29
|
-
```tsx
|
|
30
|
-
<span className="bg-success-soft text-success-soft-foreground" />
|
|
31
|
-
<span className="text-success" />
|
|
32
|
-
<div className="bg-danger-soft"><span className="text-danger-soft-foreground" /></div>
|
|
33
|
-
<button className="bg-success text-success-foreground" />
|
|
34
|
-
<div className="border-danger ring-2 ring-warning" />
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
**Finding code:** `FE_STYLE_TOKEN_ONLY`
|
|
38
|
-
|
|
39
|
-
**Why:** `<file>` colours status content against the status pair rule (`<what>`): content on a `bg-<tone>-soft` tint paints with the solid tone, or a mark with no tint behind it paints with the soft foreground.
|
|
40
|
-
|
|
41
|
-
**Fix:** Content on a background of the tone takes the pair: `bg-<tone>-soft` with `text-<tone>-soft-foreground`. A mark that stands alone, with no background of the tone, takes the tone itself: `text-<tone>`. A solid fill takes `bg-<tone>` with `text-<tone>-foreground`.
|
|
42
|
-
|
|
43
|
-
Rule ownership: [FE-RULE-OWNERSHIP](../../../contexts/code/fe/README.md#the-placement-test-fe-rule-ownership).
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Suggestion buttons
|
|
2
|
-
|
|
3
|
-
Law module: `suggestion-buttons.ts`. Finding code: `FE_SUGGESTION_BUTTONS`. Knowledge: `knowledge/ui/presentation/grammar-laws.yaml#SUGGESTION-BUTTONS`.
|
|
4
|
-
|
|
5
|
-
Suggestions, quick replies and empty-state shortcuts (the assistant drawer, chat composer suggestions) have ONE pattern: a `Cluster gap="inline"` (with a `label`) of neutral `Button size="sm"`. Every Button size draws a pill. The law refuses the alternatives drawn as suggestions: Links, ChoiceChips, ChoiceButtons and Chips that run an action or send their own label.
|
|
6
|
-
|
|
7
|
-
The rule is an error in `coreGrammarConfig`; it cannot be switched off or suppressed inline.
|
|
8
|
-
|
|
9
|
-
## `starci-grammar/suggestion-buttons`
|
|
10
|
-
|
|
11
|
-
Flagged, in cheap static shapes only:
|
|
12
|
-
|
|
13
|
-
- a row (two or more siblings in a Grammar `Cluster` or `Stack`, or a `div`, through fragments, `cond && x`, ternaries and `.map`; or one Link drawn by a `.map`) of Grammar `Link`s whose `onFollow` or `onPress` is an inline arrow passing the Link's own label (`{q}` and `send(q)`, `{item.label}` and `ask(item.label)`, or an equal string literal) and whose `href` is absent or `"#"`;
|
|
14
|
-
- a Grammar `ChoiceChips` or `ChoiceButtons` whose `onValueChange` is an inline arrow calling something that is not a state setter with the value, or is a bare `send`/`ask`/`submit`/`reply`/`post`/`dispatch` function: it sends the choice instead of keeping it selected;
|
|
15
|
-
- a HeroUI `Chip` (imported from `@heroui/react`) whose `onPress` or `onClick` passes its own label.
|
|
16
|
-
|
|
17
|
-
Grammar `Badge` has no action prop and Grammar `TagGroup` only `onRemove(ids)` and `onReorder(ids)`, so neither is judged. A spread, a computed prop, an unreadable handler, or a callee named `set*`, `on*`, `handle*` or `update*` is not flagged.
|
|
18
|
-
|
|
19
|
-
**Invalid**
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
<Cluster>{questions.map((q) => <Link key={q} href="#" onFollow={() => send(q)}>{q}</Link>)}</Cluster>
|
|
23
|
-
<ChoiceChips label="Ask" options={options} onValueChange={(v) => send(v)} />
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
**Valid**
|
|
27
|
-
|
|
28
|
-
```tsx
|
|
29
|
-
<Cluster gap="inline" label="Suggested questions">
|
|
30
|
-
{questions.map((q) => <Button key={q} size="sm" onPress={() => send(q)}>{q}</Button>)}
|
|
31
|
-
</Cluster>
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Rule ownership: [FE-RULE-OWNERSHIP](../../../contexts/code/fe/README.md#the-placement-test-fe-rule-ownership).
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# A list is one thing, never a card
|
|
2
|
-
|
|
3
|
-
Law module: `surface-card-list.ts`. Finding code: `FE_SURFACE_CARD_LIST`. Knowledge: `knowledge/ui/presentation/grammar-laws.yaml#LIST-ONE-LOOK`.
|
|
4
|
-
|
|
5
|
-
A list is `Section kind="list"` of `ListRow`s wherever it stands (the page canvas, a card body, a drawer, a pane band, a rail): plain rows
|
|
6
|
-
on the surface, divided by hairlines, the rows aligned with the section title, with no frame, fill, radius or shadow. A list is never a
|
|
7
|
-
card; cards stay for real objects. The Grammar family 0.43.0 removed `SurfaceCard kind="list"`, so the compiler refuses it where the
|
|
8
|
-
types are read; this rule names the fix where an app still writes it.
|
|
9
|
-
|
|
10
|
-
Every rule below is an error in `coreGrammarConfig`; none can be switched off or suppressed inline.
|
|
11
|
-
|
|
12
|
-
## `starci-grammar/surface-card-list`
|
|
13
|
-
|
|
14
|
-
A Grammar `SurfaceCard` whose `kind` is the literal `"list"` (message `list`). A `kind` that is not a literal is left to the compiler.
|
|
15
|
-
|
|
16
|
-
There is no autofix: `label` becomes `title` and `labelEnd` becomes `action`, a filter or search is the list's `filter`, the import changes, and the look changes from a
|
|
17
|
-
card to flat rows.
|
|
18
|
-
|
|
19
|
-
**Invalid**
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
<SurfaceCard kind="list" label="Runs" labelEnd={<Link variant="head" href="/runs">View all</Link>} items={runs} empty={empty} />
|
|
23
|
-
<MessageCard title="Workflow paused" body={<SurfaceCard kind="list" layout="suggestions" ariaLabel="Replies" items={replies} empty={null} />} />
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
**Valid**
|
|
27
|
-
|
|
28
|
-
```tsx
|
|
29
|
-
<Section kind="list" title="Runs" action={<Link variant="head" href="/runs">View all</Link>} items={runs} empty={empty} />
|
|
30
|
-
<MessageCard title="Workflow paused" body={<Section kind="list" layout="suggestions" ariaLabel="Replies" items={replies} empty={null} />} />
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Rule ownership: [FE-RULE-OWNERSHIP](../../../contexts/code/fe/README.md#the-placement-test-fe-rule-ownership).
|
package/docs/tab-count-chip.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# A tab count is a chip
|
|
2
|
-
|
|
3
|
-
Law module: `tab-count-chip.ts`. Finding code: `FE_TAB_COUNT_CHIP`. Knowledge: `knowledge/ui/presentation/grammar-laws.yaml#TAB-COUNT-CHIP`.
|
|
4
|
-
|
|
5
|
-
A count on any tab (page layer 1 or 2, a filter tab) is a 12px chip the tab draws from `count`, never "\· N" text in the label. The chip is grey; it is pink only when the number is work waiting for the owner (`isAttention`). Page tabs hide the chip at 0; filter tabs keep a grey 0.
|
|
6
|
-
|
|
7
|
-
Every rule below is an error in `coreGrammarConfig`; none can be switched off or suppressed inline.
|
|
8
|
-
|
|
9
|
-
## `starci-grammar/tab-count-chip`
|
|
10
|
-
|
|
11
|
-
- An object with `id` and `label` (a tab item) in a file that imports `@starci/grammar`, whose string `label` ends in `\· <digits>`, or whose template label ends in `\· ${expression}` (message `label`).
|
|
12
|
-
|
|
13
|
-
**Invalid**
|
|
14
|
-
|
|
15
|
-
```tsx
|
|
16
|
-
{ id: "all", label: "All \· 5" }
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
**Valid**
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
{ id: "all", label: "All", count: 5 }
|
|
23
|
-
{ id: "todo", label: "To approve", count: 3, isAttention: true }
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Rule ownership: [FE-RULE-OWNERSHIP](../../../contexts/code/fe/README.md#the-placement-test-fe-rule-ownership).
|