@usefidel/design-system 0.5.0 → 0.7.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.
@@ -10,6 +10,6 @@
10
10
  "webapp.css"
11
11
  ],
12
12
  "storybookUrl": null,
13
- "packageVersion": "0.5.0",
14
- "resolvedSha": "03a49c2e8d888b7916f449d7801daa922c525737"
13
+ "packageVersion": "0.7.0",
14
+ "resolvedSha": "e51d3196d9780b87d0fd4f00db40506a6288ab8c"
15
15
  }
package/dist/index.cjs CHANGED
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
23
  Button: () => Button,
24
+ DiffPropertyList: () => DiffPropertyList,
24
25
  DiffSection: () => DiffSection,
25
26
  MismatchCard: () => MismatchCard
26
27
  });
@@ -202,20 +203,15 @@ function ElementRow({
202
203
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "fds-diff-section__element-count", children: plural(element.properties.length, "property", "properties") }),
203
204
  hasDetail && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Chevron2, { open, className: "fds-diff-section__element-caret" })
204
205
  ] }),
205
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "fds-diff-section__lines", children: element.properties.map((line, li) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "fds-diff-section__line", children: [
206
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "fds-diff-section__prop", children: line.property }),
207
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "fds-diff-section__delta", children: [
208
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "fds-diff-section__live", children: line.live }),
209
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Arrow, {}),
210
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "fds-diff-section__design", children: line.design })
211
- ] })
212
- ] }, `${line.property}-${li}`)) })
206
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DiffPropertyList, { properties: element.properties })
213
207
  ] });
214
208
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
215
209
  "div",
