@atelic-action/ui 0.7.0 → 0.7.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/README.md CHANGED
@@ -162,7 +162,7 @@ Runner emails are mobile first. A layout that squashes on a phone is fixed here,
162
162
 
163
163
  `RecordStack` takes `records`, each a `RecordStackItem` (`title`, `url`, `meta`, `note`, `badge`, `callout`), and renders one table row per record: the title on its own line at 15px, bold and wrapping freely, linked when `url` is set; a mono meta line beneath it with the items joined by middle dots (empty items drop); an optional note beneath that; a hairline between records and none after the last. No cell carries a width, so a name of any length wraps at 320 pixels instead of squashing. An optional `badge` (a stage word such as `"Contacted"`) sits on the title line in a small mono uppercase pill on a `line` hairline, in its own right aligned unbroken cell, so the title keeps wrapping beside it and the badge stays on the title's first line. An optional `callout` (`{ eyebrow, text }`) sets a short task under the meta and the note in the accented `Note` idiom: the eyebrow in the accent, the text at 13px, and a 2px accent rule down its left edge. A record with neither renders exactly as it did before. `recordStackText(records)` is its plain text twin: each title on its own line under a two space indent with any badge after it in square brackets (`Blue Heron Plumbing [Contacted]`), the meta and the note wrapped under a four space indent, any callout as its eyebrow in upper case over its text under that same indent, a blank line between records, and no line past `textWidth` (68 columns, indent included).
164
164
 
165
- The Company Cards additions (0.7.0, from the `Company Cards IA` design, 2026-09-29) ride on the same item and change nothing for a record without them. `badges` is a list of further pills after `badge`, each with a `tone`: `faint` is the quiet stage word, `ink` a bold pill in ink on a 1.5px border (the next touch), `accent` the same in the accent (New). `timeline` (`{ days, touches, opens }`, each day count back from today) draws the record's recent days between the title and the meta line as one table cell per day, an 8px ink square on each send day and a 5px accent dot on each known open day, the two stacked when they share a day, all standing on a `line` hairline with a 1.5px ink tick at today's edge; nothing is positioned, so it survives Gmail. `RecordTimelineStrip` renders one on its own and `RecordTimelineLegend` names the marks once above a list. `aside` (`{ text, strong, tone }`) sets a fact right on the meta line with its number in bold and colored by tone: `up` fresh, `warm` cooling, `accent` cold. In the text twin every pill follows the title in brackets, the timeline is one character per day (`10d [#······@·o|]`: `#` a send, `o` an open, `@` both, `·` nothing, `|` today), and the aside ends the meta line; `recordTimelineText` and `recordBadges` are the helpers it uses.
165
+ The Company Cards additions (0.7.0, from the `Company Cards IA` design, 2026-09-29) ride on the same item and change nothing for a record without them. `badges` is a list of further pills after `badge`, each with a `tone`: `faint` is the quiet stage word, `ink` a bold pill in ink on a 1.5px border (the next touch), `accent` the same in the accent (New). `timeline` (`{ days, touches, opens }`, each day count back from today) draws the record's recent days between the title and the meta line as one table cell per marked day and one per run of empty days between them (seven cells for three marks, never thirty, since Gmail clips a message past about 100 KB), an 8px ink square on each send day and a 5px accent dot on each known open day, the two stacked when they share a day, all standing on a `line` hairline with a 1.5px ink tick at today's edge; nothing is positioned, so it survives Gmail. `RecordTimelineStrip` renders one on its own and `RecordTimelineLegend` names the marks once above a list. `aside` (`{ text, strong, tone }`) sets a fact right on the meta line with its number in bold and colored by tone: `up` fresh, `warm` cooling, `accent` cold. In the text twin every pill follows the title in brackets, the timeline is one character per day (`10d [#······@·o|]`: `#` a send, `o` an open, `@` both, `·` nothing, `|` today), and the aside ends the meta line; `recordTimelineText` and `recordBadges` are the helpers it uses.
166
166
 
