@qmusic/email-shell 1.0.0 → 1.1.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/README.md CHANGED
@@ -42,7 +42,9 @@ Exports: `renderEmailShell`, `statusBanner`, `introBlock`, `introBlockHtml`,
42
42
 
43
43
  Date cards use the three-line form: pass `title` + `position` + `time` to
44
44
  `eventDetailCard()`. Passing only `subtitle` gives the legacy single-line card
45
- with no time on it.
45
+ with no time on it. The right-hand zone takes either a `rate` or, since 1.1.0,
46
+ a `logoUrl` (an image drawn for a light ground, 110px wide); the rate wins if
47
+ both are passed.
46
48
 
47
49
  ## How to make a style change
48
50
 
package/dist/index.d.ts CHANGED
@@ -158,13 +158,21 @@ export interface DetailCardInput extends DetailInfoInput {
158
158
  /** A late-night set (starts 12:00-4:59 AM, filed under the night before):
159
159
  * draws the LATE strip across the bottom of the date badge. See lateBadgeRow. */
160
160
  late?: boolean;
161
+ /** An image (a venue logo, say) in the right-hand zone where a rate would
162
+ * go: 110px wide, right-aligned, vertically centred, and on a phone it drops
163
+ * under a hairline like the rate does. Pass a version drawn for a light
164
+ * ground: the card is near-white. Ignored when `rate` is set; the rate zone
165
+ * holds one thing. */
166
+ logoUrl?: string;
167
+ /** Alt text for `logoUrl`, e.g. the venue name. */
168
+ logoAlt?: string;
161
169
  }
162
170
  /**
163
171
  * Event/shift detail inset: date badge + the detailInfoCell text column, with an
164
172
  * optional rate pinned to the right (the gig-alert shift-card layout). On mobile
165
173
  * the rate drops to its own right-aligned line under a hairline divider.
166
174
  */
167
- export declare function eventDetailCard({ month, day, weekday, year, title, subtitle, subtitleHtml, rate, rateColor, rateValign, rateSize, rateWidth, stampUrl, struck, footnoteHtml, position, time, timeHtml, late }: DetailCardInput): string;
175
+ export declare function eventDetailCard({ month, day, weekday, year, title, subtitle, subtitleHtml, rate, rateColor, rateValign, rateSize, rateWidth, stampUrl, struck, footnoteHtml, position, time, timeHtml, late, logoUrl, logoAlt }: DetailCardInput): string;
168
176
  /**
169
177
  * Coral left-rule callout. `html` is interpolated raw so callers can pass
170
178
  * <strong>…</strong> — only pass trusted/escaped content. Optional `signoff`
package/dist/index.js CHANGED
@@ -283,7 +283,7 @@ export function lateBadgeRow(late, radius, fontSize) {
283
283
  * optional rate pinned to the right (the gig-alert shift-card layout). On mobile
284
284
  * the rate drops to its own right-aligned line under a hairline divider.
285
285
  */
286
- export function eventDetailCard({ month, day, weekday, year, title, subtitle, subtitleHtml, rate, rateColor = 'ink', rateValign = 'middle', rateSize = '24px', rateWidth = '100', stampUrl, struck, footnoteHtml, position, time, timeHtml, late }) {
286
+ export function eventDetailCard({ month, day, weekday, year, title, subtitle, subtitleHtml, rate, rateColor = 'ink', rateValign = 'middle', rateSize = '24px', rateWidth = '100', stampUrl, struck, footnoteHtml, position, time, timeHtml, late, logoUrl, logoAlt }) {
287
287
  const dayStyle = `margin:0;font-size:34px;font-weight:800;line-height:1;color:${QM.ink};font-family:${FONT}` +
288
288
  (struck ? `;text-decoration:line-through;text-decoration-color:${QM.coralDark};text-decoration-thickness:3px` : '');
289
289
  // Rate zone styling. 'coral' matches the month accent (drop qm-ink so Outlook
@@ -320,8 +320,11 @@ export function eventDetailCard({ month, day, weekday, year, title, subtitle, su
320
320
  </table>
321
321
  </td>`;
322
322
  const venue = detailInfoCell({ title, position, time, timeHtml, subtitle, subtitleHtml });
323
- // No rate -> simple two-zone row. Rate -> wrap date+venue in qm-detailcell and
324
- // pin the amount in qm-ratecell (stacks on mobile via the responsive rules).
323
+ // No rate or logo -> simple two-zone row. Rate (or, failing that, a logo) ->
324
+ // wrap date+venue in qm-detailcell and pin it in qm-ratecell (stacks on
325
+ // mobile via the responsive rules; the logo reuses the rate's cell so the
326
+ // shell's CSS stays as it is).
327
+ const logo = (logoUrl ?? '').trim();
325
328
  const row = rate
326
329
  ? `
327
330
  <tr>
@@ -332,7 +335,17 @@ export function eventDetailCard({ month, day, weekday, year, title, subtitle, su
332
335
  <p class="${rateClass}" style="margin:0;font-size:${rateSize};font-weight:800;letter-spacing:-0.4px;line-height:1;white-space:nowrap;color:${rateHex};font-family:${FONT}">${esc(rate)}</p>
333
336
  </td>
334
337
  </tr>`
335
- : `
338
+ : logo
339
+ ? `
340
+ <tr>
341
+ <td class="qm-detailcell" valign="middle">
342
+ <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"><tr>${badge}${venue}</tr></table>
343
+ </td>
344
+ <td class="qm-ratecell" valign="middle" align="right" width="110" style="width:110px;padding-left:12px">
345
+ <img src="${esc(logo)}" width="110" alt="${esc(logoAlt ?? '')}" style="display:inline-block;width:110px;max-width:110px;height:auto;border:0;outline:none;text-decoration:none">
346
+ </td>
347
+ </tr>`
348
+ : `
336
349
  <tr>${badge}${venue}</tr>`;
337
350
  // Stamp rides as a no-repeat centered background on the inset cell so the
338
351
  // date/venue text sits on top. Clients that drop background-images (older
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qmusic/email-shell",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Q Music transactional email shell: the warm light card every client and artist email renders in.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {