@atelic-action/ui 3.14.1 → 3.16.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 +3 -3
- package/dist/gate/config.d.ts +5 -1
- package/dist/gate/config.js +12 -3
- package/dist/gate/request-link.js +1 -1
- package/package.json +1 -1
- package/src/artifact/SignOff.tsx +1 -1
- package/src/gate/config.ts +12 -3
- package/src/gate/request-link.ts +1 -1
- package/src/sections/ReviewCarousel.tsx +26 -0
- package/src/styles/sections.css +30 -0
package/README.md
CHANGED
|
@@ -94,7 +94,7 @@ Every export, grouped by the entry it is imported from. The gallery column links
|
|
|
94
94
|
| `ProcessSteps` | `@atelic-action/ui/sections` | A dark band of numbered steps beside a frame | [#process-steps](https://ui.atelic.me/#process-steps) |
|
|
95
95
|
| `ProfileCards` | `@atelic-action/ui/sections` | Equal weight cards of media beside a short bio | [#profile-cards](https://ui.atelic.me/#profile-cards) |
|
|
96
96
|
| `RevealSlider` | `@atelic-action/ui/sections` | Drag or arrow keys to compare two frames, each with its own toned shot brief before photography | [#reveal-slider](https://ui.atelic.me/#reveal-slider) |
|
|
97
|
-
| `ReviewCarousel` | `@atelic-action/ui/sections` | The aggregate beside one large review at a time, stepped by dots and arrows | [#review-carousel](https://ui.atelic.me/#review-carousel) |
|
|
97
|
+
| `ReviewCarousel` | `@atelic-action/ui/sections` | The aggregate beside one large review at a time, stepped by dots and arrows, each review linking to its source | [#review-carousel](https://ui.atelic.me/#review-carousel) |
|
|
98
98
|
| `ReviewWall` | `@atelic-action/ui/sections` | The reviews page: tag filter and sort when the data carries them, clamped quotes behind Read more | [#review-wall](https://ui.atelic.me/#review-wall) |
|
|
99
99
|
| `SocialStrip` | `@atelic-action/ui/sections` | A static grid of the business's social photos linking to the profile, never a live embed | [#social-strip](https://ui.atelic.me/#social-strip) |
|
|
100
100
|
| `SplitSection` | `@atelic-action/ui/sections` | The two column band: copy beside copy, or media beside copy | [#split-section](https://ui.atelic.me/#split-section) |
|
|
@@ -274,7 +274,7 @@ export const POST = createRequestLink({ noun: "preview" });
|
|
|
274
274
|
| Env | Read by | What it does |
|
|
275
275
|
|---|---|---|
|
|
276
276
|
| `GATE_SESSION_SECRET` | all three | The signing secret, and the switch: unset, the gate is off. Use 32 random bytes or more |
|
|
277
|
-
| `GATE_ALLOWLIST` | all three | Comma separated emails that may receive a link. Taking an
|
|
277
|
+
| `GATE_ALLOWLIST` | all three | Comma separated emails that may receive a link, or a whole domain as `@example.com`, which admits every address on it. Taking an entry off, then redeploying, refuses its outstanding links and ends their sessions |
|
|
278
278
|
| `RESEND_API_KEY` | request link | The sending only key the link goes out on |
|
|
279
279
|
| `GATE_BASE_URL` | request link | The host the link points at; a bare host is read as https, and plain http is refused unless it is local. Unset, production uses the project's own domain and a preview uses the deployment it was asked on |
|
|
280
280
|
| `GATE_FROM`, `GATE_SUBJECT`, `GATE_LINK_TTL_MIN` | request link | Sender, subject, and link lifetime in minutes (15, a day at most) |
|
|
@@ -497,7 +497,7 @@ export function SiteShell(props: Omit<SiteShellProps, "currentPath" | "basePath"
|
|
|
497
497
|
| `ComparisonTable` | A graded before and after that scrolls sideways on a phone rather than reflowing |
|
|
498
498
|
| `RevealSlider` | Drag or arrow keys to compare two frames, each with its own toned shot brief before photography |
|
|
499
499
|
| `DeviceShowcase` | A desktop browser frame with a phone overlapping it |
|
|
500
|
-
| `ReviewCarousel` | The aggregate beside one large review at a time, stepped by dots and arrows |
|
|
500
|
+
| `ReviewCarousel` | The aggregate beside one large review at a time, stepped by dots and arrows, each review linking to its source |
|
|
501
501
|
| `ReviewWall` | The reviews page: tag filter and sort when the data carries them, clamped quotes behind Read more |
|
|
502
502
|
| `PressQuotes` | Rows of press quotes and awards with source and year, newest first (`sortPress` beside it) |
|
|
503
503
|
| `ProfileCards` | Equal weight cards of media beside a short bio |
|
package/dist/gate/config.d.ts
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
* How the gate reads its settings from the environment. Shared by the two
|
|
3
3
|
* sign in functions and the middleware, so each reads a value the same way.
|
|
4
4
|
*/
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Whether an address is on the comma separated allowlist. An entry is an
|
|
7
|
+
* address, or a whole domain written as `@example.com`, which admits every
|
|
8
|
+
* address on it (the business's own people, whoever the page is forwarded to).
|
|
9
|
+
*/
|
|
6
10
|
export declare function isAllowed(email: string, allowlist: string | undefined): boolean;
|
|
7
11
|
/**
|
|
8
12
|
* A setting that has to be a positive, finite number, or its default. A
|
package/dist/gate/config.js
CHANGED
|
@@ -2,15 +2,24 @@
|
|
|
2
2
|
* How the gate reads its settings from the environment. Shared by the two
|
|
3
3
|
* sign in functions and the middleware, so each reads a value the same way.
|
|
4
4
|
*/
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Whether an address is on the comma separated allowlist. An entry is an
|
|
7
|
+
* address, or a whole domain written as `@example.com`, which admits every
|
|
8
|
+
* address on it (the business's own people, whoever the page is forwarded to).
|
|
9
|
+
*/
|
|
6
10
|
export function isAllowed(email, allowlist) {
|
|
7
11
|
const wanted = email.trim().toLowerCase();
|
|
8
|
-
|
|
12
|
+
// A domain entry only admits one plain address (one `@`, a local part, no
|
|
13
|
+
// whitespace or list and quoting characters), so a crafted string such as
|
|
14
|
+
// `a@evil.example,b@widget.example` can never ride a domain match into a send.
|
|
15
|
+
const plain = /^[^@\s,;<>()"\\]+@[^@\s,;<>()"\\]+$/.test(wanted);
|
|
16
|
+
if (!plain)
|
|
9
17
|
return false;
|
|
18
|
+
const domain = wanted.slice(wanted.indexOf("@"));
|
|
10
19
|
return (allowlist ?? "")
|
|
11
20
|
.split(",")
|
|
12
21
|
.map((entry) => entry.trim().toLowerCase())
|
|
13
|
-
.
|
|
22
|
+
.some((entry) => entry === wanted || (entry.length > 1 && entry === domain));
|
|
14
23
|
}
|
|
15
24
|
/**
|
|
16
25
|
* A setting that has to be a positive, finite number, or its default. A
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Env (set on the Vercel project):
|
|
10
10
|
* - GATE_SESSION_SECRET signing secret; also the gate's on and off switch
|
|
11
|
-
* - GATE_ALLOWLIST comma separated emails allowed to receive a link
|
|
11
|
+
* - GATE_ALLOWLIST comma separated emails allowed to receive a link, or a whole domain as @example.com
|
|
12
12
|
* - RESEND_API_KEY sending only Resend key
|
|
13
13
|
* - GATE_FROM sender display name (optional)
|
|
14
14
|
* - GATE_SUBJECT email subject (optional)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atelic-action/ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.0",
|
|
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",
|
package/src/artifact/SignOff.tsx
CHANGED
|
@@ -15,7 +15,7 @@ export interface WriteupPerson {
|
|
|
15
15
|
/**
|
|
16
16
|
* The sign off a printed artifact closes on: the script line, then the person
|
|
17
17
|
* lockup, the photo beside the name, the role, and the address
|
|
18
|
-
* (Brand/
|
|
18
|
+
* (Brand/VOICE.md, Pitch Surfaces 9). The documents in @atelic-action/artifact
|
|
19
19
|
* (the writeup, the read, the monthly page, the note) all wear it, so its
|
|
20
20
|
* styles live in the base sheet chain
|
|
21
21
|
* (styles/artifact.css); its container sets the type size and the color.
|
package/src/gate/config.ts
CHANGED
|
@@ -3,14 +3,23 @@
|
|
|
3
3
|
* sign in functions and the middleware, so each reads a value the same way.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Whether an address is on the comma separated allowlist. An entry is an
|
|
8
|
+
* address, or a whole domain written as `@example.com`, which admits every
|
|
9
|
+
* address on it (the business's own people, whoever the page is forwarded to).
|
|
10
|
+
*/
|
|
7
11
|
export function isAllowed(email: string, allowlist: string | undefined): boolean {
|
|
8
12
|
const wanted = email.trim().toLowerCase();
|
|
9
|
-
|
|
13
|
+
// A domain entry only admits one plain address (one `@`, a local part, no
|
|
14
|
+
// whitespace or list and quoting characters), so a crafted string such as
|
|
15
|
+
// `a@evil.example,b@widget.example` can never ride a domain match into a send.
|
|
16
|
+
const plain = /^[^@\s,;<>()"\\]+@[^@\s,;<>()"\\]+$/.test(wanted);
|
|
17
|
+
if (!plain) return false;
|
|
18
|
+
const domain = wanted.slice(wanted.indexOf("@"));
|
|
10
19
|
return (allowlist ?? "")
|
|
11
20
|
.split(",")
|
|
12
21
|
.map((entry) => entry.trim().toLowerCase())
|
|
13
|
-
.
|
|
22
|
+
.some((entry) => entry === wanted || (entry.length > 1 && entry === domain));
|
|
14
23
|
}
|
|
15
24
|
|
|
16
25
|
/**
|
package/src/gate/request-link.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Env (set on the Vercel project):
|
|
10
10
|
* - GATE_SESSION_SECRET signing secret; also the gate's on and off switch
|
|
11
|
-
* - GATE_ALLOWLIST comma separated emails allowed to receive a link
|
|
11
|
+
* - GATE_ALLOWLIST comma separated emails allowed to receive a link, or a whole domain as @example.com
|
|
12
12
|
* - RESEND_API_KEY sending only Resend key
|
|
13
13
|
* - GATE_FROM sender display name (optional)
|
|
14
14
|
* - GATE_SUBJECT email subject (optional)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ArrowUpRight, ChevronLeft, ChevronRight } from "lucide-react";
|
|
2
2
|
import { type KeyboardEvent, type ReactNode, useState } from "react";
|
|
3
|
+
import { newTabProps } from "../lib/newTabProps";
|
|
3
4
|
import { Eyebrow } from "../primitives";
|
|
4
5
|
import { StarRow } from "../primitives/StarRow";
|
|
5
6
|
import type { ReviewItem } from "./ReviewWall";
|
|
@@ -35,6 +36,12 @@ export interface ReviewCarouselProps {
|
|
|
35
36
|
stats?: ReviewStat[];
|
|
36
37
|
/** The reviews, shown one at a time. */
|
|
37
38
|
items: ReviewItem[];
|
|
39
|
+
/**
|
|
40
|
+
* The label of the link under a review to where it was written, for a
|
|
41
|
+
* review that carries a `sourceURL`, e.g. "View on Google". A review with
|
|
42
|
+
* no `sourceURL` gets no link. Defaults to "View review".
|
|
43
|
+
*/
|
|
44
|
+
sourceLabel?: string;
|
|
38
45
|
/** Accessible name for the carousel region. */
|
|
39
46
|
ariaLabel?: string;
|
|
40
47
|
id?: string;
|
|
@@ -82,6 +89,7 @@ export function ReviewCarousel({
|
|
|
82
89
|
lead,
|
|
83
90
|
stats,
|
|
84
91
|
items,
|
|
92
|
+
sourceLabel = "View review",
|
|
85
93
|
ariaLabel = "Customer reviews",
|
|
86
94
|
id,
|
|
87
95
|
className,
|
|
@@ -97,7 +105,10 @@ export function ReviewCarousel({
|
|
|
97
105
|
|
|
98
106
|
// Left/right step the carousel whenever focus sits on one of its
|
|
99
107
|
// controls, the keyboard convention for a paged region.
|
|
108
|
+
// A link inside a slide keeps its own arrow keys: stepping from it would
|
|
109
|
+
// hide the slide that holds focus.
|
|
100
110
|
function onKeyDown(event: KeyboardEvent<HTMLDivElement>) {
|
|
111
|
+
if ((event.target as HTMLElement).closest?.("a")) return;
|
|
101
112
|
if (event.key === "ArrowLeft") {
|
|
102
113
|
event.preventDefault();
|
|
103
114
|
go(index - 1);
|
|
@@ -178,6 +189,16 @@ export function ReviewCarousel({
|
|
|
178
189
|
<figcaption className="rvc-who">
|
|
179
190
|
<span className="rvc-name">{item.by}</span>
|
|
180
191
|
{item.detail && <span className="rvc-detail">{item.detail}</span>}
|
|
192
|
+
{item.sourceURL && (
|
|
193
|
+
<a
|
|
194
|
+
className="rvc-source"
|
|
195
|
+
href={item.sourceURL}
|
|
196
|
+
{...newTabProps(item.sourceURL, true)}
|
|
197
|
+
>
|
|
198
|
+
{sourceLabel}
|
|
199
|
+
<ArrowUpRight size={14} strokeWidth={2} aria-hidden="true" />
|
|
200
|
+
</a>
|
|
201
|
+
)}
|
|
181
202
|
</figcaption>
|
|
182
203
|
</figure>
|
|
183
204
|
))}
|
|
@@ -198,10 +219,14 @@ export function ReviewCarousel({
|
|
|
198
219
|
))}
|
|
199
220
|
</div>
|
|
200
221
|
<div className="rvc-arrows">
|
|
222
|
+
{/* With one review there is nowhere to step, so the arrows stay
|
|
223
|
+
in place, greyed and inert, rather than vanishing and shifting
|
|
224
|
+
the dots. */}
|
|
201
225
|
<button
|
|
202
226
|
type="button"
|
|
203
227
|
className="rvc-arrow"
|
|
204
228
|
aria-label="Previous review"
|
|
229
|
+
disabled={count <= 1}
|
|
205
230
|
onClick={() => go(index - 1)}
|
|
206
231
|
>
|
|
207
232
|
<ChevronLeft size={18} strokeWidth={2} aria-hidden="true" />
|
|
@@ -210,6 +235,7 @@ export function ReviewCarousel({
|
|
|
210
235
|
type="button"
|
|
211
236
|
className="rvc-arrow"
|
|
212
237
|
aria-label="Next review"
|
|
238
|
+
disabled={count <= 1}
|
|
213
239
|
onClick={() => go(index + 1)}
|
|
214
240
|
>
|
|
215
241
|
<ChevronRight size={18} strokeWidth={2} aria-hidden="true" />
|
package/src/styles/sections.css
CHANGED
|
@@ -2558,7 +2558,37 @@
|
|
|
2558
2558
|
background: var(--surface-alt);
|
|
2559
2559
|
border-color: var(--neutral-300);
|
|
2560
2560
|
}
|
|
2561
|
+
/* One review: the arrows stay, greyed, with nothing to do. */
|
|
2562
|
+
.atelic-ui .rvc-arrow:disabled,
|
|
2563
|
+
.atelic-ui .rvc-arrow:disabled:hover {
|
|
2564
|
+
opacity: 0.4;
|
|
2565
|
+
cursor: default;
|
|
2566
|
+
background: var(--card);
|
|
2567
|
+
border-color: var(--neutral-200);
|
|
2568
|
+
}
|
|
2569
|
+
/* The link under a review to where it was written: the caption link's
|
|
2570
|
+
quiet idiom, set small on its own line of the attribution. */
|
|
2571
|
+
.atelic-ui .rvc-source {
|
|
2572
|
+
display: inline-flex;
|
|
2573
|
+
align-self: flex-start;
|
|
2574
|
+
align-items: center;
|
|
2575
|
+
gap: 3px;
|
|
2576
|
+
margin-top: 6px;
|
|
2577
|
+
font-size: 0.85rem;
|
|
2578
|
+
color: var(--ink-soft);
|
|
2579
|
+
text-decoration: underline;
|
|
2580
|
+
text-decoration-color: var(--neutral-300);
|
|
2581
|
+
text-underline-offset: 3px;
|
|
2582
|
+
transition:
|
|
2583
|
+
color 0.2s ease,
|
|
2584
|
+
text-decoration-color 0.2s ease;
|
|
2585
|
+
}
|
|
2586
|
+
.atelic-ui .rvc-source:hover {
|
|
2587
|
+
color: var(--primary);
|
|
2588
|
+
text-decoration-color: currentColor;
|
|
2589
|
+
}
|
|
2561
2590
|
.atelic-ui .rvc-arrow:focus-visible,
|
|
2591
|
+
.atelic-ui .rvc-source:focus-visible,
|
|
2562
2592
|
.atelic-ui .rvc-dot:focus-visible {
|
|
2563
2593
|
outline: 2px solid var(--primary);
|
|
2564
2594
|
outline-offset: 3px;
|