167
167
  `StatStrip` lays its stats out as inline block cells with an 88 pixel floor inside one centered cell, so six or seven stats flow onto a second row on a phone rather than shrinking. Each stat takes an optional `delta` (`"+3 (12%)"`), set small under its label and colored by its sign: one that opens on `+` wears the palette's `up`, one that opens on `-` its `down`, and anything else stays muted.
168
168
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atelic-action/ui",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Shared UI for the Atelic templates: site chrome, base styles, and the component library they install",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -441,7 +441,6 @@ function RecordBadge({ text, tone = "faint" }: RecordBadgeProps) {
441
441
  border: tone === "faint" ? `1px solid ${palette.line}` : `1.5px solid ${color}`,
442
442
  borderRadius: "3px",
443
443
  color,
444
- whiteSpace: "nowrap",
445
444
  }}
446
445
  >
447
446
  {text}
@@ -467,61 +466,65 @@ export type RecordTimelineStripProps = { timeline: RecordTimeline };
467
466
  * A record's recent days on one line, today at the right edge: an ink square
468
467
  * on each day a send went out, an accent dot on each day an open is known,
469
468
  * the two stacked when they share a day, all standing on a hairline with a
470
- * tick for today. One table cell per day and nothing positioned, so it
471
- * survives every mail client (Company Cards IA, 2026-09-29).
469
+ * tick for today. One cell per marked day and one per run of empty days
470
+ * between them, so a record with three marks is seven cells rather than
471
+ * thirty: Gmail clips a message past about 100 KB and a stage list carries
472
+ * dozens of records. Nothing is positioned, so it survives every mail client
473
+ * (Company Cards IA, 2026-09-29).
472
474
  */
