@starci/eslint-grammar-core 0.37.2 → 0.38.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starci/eslint-grammar-core",
3
- "version": "0.37.2",
3
+ "version": "0.38.1",
4
4
  "description": "ESLint rules for the core Grammar's component, token and composition contracts.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@starci/eslint-canon-fe": "~9.16.0",
45
- "@starci/hfs": "~6.6.0",
45
+ "@starci/hfs": "~6.8.0",
46
46
  "eslint": ">=9",
47
47
  "typescript": ">=5.9"
48
48
  },
@@ -68,6 +68,6 @@
68
68
  "eslint-plugin-react-hooks": "^7.1.1",
69
69
  "typescript": "^6.0.3"
70
70
  },
71
- "gitHead": "bd0749096b539c95c3aa8ede70999d5d7c8e31d9",
72
- "starciSource": "593d14b4ef36fb10f6e3115d4f86afbbafb59b02e87c162f69376a116e808871"
71
+ "gitHead": "bf397f2b69c82c3014caeb2f71158c91624ecf47",
72
+ "starciSource": "2cbb8c1945a70ca7ce679cef89df0d2a16b209f4a59aa62efaeed8a21e3f658f"
73
73
  }
@@ -77,6 +77,27 @@ rules:
77
77
  assert: |-
78
78
  It is a workspace page, `Page chrome="panes"`: a grid of panes split by dividers, side panes white surfaces at full
79
79
  height, never cards. The main pane may hold a pink well that follows case-1.
