@atelic-action/ui 3.12.0 → 3.12.2

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
@@ -14,7 +14,7 @@ Every export, grouped by the entry it is imported from. The gallery column links
14
14
  | `SiteMenu` | `@atelic-action/ui/chrome` | The phone's full screen menu, on a native modal dialog | [#site-menu](https://ui.atelic.me/#site-menu) |
15
15
  | `Footer` | `@atelic-action/ui/chrome` | The site's foot: brand column, nav, address, hours, copyright, credit band | [#footer](https://ui.atelic.me/#footer) |
16
16
  | `CreditBar` | `@atelic-action/ui/chrome` | The developer credit band | [#credit-bar](https://ui.atelic.me/#credit-bar) |
17
- | `StickyCTABar` | `@atelic-action/ui/chrome` | The phone's bottom bar: the call to action and a call shortcut | [#sticky-cta-bar](https://ui.atelic.me/#sticky-cta-bar) |
17
+ | `StickyCTABar` | `@atelic-action/ui/chrome` | The phone's bottom bar: the call to action and a call shortcut, there from the top on an interior page (`fromTop`) and sliding in after a scroll on a hero page | [#sticky-cta-bar](https://ui.atelic.me/#sticky-cta-bar) |
18
18
  | `BrandLockup` | `@atelic-action/ui/chrome` | The header's identity as one link, with the recipient's mark on a sent document | [#brand-lockup](https://ui.atelic.me/#brand-lockup) |
19
19
  | `SkipLink` | `@atelic-action/ui/chrome` | The keyboard user's jump past the chrome | [#skip-link](https://ui.atelic.me/#skip-link) |
20
20
  | `Brand`, `BrandLogo`, `CallToAction`, `HoursRow`, `MenuContact`, `NavLink`, `Phone`, `PostalAddress`, `SiteLink`, `SocialLink`, `PageStop` | `@atelic-action/ui/chrome` | The shapes the chrome renders from (types) | none |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atelic-action/ui",
3
- "version": "3.12.0",
3
+ "version": "3.12.2",
4
4
  "description": "Shared UI for the Atelic templates: site chrome, base styles, the component library, the access gate, and the app shell they install",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -104,15 +104,22 @@ export function SiteMenu({
104
104
  function ContactBlock({ contact: { phone, email, address } }: { contact: MenuContact }) {
105
105
  return (
106
106
  <div className="mm-contact">
107
+ {/* The number and the address are the two things a phone can act on, so
108
+ each is a real link: a tel link dials, a mailto opens mail. Protocol
109
+ links never open a new tab (rule 12). Plain text here read as friction. */}
107
110
  {phone && (
108
111
  <>
109
- CALL / TEXT&nbsp;&nbsp;{phone.display}
112
+ <a className="mm-contact-link" href={`tel:${phone.e164}`}>
113
+ CALL / TEXT&nbsp;&nbsp;{phone.display}
114
+ </a>
110
115
  <br />
111
116
  </>
112
117
  )}
113
118
  {email && (
114
119
  <>
115
- {email}
120
+ <a className="mm-contact-link" href={`mailto:${email}`}>
121
+ {email}
122
+ </a>
116
123
  <br />
117
124
  </>
118
125
  )}
@@ -116,7 +116,9 @@ export function SiteShell({
116
116
  <main id="main" className={heroNav ? undefined : "clears-nav"}>
117
117
  {children}
118
118
  </main>
119
- {stickyCTA && <StickyCTABar primaryCTA={cta} phone={site.phone} />}
119
+ {/* An interior page's first screen has no booking button of its own, so
120
+ the bar is there from the top; the hero home page keeps the slide in. */}
121
+ {stickyCTA && <StickyCTABar primaryCTA={cta} phone={site.phone} fromTop={!heroNav} />}
120
122
  {footer ? (
121
123
  <Footer
122
124
  brand={brand}
@@ -10,25 +10,38 @@ export interface StickyCTABarProps {
10
10
  phone?: Phone;
11
11
  /** Scroll depth in pixels before the bar slides in. Defaults to 520. */
12
12
  threshold?: number;
13
+ /**
14
+ * Show the bar from the first paint, with no scroll. For a page whose
15
+ * first screen carries no booking button of its own (every page but the
16
+ * hero home page), so a lead action is one tap away before anyone scrolls.
17
+ * The home page keeps the slide in, since its hero already holds the button
18
+ * and a bar from the top would put two of them on one screen.
19
+ */
20
+ fromTop?: boolean;
13
21
  /** The call shortcut's accessible name. Defaults to "Call us". */
14
22
  callLabel?: string;
15
23
  }
16
24
 
17
- /** The phone only bottom bar: the primary CTA and a call shortcut, sliding in once scrolled. */
25
+ /** The phone only bottom bar: the primary CTA and a call shortcut, sliding in once scrolled, or there from the top. */
18
26
  export function StickyCTABar({
19
27
  primaryCTA,
20
28
  phone,
21
29
  threshold = 520,
30
+ fromTop = false,
22
31
  callLabel = "Call us",
23
32
  }: StickyCTABarProps) {
24
- const [show, setShow] = useState(false);
33
+ const [show, setShow] = useState(fromTop);
25
34
 
26
35
  useEffect(() => {
36
+ if (fromTop) {
37
+ setShow(true);
38
+ return;
39
+ }
27
40
  const onScroll = () => setShow(window.scrollY > threshold);
28
41
  window.addEventListener("scroll", onScroll, { passive: true });
29
42
  onScroll();
30
43
  return () => window.removeEventListener("scroll", onScroll);
31
- }, [threshold]);
44
+ }, [threshold, fromTop]);
32
45
 
33
46
  return (
34
47
  // Inert while offscreen, so its links take no keyboard focus before it slides in.
@@ -321,6 +321,12 @@
321
321
  letter-spacing: 0.04em;
322
322
  line-height: 1.9;
323
323
  }
324
+ /* The phone and email lines are links that read as the block's own text:
325
+ no colour change, no underline, the tap is the affordance. */
326
+ .atelic-ui .mobile-menu .mm-contact-link {
327
+ color: inherit;
328
+ text-decoration: none;
329
+ }
324
330
 
325
331
  /* ---- Sticky CTA bar (phones only) ---- */
326
332
  .atelic-ui .sticky-cta {