473
475
  export function RecordTimelineStrip({ timeline }: RecordTimelineStripProps) {
474
476
  const { palette } = useEmailTheme();
475
477
  const days = Math.max(1, Math.round(timeline.days));
476
478
  const touch = new Set(timeline.touches.map((d) => Math.round(d)));
477
479
  const open = new Set(timeline.opens.map((d) => Math.round(d)));
478
- const cells = Array.from({ length: days }, (_, i) => days - 1 - i);
480
+ const cells: { ago: number; span: number; sent: boolean; opened: boolean }[] = [];
481
+ for (let ago = days - 1; ago >= 0; ago -= 1) {
482
+ const sent = touch.has(ago);
483
+ const opened = open.has(ago);
484
+ const last = cells[cells.length - 1];
485
+ if (!sent && !opened && last && !last.sent && !last.opened) last.span += 1;
486
+ else cells.push({ ago, span: 1, sent, opened });
487
+ }
488
+ const unit = 100 / days;
479
489
  return (
480
- <table {...tableReset} width="100%" style={{ marginTop: "8px" }}>
490
+ <table
491
+ {...tableReset}
492
+ width="100%"
493
+ style={{
494
+ marginTop: "8px",
495
+ height: "14px",
496
+ textAlign: "center",
497
+ borderBottom: `1px solid ${palette.line}`,
498
+ borderRight: `1.5px solid ${palette.ink}`,
499
+ }}
500
+ >
481
501
  <tbody>
482
502
  <tr>
483
- {cells.map((ago) => {
484
- const sent = touch.has(ago);
485
- const opened = open.has(ago);
486
- return (
487
- <td
488
- key={ago}
489
- width={`${100 / days}%`}
490
- style={{
491
- height: "16px",
492
- verticalAlign: "bottom",
493
- textAlign: "center",
494
- borderBottom: `1px solid ${palette.line}`,
495
- ...(ago === 0 ? { borderRight: `1.5px solid ${palette.ink}` } : {}),
496
- }}
497
- >
498
- {sent ? (
499
- <div
500
- style={{
501
- width: "8px",
502
- height: "8px",
503
- margin: "0 auto",
504
- background: palette.ink,
505
- }}
506
- />
507
- ) : null}
508
- {opened ? (
509
- <div
510
- style={{
511
- width: "5px",
512
- height: "5px",
513
- margin: `${sent ? "2px" : "0"} auto 0`,
514
- borderRadius: "50%",
515
- background: palette.accent,
516
- }}
517
- />
518
- ) : null}
519
- {sent || opened ? null : (
520
- <div style={{ height: "1px", fontSize: "1px", lineHeight: "1px" }}>&nbsp;</div>
521
- )}
522
- </td>
523
- );
524
- })}
503
+ {cells.map((cell) => (
504
+ <td
505
+ key={cell.ago}
506
+ valign="bottom"
507
+ colSpan={cell.span}
508
+ width={`${Math.round(unit * cell.span * 100) / 100}%`}
509
+ >
510
+ {cell.sent ? (
511
+ <div
512
+ style={{ width: "8px", height: "8px", margin: "0 auto", background: palette.ink }}
513
+ />
514
+ ) : null}
515
+ {cell.opened ? (
516
+ <div
517
+ style={{
518
+ width: "5px",
519
+ height: "5px",
520
+ margin: `${cell.sent ? "2px" : "0"} auto 0`,
521
+ borderRadius: "50%",
522
+ background: palette.accent,
523
+ }}
524
+ />
525
+ ) : null}
526
+ </td>
527
+ ))}
525
528
  </tr>
526
529
  </tbody>
527
530
  </table>
@@ -624,25 +627,26 @@ export function RecordStack({ records }: RecordStackProps) {
624
627
  }}
625
628
  >
626
629
  {badges.length > 0 ? (
627
- <table {...tableReset} width="100%">
630
+ <table {...tableReset} width="100%" style={titleStyle}>
628
631
  <tbody>
629
632
  <tr>
630
- <td style={{ ...titleStyle, verticalAlign: "top" }}>{title}</td>
633
+ <td valign="top">{title}</td>
631
634
  <td
632
635
  align="right"
636
+ valign="top"
633
637
  style={{
634
638
  textAlign: "right",
635
639
  whiteSpace: "nowrap",
636
- verticalAlign: "top",
637
640
  paddingLeft: "12px",
638
641
  paddingTop: "2px",
639
642
  }}
640
643
  >
641
644
  {badges.map((badge, j) => (
642
645
  // biome-ignore lint/suspicious/noArrayIndexKey: a pill's position is its identity
643
- <span key={j} style={{ marginLeft: j === 0 ? "0" : "4px" }}>
646
+ <Fragment key={j}>
647
+ {j === 0 ? null : " "}
644
648
  <RecordBadge text={badge.text} tone={badge.tone} />
645
- </span>
649
+ </Fragment>
646
650
  ))}
647
651
  </td>
648
652
  </tr>
@@ -654,19 +658,11 @@ export function RecordStack({ records }: RecordStackProps) {
654
658
  {record.timeline ? <RecordTimelineStrip timeline={record.timeline} /> : null}
655
659
  {meta.length > 0 || aside ? (
656
660
  aside ? (
657
- <table {...tableReset} width="100%" style={{ marginTop: "4px" }}>
661
+ <table {...tableReset} width="100%" style={{ ...metaStyle, marginTop: "4px" }}>
658
662
  <tbody>
659
663
  <tr>
660
- <td style={metaStyle}>{meta.join(" · ")}</td>
661
- <td
662
- align="right"
663
- style={{
664
- ...metaStyle,
665
- textAlign: "right",
666
- whiteSpace: "nowrap",
667
- paddingLeft: "12px",
668
- }}
669
- >
664
+ <td>{meta.join(" · ")}</td>
665
+ <td align="right" style={{ whiteSpace: "nowrap", paddingLeft: "12px" }}>
670
666
  {aside}
671
667
  </td>
672
668
  </tr>