@atelic-action/ui 3.12.2 → 3.13.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
@@ -37,7 +37,7 @@ Every export, grouped by the entry it is imported from. The gallery column links
37
37
  | `GateLogin` | `@atelic-action/ui/components` | The access gate's sign in screen | [#gate-login](https://ui.atelic.me/#gate-login) |
38
38
  | `Watermark` | `@atelic-action/ui/components` | The signed in reader's confidential stamp, pill or tiled | [#watermark](https://ui.atelic.me/#watermark) |
39
39
  | `readCookie`, `Tone` | `@atelic-action/ui/components` | The cookie reader the watermark uses, and the tone type | none |
40
- | `Button`, `Chip`, `Eyebrow`, `Lead`, `SectionHeading` | `@atelic-action/ui/primitives` | The small pieces a page is set in | [#primitives](https://ui.atelic.me/#primitives) |
40
+ | `Button`, `PrimaryButton`, `SecondaryButton`, `Chip`, `Eyebrow`, `Lead`, `SectionHeading` | `@atelic-action/ui/primitives` | The small pieces a page is set in; the two named buttons are the only call to action shapes a page uses | [#primitives](https://ui.atelic.me/#primitives) |
41
41
  | `GradeChip`, `gradeLabel`, `WriteupGrade` | `@atelic-action/ui/artifact` | A section's grade, A to D, as a chip in its color, the letter alone, and the grade type | [#grade-chip](https://ui.atelic.me/#grade-chip) |
42
42
  | `SignOff`, `WriteupPerson` | `@atelic-action/ui/artifact` | The close a document ends on, and the person it names | [#sign-off](https://ui.atelic.me/#sign-off) |
43
43
  | `Shot`, `WriteupShot` | `@atelic-action/ui/artifact` | The owner's own screen, opening the full picture, over its caption; a portrait crop is marked `data-portrait` and held to 200px (1.8in in print) | [#shot](https://ui.atelic.me/#shot) |
@@ -234,6 +234,8 @@ import { Button, SectionHeading } from "@atelic-action/ui/primitives";
234
234
  </Button>;
235
235
  ```
236
236
 
237
+ `PrimaryButton` and `SecondaryButton` (3.13.0) are the two buttons a marketing page uses, by name: the primary is the large primary button with the arrow, the shape `CTASection` closes every page with, and the secondary is the large ghost beside it, always second. A page reaches for those and never picks a variant and a size by hand, so no two pages drift; the header's compact button is the header's own. `Button` stays underneath for the few other shapes (a form's submit, a dark surface).
238
+
237
239
  `Button` is an anchor when it has an `href` and a real button otherwise. It puts the base path from `BasePathProvider` on a root path `href` (0.19.0), so a site served under a prefix needs no wrapper; with no provider above it the `href` renders as given. Its arrow is hidden from the name a screen reader hears.
238
240
 
239
241
  `Bubble` (3.11.0) is the round tile set beside a heading or a numbered step, holding either a lucide icon the caller sizes (`icon`) or a short mono index (`num`, such as "01"); given both, the icon sits inside and the number rides a small badge on the lower right rim, the way an unread count sits on an app icon. It comes in three sizes (`sm`, `md`, `lg`: 36, 48, and 60 pixels across, `md` by default) and lifts its fill for a dark band with `onDark`, the way `Chip` does. It is decoration and wears `aria-hidden`, so the heading beside it carries the meaning, the step's number included.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atelic-action/ui",
3
- "version": "3.12.2",
3
+ "version": "3.13.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",
@@ -0,0 +1,21 @@
1
+ import type { ButtonProps } from "./Button";
2
+ import { Button } from "./Button";
3
+
4
+ /**
5
+ * The two buttons a marketing page uses, by name, so no page picks a variant
6
+ * and a size by hand and no two pages drift. A page's call to action is the
7
+ * PrimaryButton: the hero's, the one under the case studies, the closing
8
+ * section's, every one the same large primary shape with the arrow. A
9
+ * SecondaryButton is the ghost beside it at the same size, always second.
10
+ * The header's own compact button stays the header's. `Button` remains for
11
+ * the few places that need another shape (a form's submit, a dark surface).
12
+ */
13
+ export type CallToActionProps = Omit<ButtonProps, "variant" | "size" | "arrow">;
14
+
15
+ export function PrimaryButton(props: CallToActionProps) {
16
+ return <Button {...props} variant="primary" size="lg" arrow />;
17
+ }
18
+
19
+ export function SecondaryButton(props: CallToActionProps) {
20
+ return <Button {...props} variant="ghost" size="lg" />;
21
+ }
@@ -1,5 +1,6 @@
1
1
  export { Bubble, type BubbleProps } from "./Bubble";
2
2
  export { Button, type ButtonProps } from "./Button";
3
+ export { type CallToActionProps, PrimaryButton, SecondaryButton } from "./CallToAction";
3
4
  export { Chip, type ChipProps } from "./Chip";
4
5
  export { Eyebrow, type EyebrowProps } from "./Eyebrow";
5
6
  export { ImageFrame, type ImageFrameProps } from "./ImageFrame";
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
2
  import { Eyebrow, Lead } from "../primitives";
3
- import { Button } from "../primitives/Button";
3
+ import { PrimaryButton, SecondaryButton } from "../primitives/CallToAction";
4
4
  import type { SiteConfig } from "./siteConfig";
5
5
 
6
6
  export interface CTASectionProps {
@@ -45,13 +45,13 @@ export function CTASection({
45
45
  <h2>{title}</h2>
46
46
  {lead && <Lead className="cta-lead">{lead}</Lead>}
47
47
  <div className="cta-row center">
48
- <Button href={primaryAction.href} newTab={primaryAction.newTab} size="lg" arrow>
48
+ <PrimaryButton href={primaryAction.href} newTab={primaryAction.newTab}>
49
49
  {primaryAction.label}
50
- </Button>
50
+ </PrimaryButton>
51
51
  {secondary && (
52
- <Button href={secondary.href} newTab={secondary.newTab} variant="ghost" size="lg">
52
+ <SecondaryButton href={secondary.href} newTab={secondary.newTab}>
53
53
  {secondary.label}
54
- </Button>
54
+ </SecondaryButton>
55
55
  )}
56
56
  </div>
57
57
  </div>