216
210
  {
217
211
  className: "fds-diff-section__element",
218
212
  "data-open": hasDetail && open ? "true" : void 0,
213
+ "data-highlighted": element.highlighted ? "true" : void 0,
214
+ "data-anchor-id": element.anchorId,
219
215
  onMouseEnter: onHover ? () => onHover(index, true) : void 0,
220
216
  onMouseLeave: onHover ? () => onHover(index, false) : void 0,
221
217
  children: [
@@ -234,6 +230,18 @@ function ElementRow({
234
230
  }
235
231
  );
236
232
  }
233
+ function DiffPropertyList({ properties, className, ...rest }) {
234
+ const classes = ["fds-diff-section__lines", className].filter(Boolean).join(" ");
235
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: classes, ...rest, children: properties.map((line, li) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "fds-diff-section__line", children: [
236
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "fds-diff-section__prop", children: line.property }),
237
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "fds-diff-section__delta", children: [
238
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "fds-diff-section__live", children: line.live }),
239
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Arrow, {}),
240
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "fds-diff-section__design", children: line.design })
241
+ ] }),
242
+ line.trailing != null && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "fds-diff-section__trailing", children: line.trailing })
243
+ ] }, `${line.property}-${li}`)) });
244
+ }
237
245
  function Chevron2({ open, className }) {
238
246
  const classes = [
239
247
  "fds-diff-section__chevron",
@@ -277,6 +285,7 @@ function Arrow() {
277
285
  // Annotate the CommonJS export names for ESM import in node:
278
286
  0 && (module.exports = {
279
287
  Button,
288
+ DiffPropertyList,
280
289
  DiffSection,
281
290
  MismatchCard
282
291
  });
package/dist/index.css CHANGED
@@ -310,6 +310,11 @@
310
310
  .fds-diff-section__element {
311
311
  display: flex;
312
312
  flex-direction: column;
313
+ transition: background var(--duration-quick, 150ms) ease;
314
+ }
315
+ .fds-diff-section__element[data-highlighted=true] {
316
+ background: var(--color-accent-subtle, var(--color-surface-hover));
317
+ box-shadow: inset 2px 0 0 var(--color-accent);
313
318
  }
314
319
  .fds-diff-section__element-head {
315
320
  display: flex;
@@ -371,7 +376,6 @@
371
376
  .fds-diff-section__line {
372
377
  display: flex;
373
378
  align-items: center;
374
- justify-content: space-between;
375
379
  width: 100%;
376
380
  }
377
381
  .fds-diff-section__prop {
@@ -387,6 +391,7 @@
387
391
  display: flex;
388
392
  align-items: center;
389
393
  gap: var(--spacing-1);
394
+ margin-left: auto;
390
395
  font-family: var(--font-mono);
391
396
  font-weight: var(--font-weight-medium);
392
397
  font-size: 14px;
@@ -394,6 +399,13 @@
394
399
  letter-spacing: -0.28px;
395
400
  white-space: nowrap;
396
401
  }
402
+ .fds-diff-section__trailing {
403
+ display: flex;
404
+ align-items: center;
405
+ gap: var(--spacing-2);
406
+ margin-left: var(--spacing-3);
407
+ flex-shrink: 0;
408
+ }
397
409
  .fds-diff-section__live {
398
410
  color: #ef4444;
399
411
  }
package/dist/index.d.cts CHANGED
@@ -64,10 +64,23 @@ declare function MismatchCard({ title, properties, collapsedCount, defaultExpand
64
64
  interface DiffPropertyLine {
65
65
  /** Property name, e.g. "font-size". Rendered in mono. */
66
66
  property: string;
67
- /** Value on the live page — what shipped. Left of the arrow (error register). */
68
- live: string;
69
- /** Value in the design — the target. Right of the arrow (success register). */
70
- design: string;
67
+ /**
68
+ * Value on the live page — what shipped. Left of the arrow (error register).
69
+ * A string in the common case; accepts any node so a caller can prefix it
70
+ * with, e.g., a colour swatch.
71
+ */
72
+ live: ReactNode;
73
+ /**
74
+ * Value in the design — the target. Right of the arrow (success register).
75
+ * A string in the common case; accepts any node (see `live`).
76
+ */
77
+ design: ReactNode;
78
+ /**
79
+ * Optional content pinned to the right end of the row, after the delta —
80
+ * e.g. an occurrence count or a per-property review control. Omit for the
81
+ * plain read-only row. Presentational: the caller owns whatever lives here.
82
+ */
83
+ trailing?: ReactNode;
71
84
  }
72
85
  interface DiffElement {
73
86
  /** Element name, e.g. `"Pricing"`. */
@@ -91,6 +104,19 @@ interface DiffElement {
91
104
  * screenshot highlight). Leave undefined for uncontrolled (`defaultOpen`).
92
105
  */
93
106
  open?: boolean;
107
+ /**
108
+ * Emphasise this row without expanding it. When `true` the element renders a
109
+ * highlight treatment (a subtle fill and an accent edge). Use it to reflect
110
+ * an external selection — e.g. hovering a screenshot annotation highlighting
111
+ * its matching drawer row. Purely visual; does not affect `open`.
112
+ */
113
+ highlighted?: boolean;
114
+ /**
115
+ * Stamped onto the element root as `data-anchor-id`, giving the caller a
116
+ * stable handle to scroll this row into view (e.g. from a screenshot
117
+ * annotation) without threading a ref through the component.
118
+ */
119
+ anchorId?: string;
94
120
  }
95
121
  interface DiffSectionProps extends HTMLAttributes<HTMLDivElement> {
96
122
  /** Ordinal shown before the name, e.g. "01". Omitted in `headerless` mode. */
@@ -137,5 +163,18 @@ interface DiffSectionProps extends HTMLAttributes<HTMLDivElement> {
137
163
  * decision 2026-04-24): each delta reads `live → design`.
138
164
  */
139
165
  declare function DiffSection({ number, name, mismatchCount, elements, defaultExpanded, headerless, onElementToggle, onElementHover, className, ...rest }: DiffSectionProps): react.JSX.Element;
166
+ interface DiffPropertyListProps extends HTMLAttributes<HTMLDivElement> {
167
+ /** Property mismatch rows to render. */
168
+ properties: DiffPropertyLine[];
169
+ }
170
+ /**
171
+ * The bare list of property-delta rows — `property` on the left, a
172
+ * `live → design` mono delta, and an optional `trailing` slot — with the left
173
+ * rule and indent. Extracted from DiffSection so a caller that owns its own
174
+ * card shell (e.g. the extension's IssueCard) can render exactly these rows
175
+ * without DiffSection's element/section chrome. DiffSection uses it internally,
176
+ * so the two surfaces render byte-identical rows.
177
+ */
178
+ declare function DiffPropertyList({ properties, className, ...rest }: DiffPropertyListProps): react.JSX.Element;
140
179
 
141
- export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, type DiffElement, type DiffPropertyLine, DiffSection, type DiffSectionProps, MismatchCard, type MismatchCardProps, type MismatchProperty };
180
+ export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, type DiffElement, type DiffPropertyLine, DiffPropertyList, type DiffPropertyListProps, DiffSection, type DiffSectionProps, MismatchCard, type MismatchCardProps, type MismatchProperty };
package/dist/index.d.ts CHANGED
@@ -64,10 +64,23 @@ declare function MismatchCard({ title, properties, collapsedCount, defaultExpand
64
64
  interface DiffPropertyLine {
65
65
  /** Property name, e.g. "font-size". Rendered in mono. */
66
66
  property: string;
67
- /** Value on the live page — what shipped. Left of the arrow (error register). */
68
- live: string;
69
- /** Value in the design — the target. Right of the arrow (success register). */
70
- design: string;
67
+ /**
68
+ * Value on the live page — what shipped. Left of the arrow (error register).
69
+ * A string in the common case; accepts any node so a caller can prefix it
70
+ * with, e.g., a colour swatch.
71
+ */
72
+ live: ReactNode;
73
+ /**
74
+ * Value in the design — the target. Right of the arrow (success register).
75
+ * A string in the common case; accepts any node (see `live`).
76
+ */
77
+ design: ReactNode;
78
+ /**
79
+ * Optional content pinned to the right end of the row, after the delta —
80
+ * e.g. an occurrence count or a per-property review control. Omit for the
81
+ * plain read-only row. Presentational: the caller owns whatever lives here.
82
+ */
83
+ trailing?: ReactNode;
71
84
  }
72
85
  interface DiffElement {
73
86
  /** Element name, e.g. `"Pricing"`. */
@@ -91,6 +104,19 @@ interface DiffElement {
91
104
  * screenshot highlight). Leave undefined for uncontrolled (`defaultOpen`).
92
105
  */
93
106
  open?: boolean;
107
+ /**
108
+ * Emphasise this row without expanding it. When `true` the element renders a
109
+ * highlight treatment (a subtle fill and an accent edge). Use it to reflect
110
+ * an external selection — e.g. hovering a screenshot annotation highlighting
111
+ * its matching drawer row. Purely visual; does not affect `open`.
112
+ */
113
+ highlighted?: boolean;
114
+ /**
115
+ * Stamped onto the element root as `data-anchor-id`, giving the caller a
116
+ * stable handle to scroll this row into view (e.g. from a screenshot
117
+ * annotation) without threading a ref through the component.
118
+ */
119
+ anchorId?: string;
94
120
  }
95
121
  interface DiffSectionProps extends HTMLAttributes<HTMLDivElement> {
96
122
  /** Ordinal shown before the name, e.g. "01". Omitted in `headerless` mode. */
@@ -137,5 +163,18 @@ interface DiffSectionProps extends HTMLAttributes<HTMLDivElement> {
137
163
  * decision 2026-04-24): each delta reads `live → design`.
138
164
  */
139
165
  declare function DiffSection({ number, name, mismatchCount, elements, defaultExpanded, headerless, onElementToggle, onElementHover, className, ...rest }: DiffSectionProps): react.JSX.Element;
166
+ interface DiffPropertyListProps extends HTMLAttributes<HTMLDivElement> {
167
+ /** Property mismatch rows to render. */
168
+ properties: DiffPropertyLine[];
169
+ }
170
+ /**
171
+ * The bare list of property-delta rows — `property` on the left, a
172
+ * `live → design` mono delta, and an optional `trailing` slot — with the left
173
+ * rule and indent. Extracted from DiffSection so a caller that owns its own
174
+ * card shell (e.g. the extension's IssueCard) can render exactly these rows
175
+ * without DiffSection's element/section chrome. DiffSection uses it internally,
176
+ * so the two surfaces render byte-identical rows.
177
+ */
178
+ declare function DiffPropertyList({ properties, className, ...rest }: DiffPropertyListProps): react.JSX.Element;
140
179
 
141
- export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, type DiffElement, type DiffPropertyLine, DiffSection, type DiffSectionProps, MismatchCard, type MismatchCardProps, type MismatchProperty };
180
+ export { Button, type ButtonProps, type ButtonSize, type ButtonVariant, type DiffElement, type DiffPropertyLine, DiffPropertyList, type DiffPropertyListProps, DiffSection, type DiffSectionProps, MismatchCard, type MismatchCardProps, type MismatchProperty };
package/dist/index.js CHANGED
@@ -174,20 +174,15 @@ function ElementRow({
174
174
  /* @__PURE__ */ jsx3("span", { className: "fds-diff-section__element-count", children: plural(element.properties.length, "property", "properties") }),
175
175
  hasDetail && /* @__PURE__ */ jsx3(Chevron2, { open, className: "fds-diff-section__element-caret" })
176
176
  ] }),
177
- /* @__PURE__ */ jsx3("div", { className: "fds-diff-section__lines", children: element.properties.map((line, li) => /* @__PURE__ */ jsxs3("div", { className: "fds-diff-section__line", children: [
178
- /* @__PURE__ */ jsx3("span", { className: "fds-diff-section__prop", children: line.property }),
179
- /* @__PURE__ */ jsxs3("span", { className: "fds-diff-section__delta", children: [
180
- /* @__PURE__ */ jsx3("span", { className: "fds-diff-section__live", children: line.live }),
181
- /* @__PURE__ */ jsx3(Arrow, {}),
182
- /* @__PURE__ */ jsx3("span", { className: "fds-diff-section__design", children: line.design })
183
- ] })
184
- ] }, `${line.property}-${li}`)) })
177
+ /* @__PURE__ */ jsx3(DiffPropertyList, { properties: element.properties })
185
178
  ] });
186
179
  return /* @__PURE__ */ jsxs3(
187
180
  "div",
188
181
  {
189
182
  className: "fds-diff-section__element",
190
183
  "data-open": hasDetail && open ? "true" : void 0,
184
+ "data-highlighted": element.highlighted ? "true" : void 0,
185
+ "data-anchor-id": element.anchorId,
191
186
  onMouseEnter: onHover ? () => onHover(index, true) : void 0,
192
187
  onMouseLeave: onHover ? () => onHover(index, false) : void 0,
193
188
  children: [
@@ -206,6 +201,18 @@ function ElementRow({
206
201
  }
207
202
  );
208
203
  }
204
+ function DiffPropertyList({ properties, className, ...rest }) {
205
+ const classes = ["fds-diff-section__lines", className].filter(Boolean).join(" ");
206
+ return /* @__PURE__ */ jsx3("div", { className: classes, ...rest, children: properties.map((line, li) => /* @__PURE__ */ jsxs3("div", { className: "fds-diff-section__line", children: [
207
+ /* @__PURE__ */ jsx3("span", { className: "fds-diff-section__prop", children: line.property }),
208
+ /* @__PURE__ */ jsxs3("span", { className: "fds-diff-section__delta", children: [
209
+ /* @__PURE__ */ jsx3("span", { className: "fds-diff-section__live", children: line.live }),
210
+ /* @__PURE__ */ jsx3(Arrow, {}),
211
+ /* @__PURE__ */ jsx3("span", { className: "fds-diff-section__design", children: line.design })
212
+ ] }),
213
+ line.trailing != null && /* @__PURE__ */ jsx3("span", { className: "fds-diff-section__trailing", children: line.trailing })
214
+ ] }, `${line.property}-${li}`)) });
215
+ }
209
216
  function Chevron2({ open, className }) {
210
217
  const classes = [
211
218
  "fds-diff-section__chevron",
@@ -248,6 +255,7 @@ function Arrow() {
248
255
  }
249
256
  export {
250
257
  Button,
258
+ DiffPropertyList,
251
259
  DiffSection,
252
260
  MismatchCard
253
261
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usefidel/design-system",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Fidel brand design tokens + React component library — DTCG token source of truth, generated per-surface CSS + Tailwind-v4 parser-compatibility output, and on-brand React components (Button, MismatchCard, DiffSection).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",