80
+ - id: MESSAGE-SURFACES
81
+ title: Every chat draws Grammar's three faces and an app never restyles them
82
+ governs: A chat thread, the messages in it and the replies a message card offers.
83
+ cases:
84
+ - id: case-1
85
+ when: A chat thread with messages is drawn (team chat, an agent's chat, an inbox thread, the assistant)
86
+ assert: |-
87
+ The thread is a `PaneSection scroll role="log"` on the page tone `--background`; a message of someone else
88
+ (`MessageBubble` incoming, `MessageCard`) is the flat `--surface` with no border and no shadow; the reader's own
89
+ message is `--accent` with `--accent-foreground`. No class or style reaches a bubble, a card or the thread ground.
90
+ - id: case-2
91
+ when: A message card offers replies to send
92
+ assert: |-
93
+ They are one bordered list, `SurfaceCard kind="list" layout="suggestions"`, a plain-text row per reply whose whole
94
+ row sends it, with a trailing chevron; the suggestion pills by the composer stay `Button size="sm"`.
95
+ - id: case-3
96
+ when: A chat is drawn on any page (the chat page, an inbox thread between a list and an aside, an agent's chat tab, an aside or a drawer)
97
+ assert: |-
98
+ The chat is one frame, `Pane content="chat"` (head, thread, composer `footer`), painted `--background` as a whole
99
+ whatever it stands on; it states no `surface`. The rest of the page keeps its own rule (a room list stays white).
100
+ The composer field stays white, the 1px lines between the zones stay, and every message in the frame is flat.
80
101
  - id: SUGGESTION-BUTTONS
81
102
  title: Suggestions and quick replies are a Cluster of neutral sm Buttons
82
103
  governs: Anything that suggests something to say or ask.
@@ -148,6 +169,33 @@ rules:
148
169
  assert: |-
149
170
  It is HeroUI v3's link: the primary colour, the underline on hover only, the anchor icon at the end. Its type size and leading are
150
171
  inherited (14 in a body, 12 in meta or caption text). A size prop, a size class and an underline or decoration class are refused.
172
+ - id: ROWS-IN-CARD
173
+ title: Rows of data are always a card
174
+ governs: A list of rows or key-value rows on the well or on a white surface.
175
+ cases:
176
+ - id: case-1
177
+ when: A DescriptionList or DisclosureList is drawn
178
+ assert: |-
179
+ It stands in a Section or a SurfaceCard, so it is a card: a shadow and no border on the pink well, a 1px border and no shadow on a white
180
+ surface (aside, pane, drawer); Grammar draws that edge itself. A row primitive with no card around it is refused. ListBox is a navigation list and is not read.
181
+ - id: CARD-NO-DESCRIPTION
182
+ title: A card has no description
183
+ governs: The head of a SurfaceCard and the line above it.
184
+ cases:
185
+ - id: case-1
186
+ when: A card is drawn with a label
187
+ assert: |-
188
+ The head is the label, a count chip, one fact and one end action; SurfaceCard has no description or subtitle prop. A muted Text written directly above a
189
+ SurfaceCard as its description is refused: the line is a row subtitle (select or list) or, when it explains the card's data, the card note.
190
+ - id: LABEL-SUBLABEL-HIERARCHY
191
+ title: One Label per section; nested groups use a Sublabel
192
+ governs: The Label of a Section or SurfaceCard and the Sublabel of the groups inside it.
193
+ cases:
194
+ - id: case-1
195
+ when: A labelled section holds groups of cards
196
+ assert: |-
197
+ The section has exactly one Label (14 / 500, 12px above its content). Each group inside it is a Section or SurfaceCard with `sublabel` (12 / 500 muted, 8px above its card),
198
+ never a second `title` / `label`; groups stand 24px apart. A Section or SurfaceCard with `sublabel` and a Label together is refused by the types.
151
199
  - id: SECTION-HEAD-ACTION
152
200
  title: A section head is one row with at most one thing at its end
153
201
  governs: The head of a Grammar Section.
@@ -156,8 +204,8 @@ rules:
156
204
  when: A Section head carries an action
157
205
  assert: |-
158
206
  The head is ONE row: the label (14, 500) and an optional count chip (12) at the start, at most ONE thing at the end, a navigation
159
- Link variant="head" (the label then an arrow that slides about 3px on hover) or an info IconButton. A Button is refused (navigation is a
160
- Link) and so are two commands. There is no description under the label: it is a caption (12, muted) below the card or list.
207
+ Link variant="head" (the label then an arrow that slides about 3px on hover), an info IconButton, or (0.37.25) a neutral small text Button
208
+ (intent neutral, size sm, no icon: "Gắn thêm provider"). A primary or commit Button, another size or an icon Button is refused, and so are two commands. There is no description under the label: it is a caption (12, muted) below the card or list.
161
209
  - id: TAB-COUNT-CHIP
162
210
  title: A tab count is a 12px chip, grey unless it is work waiting for the owner
163
211
  governs: The count on a Grammar tab, page layers 1 and 2 and filter tabs.
@@ -196,15 +244,15 @@ rules:
196
244
  label, a search field, a button start icon, a link arrow, meta) is a plain outline icon at text size with no tile. A status (done, running, failed, waiting,
197
245
  skipped) is a tone-coloured outline icon with no tile: outline check-circle in success, x-circle in danger, a spinning arrow for running.
198
246
  - id: SINGLE-CHILD-CARD
199
- title: A table, list or chart standing alone is the surface
200
- governs: A SurfaceCard whose only content is a table, a list or a chart.
247
+ title: A lone DataTable or chart is the surface; a list card is always valid
248
+ governs: A SurfaceCard whose only content is a DataTable or a chart (a list or key-value card is valid, 0.37.8).
201
249
  cases:
202
250
  - id: case-1
203
- when: A card has no zones (headers, footers, head actions) and holds one DataTable, list (ListBox, ItemList, DisclosureList, Timeline, Section kind="list") or chart (BarChart, ProportionBar, BubbleMap, FlowGraph, MermaidDiagram), or is kind="table" or kind="list"
251
+ when: A card has no zones (headers, footers, head actions) and holds one DataTable or chart (BarChart, ProportionBar, BubbleMap, FlowGraph, MermaidDiagram)
204
252
  assert: |-
205
- The Grammar draws a standalone DataTable and every Section kind="list" as ONE frame (border, card radius), so the
206
- card is a second frame. The title sits above as a Section head and one caption sits below (Section caption, muted sm).
207
- A card groups two or more different parts (figures + list + actions), or carries zones (tabs, search, head actions).
253
+ A standalone DataTable and chart is ONE frame (border, card radius), so the card is a second frame. The title sits above as a Section head and one caption
254
+ sits below (Section caption, muted sm). A card of list or key-value rows (SurfaceCard kind="list", "table", "select", ListBox, DisclosureList, Section kind="list",
255
+ DescriptionList) is valid alone or not (0.37.8). A card groups two or more different parts (figures + list + actions), or carries zones (tabs, search, head actions).
208
256
  - id: NO-RAW-SCROLL
209
257
  title: NIVO never shows scrollbars
210
258
  governs: Scroll areas an app draws.