@bytebrand/fe-ui-core-autobahn 1.0.229 → 1.0.231

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.
@@ -23,6 +23,9 @@ const CampaignHero: React.FunctionComponent<CampaignHeroProps> = ({ campaign, t
23
23
  const left = useCountdown(campaign.endsAt);
24
24
  if (!left || !isCampaignRunning(campaign)) return null;
25
25
  const units: Array<[string, number]> = [['days', left.days], ['hours', left.hours], ['minutes', left.minutes]];
26
+ const title: string = t(campaign.texts + '.title');
27
+ // the footnote mark goes before the closing punctuation: "günstiger²."
28
+ const stop = campaign.titleNote ? (title.match(/[.!?…]+$/) || [''])[0] : '';
26
29
  return (
27
30
  <section
28
31
  className={'campaign-hero campaign-hero--' + campaign.id}
@@ -32,8 +35,9 @@ const CampaignHero: React.FunctionComponent<CampaignHeroProps> = ({ campaign, t
32
35
  <div>
33
36
  <div className="campaign-hero-period">{t(campaign.texts + '.period', { ...campaignPeriod(campaign) })}</div>
34
37
  <h2 className="campaign-hero-title">
35
- {t(campaign.texts + '.title')}
38
+ {title.slice(0, title.length - stop.length)}
36
39
  {campaign.titleNote ? <sup className="campaign-hero-note">{campaign.titleNote}</sup> : null}
40
+ {stop}
37
41
  </h2>
38
42
  <p className="campaign-hero-text">{t(campaign.texts + '.text')}</p>
39
43
  </div>
@@ -20,7 +20,7 @@ export interface Campaign {
20
20
  /** i18n path of the campaign's texts: label (band, bar), period, title, text (hero), only (switch),
21
21
  * offer (bar), bannerTitle, cta (banner, with the hero's period and text). */
22
22
  texts: string;
23
- /** footnote mark raised after the hero's headline, e.g. '2'. */
23
+ /** footnote mark raised at the end of the hero's headline, before its full stop, e.g. '2'. */
24
24
  titleNote?: string;
25
25
  /** icon in front of the label of the band and the bar — a name from the ui/Icon registry. */
26
26
  icon?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core-autobahn",
3
- "version": "1.0.229",
3
+ "version": "1.0.231",
4
4
  "description": "auto.de md3 (Autobahn) design system — UI primitives, cards, chrome, VDP modules, theme CSS and locales. Ships raw TypeScript source (like fe-ui-core before it); each consumer's bundler compiles it.",
5
5
  "main": "index.ts",
6
6
  "license": "UNLICENSED",