@atelic-action/ui 3.9.2 → 3.11.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
@@ -29,6 +29,7 @@ Every export, grouped by the entry it is imported from. The gallery column links
29
29
  | `StatRow` | `@atelic-action/ui/components` | A row of large figures with periods, deltas, and trends | [#stat-row](https://ui.atelic.me/#stat-row) |
30
30
  | `Callout` | `@atelic-action/ui/components` | One finding: an icon in its tone, the title, the explainer | [#callout](https://ui.atelic.me/#callout) |
31
31
  | `Disclosure` | `@atelic-action/ui/components` | A section that folds: controlled, an app's card; uncontrolled, a native details fold that prints open | [#disclosure](https://ui.atelic.me/#disclosure) |
32
+ | `Tabs`, `TabsItem` | `@atelic-action/ui/components` | Panels behind a row of tabs, every panel kept in the page: a hash opens the tab or the panel holding what it names, and it prints every panel under its label | [#tabs](https://ui.atelic.me/#tabs) |
32
33
  | `StackedBar` | `@atelic-action/ui/components` | One bar split into the parts of a whole, with a key | [#stacked-bar](https://ui.atelic.me/#stacked-bar) |
33
34
  | `ColumnChart` | `@atelic-action/ui/components` | A bar a period, the periods in labeled groups | [#column-chart](https://ui.atelic.me/#column-chart) |
34
35
  | `ThresholdScale` | `@atelic-action/ui/components` | Zones on a scale and a pin for each reading | [#threshold-scale](https://ui.atelic.me/#threshold-scale) |
@@ -98,7 +99,7 @@ Every export, grouped by the entry it is imported from. The gallery column links
98
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) |
99
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) |
100
101
  | `SiteConfig` and its member types, `formatClock`, `formatHoursRange`, `isClosed`, `isHoneypotFilled`, `trackEvent` | `@atelic-action/ui/sections` | The site contract the sections read, and the hours, honeypot, and lead event helpers | none |
101
- | `ImageFrame`, `ProseBlocks`, `QuoteCard`, `StarRow`, `TickList` | `@atelic-action/ui/primitives` | The marketing primitives: a framed image, prose blocks (headings at two levels, paragraphs, lists, and figures: small captioned tiles in rows, an image or a silent looping clip played only while on screen, each opening large in a dialog), a quote card, a row of filled stars, a tick list | [#marketing-primitives](https://ui.atelic.me/#marketing-primitives) |
102
+ | `Bubble`, `ImageFrame`, `ProseBlocks`, `QuoteCard`, `StarRow`, `TickList` | `@atelic-action/ui/primitives` | The marketing primitives: a round tile holding an icon or a step number, a framed image, prose blocks (headings at two levels, paragraphs, lists, and figures: small captioned tiles in rows, an image or a silent looping clip played only while on screen, each opening large in a dialog), a quote card, a row of filled stars, a tick list | [#marketing-primitives](https://ui.atelic.me/#marketing-primitives) |
102
103
  | `SiteShell` | `@atelic-action/ui/chrome` | A marketing page's whole chrome: skip link, header, main, footer, sticky bar, mounting the base path provider | none |
103
104
  | `BasePathProvider`, `useBasePath`, `useWithBase`, `joinBase`, `stripBase`, `hasBase`, `normalizeBasePath` | `@atelic-action/ui/routing` | The base path a site is served under, read by Button, Chip, and every section that builds a link | none |
104
105
  | `joinBase`, `stripBase`, `hasBase`, `normalizeBasePath` | `@atelic-action/ui/routing/base-path` | The same four pure helpers, built, for what Node runs (a Playwright spec, a script) | none |
@@ -235,6 +236,8 @@ import { Button, SectionHeading } from "@atelic-action/ui/primitives";
235
236
 
236
237
  `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.
237
238
 
239
+ `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.
240
+
238
241
  ## The Access Gate
239
242
 
240
243
  The gate puts a whole host behind an email sign in with no database: a reader on the allowlist asks for a link, the link starts a signed session cookie, and the middleware holds every page and file back from anyone without one. It is opt in and fails open, so a host with no `GATE_SESSION_SECRET` is fully public.
@@ -511,7 +514,7 @@ export function SiteShell(props: Omit<SiteShellProps, "currentPath" | "basePath"
511
514
  | `BlogPost` | One article: back link, title, byline and dateline, body |
512
515
  | `LegalPage` | A legal document from data, its last revised date first |
513
516
 
514
- The primitives that came with them, in `@atelic-action/ui/primitives`: `ImageFrame`, `ProseBlocks`, `QuoteCard`, `StarRow`, and `TickList`. `StarRow` stays beside `StarRating` on purpose: it draws only the filled stars a review shows, in whole steps and the brand color, named "4 out of 5 stars", where `StarRating` draws the whole scale with outlines in half steps and can take a rating.
517
+ The primitives that came with them, in `@atelic-action/ui/primitives`: `ImageFrame`, `ProseBlocks`, `QuoteCard`, `StarRow`, and `TickList`, with `Bubble` (see Primitives) shown beside them in the gallery. `StarRow` stays beside `StarRating` on purpose: it draws only the filled stars a review shows, in whole steps and the brand color, named "4 out of 5 stars", where `StarRating` draws the whole scale with outlines in half steps and can take a rating.
515
518
 
516
519
  The entry also exports the helpers the sections use, for a site's own code: `formatClock`, `formatHoursRange`, and `isClosed` for hours, `isHoneypotFilled`, and `trackEvent`.
517
520
 
@@ -710,6 +713,7 @@ The blocks a page composes, each styled in `styles/components.css` inside the `a
710
713
  | `StatRow` | A row of large figures, each over what it counts and its `period`. `variant="quiet"` is the glance row for a working page: a light figure in the text color over a small capitalized label, hairlines between; `unit` sets a figure's unit small beside it | `trend` draws an arrow before a figure that is itself a change. `deltas` list comparisons beneath: an arrow, how far, against what (`basis`), and the earlier figure (`was`), each in its own tone, since a spend falling and a cost falling read differently |
711
714
  | `Callout` | One finding: an icon in its tone beside the title, the explainer under it | `variant="box"` sets it apart on a tinted ground, for something missing or owed |
712
715
  | `Disclosure` | A section the reader opens and closes, in two forms chosen by whether `open` is passed | Controlled (`open` and `onToggle`), it is an app's card: the caller remembers what was folded, a closed body is not rendered, the label is the toggle, `meta` (a count, a flag) sits beside it outside its name, and `headingLevel` makes the label a real heading. Uncontrolled, it is a document's fold: a native `details` with a `summary` line that carries the point and `defaultOpen`, so it works before any script loads, find in page opens it, and it prints open. `Collapsible`, the fold's old name, was folded in at 0.18.0 |
716
+ | `Tabs` | Panels behind a row of tabs, on Radix for the arrow keys and the roles | Each tab's `id` names it in the URL: the tab is `<id>-tab`, its panel `<id>-panel`. A hash of `#<id>` opens the tab and scrolls to the tab row, and a hash naming any element inside a panel opens that panel and scrolls to it, on load, on a hash change, and on a click of a link to the hash already in the address bar, so a link in one panel lands on a finding in another. Every panel stays in the page: the inactive ones carry `hidden="until-found"`, so find in page reveals one and the tab follows. `defaultId` picks the first tab open; `selectedId` and `onSelect` hold it in the caller; either one naming no tab opens the first. Radix Tabs is a dependency of the package, so a site installs nothing for it. `ariaLabel` names the list and has no default. On paper the list is hidden and every panel prints under its label, as a heading at `headingLevel` (2 by default) |
713
717
  | `StackedBar` | One bar split into the parts of a whole, with a key | A part of zero is keyed and not drawn |
714
718
  | `ColumnChart` | A bar a period, the periods in groups that carry a label and a total | Months in quarters is the case it was cut for: a quarter reads against the one before it and the same one a year earlier |
715
719
  | `ThresholdScale` | Zones on a scale and a pin for each reading | For a number judged against lines, like a load time against good and poor |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atelic-action/ui",
3
- "version": "3.9.2",
3
+ "version": "3.11.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",
@@ -101,6 +101,7 @@
101
101
  "gallery:build": "vite build gallery"
102
102
  },
103
103
  "dependencies": {
104
+ "@radix-ui/react-tabs": "^1.2.1",
104
105
  "jose": "^6.2.12",
105
106
  "qrcode": "^1.5.4"
106
107
  },
@@ -0,0 +1,207 @@
1
+ import * as RadixTabs from "@radix-ui/react-tabs";
2
+ import { type ReactNode, useEffect, useRef, useState } from "react";
3
+
4
+ export interface TabsItem {
5
+ /**
6
+ * The tab's name in the URL: the tab is `<id>-tab` and its panel
7
+ * `<id>-panel`, and a hash of `#<id>` opens it.
8
+ */
9
+ id: string;
10
+ /** The tab's visible name, and its panel's heading on paper. */
11
+ label: ReactNode;
12
+ content: ReactNode;
13
+ }
14
+
15
+ export interface TabsProps {
16
+ tabs: TabsItem[];
17
+ /** The tab open on first render when uncontrolled; the first when left out. */
18
+ defaultId?: string;
19
+ /** Held by the caller: the open tab. Pass `onSelect` with it. */
20
+ selectedId?: string;
21
+ /** Called with a tab's id whenever the reader or a hash picks it. */
22
+ onSelect?: (id: string) => void;
23
+ /** The tab list's accessible name; site copy, so it has no default. */
24
+ ariaLabel: string;
25
+ /** The level of the heading each panel prints under; 2 when left out. */
26
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
27
+ className?: string;
28
+ }
29
+
30
+ const panelId = (id: string) => `${id}-panel`;
31
+ const tabId = (id: string) => `${id}-tab`;
32
+
33
+ // An attribute selector for an id; quoted, so any id is safe in it.
34
+ const byId = (id: string) => `[id="${id.replace(/["\\]/g, "\\$&")}"]`;
35
+
36
+ // An element inside this list by its id, never another list's that shares it.
37
+ function elementIn(root: HTMLElement | null, id: string) {
38
+ return root?.querySelector<HTMLElement>(byId(id)) ?? null;
39
+ }
40
+
41
+ // The list's own panel for a tab: a direct child of its root.
42
+ function panelIn(root: HTMLElement | null, id: string) {
43
+ return root?.querySelector<HTMLElement>(`:scope > ${byId(panelId(id))}`) ?? null;
44
+ }
45
+
46
+ // The tab whose panel holds the element, if it is one of this list's.
47
+ function tabHolding(root: HTMLElement | null, tabs: TabsItem[], el: Element) {
48
+ return tabs.find((tab) => panelIn(root, tab.id)?.contains(el))?.id;
49
+ }
50
+
51
+ /**
52
+ * Panels behind a row of tabs, on Radix for the keyboard and the roles.
53
+ *
54
+ * Every panel stays in the page. Before the script runs, CSS hides the
55
+ * inactive ones; once it runs, they carry `hidden="until-found"`, so a
56
+ * browser's find in page and a link to an element inside one both reveal
57
+ * it, and the tab follows. A hash names a tab by its id, or any element in
58
+ * a panel by that element's id: on load, on a hash change, and on a click of
59
+ * a link to the hash already in the address bar, the panel holding it opens
60
+ * and the page scrolls to the element. On paper there are no tabs: the list
61
+ * is hidden and every panel prints under its label as a heading.
62
+ */
63
+ export function Tabs({
64
+ tabs,
65
+ defaultId,
66
+ selectedId,
67
+ onSelect,
68
+ ariaLabel,
69
+ headingLevel = 2,
70
+ className,
71
+ }: TabsProps) {
72
+ // An id that names no tab falls back to the first, so a panel always shows.
73
+ const first = tabs[0]?.id ?? "";
74
+ const known = (id: string | undefined): id is string =>
75
+ id !== undefined && tabs.some((tab) => tab.id === id);
76
+ const [held, setHeld] = useState(known(defaultId) ? defaultId : first);
77
+ const wanted = selectedId ?? held;
78
+ const current = known(wanted) ? wanted : first;
79
+ const [live, setLive] = useState(false);
80
+ // The element to land on once its tab is the open one.
81
+ const [pendingScroll, setPendingScroll] = useState<{ tab: string; target: string } | null>(null);
82
+ const rootRef = useRef<HTMLDivElement>(null);
83
+ const Heading = `h${headingLevel}` as const;
84
+
85
+ const select = (id: string) => {
86
+ if (selectedId === undefined) setHeld(id);
87
+ if (id !== current) onSelect?.(id);
88
+ };
89
+
90
+ // Opens what a hash names: a tab by its id, or the panel holding an element,
91
+ // and lands on the tab row or the element. A new hash drops any landing
92
+ // still waiting on a tab the caller never opened.
93
+ const route = (hash: string) => {
94
+ setPendingScroll(null);
95
+ let name: string;
96
+ try {
97
+ name = decodeURIComponent(hash.replace(/^#/, ""));
98
+ } catch {
99
+ return;
100
+ }
101
+ if (!name) return;
102
+ const named = tabs.find((tab) => [tab.id, tabId(tab.id), panelId(tab.id)].includes(name));
103
+ if (named) {
104
+ select(named.id);
105
+ setPendingScroll({ tab: named.id, target: tabId(named.id) });
106
+ return;
107
+ }
108
+ const el = elementIn(rootRef.current, name);
109
+ const holder = el && tabHolding(rootRef.current, tabs, el);
110
+ if (!holder) return;
111
+ select(holder);
112
+ setPendingScroll({ tab: holder, target: name });
113
+ };
114
+
115
+ // The listeners below are bound once, so they read the latest route here.
116
+ const routeRef = useRef(route);
117
+ routeRef.current = route;
118
+ const tabsRef = useRef(tabs);
119
+ tabsRef.current = tabs;
120
+ const selectRef = useRef(select);
121
+ selectRef.current = select;
122
+
123
+ useEffect(() => {
124
+ setLive(true);
125
+ routeRef.current(window.location.hash);
126
+ const onHashChange = () => routeRef.current(window.location.hash);
127
+ // A link to the hash already in the address bar fires no hashchange.
128
+ const onClick = (event: MouseEvent) => {
129
+ const link = (event.target as Element | null)?.closest?.("a[href^='#']");
130
+ if (link instanceof HTMLAnchorElement && link.hash === window.location.hash)
131
+ routeRef.current(link.hash);
132
+ };
133
+ // Find in page, or a fragment, revealed an inactive panel.
134
+ const onBeforeMatch = (event: Event) => {
135
+ const holder =
136
+ event.target instanceof Element &&
137
+ tabHolding(rootRef.current, tabsRef.current, event.target);
138
+ if (holder) selectRef.current(holder);
139
+ };
140
+ const root = rootRef.current;
141
+ window.addEventListener("hashchange", onHashChange);
142
+ document.addEventListener("click", onClick);
143
+ root?.addEventListener("beforematch", onBeforeMatch);
144
+ return () => {
145
+ window.removeEventListener("hashchange", onHashChange);
146
+ document.removeEventListener("click", onClick);
147
+ root?.removeEventListener("beforematch", onBeforeMatch);
148
+ };
149
+ }, []);
150
+
151
+ // Inactive panels are hidden until found; React holds `hidden` as a
152
+ // boolean, so the browser's own value is set here.
153
+ useEffect(() => {
154
+ for (const tab of tabs) {
155
+ const panel = panelIn(rootRef.current, tab.id);
156
+ if (!panel) continue;
157
+ if (tab.id === current) panel.removeAttribute("hidden");
158
+ else panel.setAttribute("hidden", "until-found");
159
+ }
160
+ }, [current, tabs]);
161
+
162
+ // Once the tab the hash named is open, scroll to its row or its element.
163
+ useEffect(() => {
164
+ if (!pendingScroll || pendingScroll.tab !== current) return;
165
+ elementIn(rootRef.current, pendingScroll.target)?.scrollIntoView?.();
166
+ setPendingScroll(null);
167
+ }, [current, pendingScroll]);
168
+
169
+ return (
170
+ <RadixTabs.Root
171
+ ref={rootRef}
172
+ className={["tabs", live && "is-live", className].filter(Boolean).join(" ")}
173
+ value={current}
174
+ onValueChange={select}
175
+ >
176
+ <RadixTabs.List className="tabs-list" aria-label={ariaLabel}>
177
+ {tabs.map((tab) => (
178
+ <RadixTabs.Trigger
179
+ key={tab.id}
180
+ value={tab.id}
181
+ className="tabs-tab"
182
+ id={tabId(tab.id)}
183
+ aria-controls={panelId(tab.id)}
184
+ >
185
+ {tab.label}
186
+ </RadixTabs.Trigger>
187
+ ))}
188
+ </RadixTabs.List>
189
+ {tabs.map((tab) => (
190
+ <RadixTabs.Content
191
+ key={tab.id}
192
+ value={tab.id}
193
+ className="tabs-panel"
194
+ id={panelId(tab.id)}
195
+ aria-labelledby={tabId(tab.id)}
196
+ forceMount
197
+ // A panel hidden until found still draws its own box, so only the
198
+ // open one takes a stop in the tab order.
199
+ tabIndex={tab.id === current ? 0 : -1}
200
+ >
201
+ <Heading className="tabs-print-heading">{tab.label}</Heading>
202
+ {tab.content}
203
+ </RadixTabs.Content>
204
+ ))}
205
+ </RadixTabs.Root>
206
+ );
207
+ }
@@ -44,6 +44,7 @@ export {
44
44
  StatRow,
45
45
  type StatRowProps,
46
46
  } from "./StatRow";
47
+ export { Tabs, type TabsItem, type TabsProps } from "./Tabs";
47
48
  export {
48
49
  type ThresholdReading,
49
50
  ThresholdScale,
@@ -0,0 +1,38 @@
1
+ import type { ReactNode } from "react";
2
+
3
+ export interface BubbleProps {
4
+ /** The icon inside: a lucide element the caller sizes. */
5
+ icon?: ReactNode;
6
+ /**
7
+ * A short mono index, such as "01": set in the middle when there is no
8
+ * icon, and on a small badge at the lower right rim when there is one.
9
+ */
10
+ num?: string;
11
+ /** 36, 48, or 60 pixels across. */
12
+ size?: "sm" | "md" | "lg";
13
+ /** Lifts the fill for a dark band, the way the chip's dark form does. */
14
+ onDark?: boolean;
15
+ className?: string;
16
+ }
17
+
18
+ /**
19
+ * A round tile holding an icon or a step number, set beside a heading or a
20
+ * numbered step. Given both, the icon sits inside and the number rides a
21
+ * badge on the rim, the way an unread count sits on an app icon. It is
22
+ * decoration, so it is hidden from assistive tech
23
+ * (`aria-hidden`) and the meaning stays in the heading beside it: a step's
24
+ * number belongs in that heading's text or the list's order, never only here.
25
+ */
26
+ export function Bubble({ icon, num, size = "md", onDark = false, className }: BubbleProps) {
27
+ const classes = ["bubble", `bubble-${size}`, onDark && "on-dark", className]
28
+ .filter(Boolean)
29
+ .join(" ");
30
+ const hasIcon = icon !== undefined && icon !== null && icon !== false;
31
+ const hasNum = num !== undefined && num !== "";
32
+ return (
33
+ <span className={classes} aria-hidden="true">
34
+ {hasIcon ? icon : hasNum && <span className="bubble-num">{num}</span>}
35
+ {hasIcon && hasNum && <span className="bubble-badge">{num}</span>}
36
+ </span>
37
+ );
38
+ }
@@ -1,3 +1,4 @@
1
+ export { Bubble, type BubbleProps } from "./Bubble";
1
2
  export { Button, type ButtonProps } from "./Button";
2
3
  export { Chip, type ChipProps } from "./Chip";
3
4
  export { Eyebrow, type EyebrowProps } from "./Eyebrow";
@@ -328,6 +328,89 @@
328
328
  }
329
329
  }
330
330
 
331
+ /* ---- Tabs: a row of tabs over the panels, the open one underlined in
332
+ the primary. Every panel stays in the page: before the script runs
333
+ the inactive ones are hidden here, and once it runs (.is-live) they
334
+ carry hidden="until-found", which the browser hides and which find in
335
+ page and a fragment can still reveal. ---- */
336
+ .atelic-ui .tabs {
337
+ min-width: 0;
338
+ }
339
+ /* No overflow here: it would clip the focus ring and the underline. A
340
+ row too long for the screen wraps instead. */
341
+ .atelic-ui .tabs-list {
342
+ display: flex;
343
+ flex-wrap: wrap;
344
+ gap: 4px 24px;
345
+ margin-bottom: 24px;
346
+ border-bottom: 1px solid var(--neutral-200);
347
+ }
348
+ .atelic-ui .tabs-tab {
349
+ flex: none;
350
+ margin-bottom: -1px;
351
+ padding: 10px 0;
352
+ border: 0;
353
+ border-bottom: 2px solid transparent;
354
+ background: transparent;
355
+ font: 500 16px / 1.2 var(--font-sans);
356
+ color: var(--ink-soft);
357
+ /* Stays on one line until a label is wider than the row, then wraps. */
358
+ max-width: 100%;
359
+ text-align: left;
360
+ cursor: pointer;
361
+ transition:
362
+ color 150ms ease,
363
+ border-color 150ms ease;
364
+ }
365
+ .atelic-ui .tabs-tab:hover {
366
+ color: var(--ink);
367
+ }
368
+ .atelic-ui .tabs-tab[data-state="active"] {
369
+ color: var(--ink);
370
+ border-bottom-color: var(--ui-primary, var(--primary));
371
+ }
372
+ .atelic-ui .tabs-tab:focus-visible {
373
+ outline: 2px solid var(--ink);
374
+ outline-offset: 2px;
375
+ border-radius: 4px;
376
+ }
377
+ .atelic-ui .tabs-panel {
378
+ min-width: 0;
379
+ }
380
+ .atelic-ui .tabs-panel:focus-visible {
381
+ outline: 2px solid var(--ink);
382
+ outline-offset: 4px;
383
+ border-radius: 4px;
384
+ }
385
+ .atelic-ui .tabs:not(.is-live) > .tabs-panel[data-state="inactive"] {
386
+ display: none;
387
+ }
388
+ .atelic-ui .tabs-print-heading {
389
+ display: none;
390
+ }
391
+ @media (prefers-reduced-motion: reduce) {
392
+ .atelic-ui .tabs-tab {
393
+ transition: none;
394
+ }
395
+ }
396
+ /* Paper has no tabs: every panel prints, each under its label. */
397
+ @media print {
398
+ .atelic-ui .tabs-list {
399
+ display: none;
400
+ }
401
+ .atelic-ui .tabs-panel[data-state],
402
+ .atelic-ui .tabs:not(.is-live) > .tabs-panel[data-state] {
403
+ display: block;
404
+ content-visibility: visible;
405
+ }
406
+ .atelic-ui .tabs-panel + .tabs-panel {
407
+ margin-top: 24px;
408
+ }
409
+ .atelic-ui .tabs-print-heading {
410
+ display: block;
411
+ }
412
+ }
413
+
331
414
  /* ---- Callout: an icon in its tone beside the title, the explainer
332
415
  under it; boxed, it sits apart on a tinted ground ---- */
333
416
  .atelic-ui .callout {
@@ -1,5 +1,5 @@
1
- /* The primitives under src/primitives: the button, the chip, the eyebrow,
2
- the lead paragraph, and the section heading. Every value is a theme token.
1
+ /* The primitives under src/primitives: the button, the chip, the bubble, the
2
+ eyebrow, the lead paragraph, and the section heading. Every value is a theme token.
3
3
  They sit in the package's layer like every sheet here, so any rule a site
4
4
  writes outside a layer still wins over them whatever its specificity. */
5
5
  @layer atelic-ui {
@@ -101,6 +101,99 @@
101
101
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
102
102
  }
103
103
 
104
+ /* Bubble: a round tile holding an icon or a step number, set beside a
105
+ heading. The icon takes the primary through currentColor; the number is
106
+ set in the mono face and steps with the tile's size. Given both, the
107
+ number rides a badge on the lower right rim. The dark form mirrors the
108
+ chip's: a translucent white fill and an inset ring. */
109
+ .atelic-ui .bubble {
110
+ position: relative;
111
+ display: inline-flex;
112
+ align-items: center;
113
+ justify-content: center;
114
+ flex: none;
115
+ width: 48px;
116
+ height: 48px;
117
+ border-radius: 50%;
118
+ background: var(--card);
119
+ border: 1px solid var(--hairline);
120
+ color: var(--primary);
121
+ box-shadow: var(--shadow-sm);
122
+ }
123
+ .atelic-ui .bubble svg {
124
+ flex: none;
125
+ }
126
+ .atelic-ui .bubble-num {
127
+ font-family: var(--font-mono);
128
+ font-size: 0.8rem;
129
+ font-weight: 600;
130
+ letter-spacing: 0.1em;
131
+ /* The tracking trails the last glyph; the same lead on the left keeps
132
+ the number optically centered in the circle. */
133
+ padding-left: 0.1em;
134
+ line-height: 1;
135
+ color: var(--primary);
136
+ }
137
+ /* The badge: a small filled pill on the lower right rim, ringed in the
138
+ card color so it sits clean over the circle's edge. */
139
+ .atelic-ui .bubble-badge {
140
+ position: absolute;
141
+ right: -4px;
142
+ bottom: -4px;
143
+ display: inline-flex;
144
+ align-items: center;
145
+ justify-content: center;
146
+ min-width: 1.9em;
147
+ height: 1.9em;
148
+ padding: 0 0.4em;
149
+ border-radius: var(--radius-pill);
150
+ background: var(--primary);
151
+ color: #fff;
152
+ box-shadow: 0 0 0 2px var(--card);
153
+ font-family: var(--font-mono);
154
+ font-size: 0.62rem;
155
+ font-weight: 700;
156
+ letter-spacing: 0.04em;
157
+ line-height: 1;
158
+ }
159
+ .atelic-ui .bubble-sm {
160
+ width: 36px;
161
+ height: 36px;
162
+ }
163
+ .atelic-ui .bubble-sm .bubble-num {
164
+ font-size: 0.66rem;
165
+ }
166
+ .atelic-ui .bubble-sm .bubble-badge {
167
+ right: -5px;
168
+ bottom: -5px;
169
+ font-size: 0.52rem;
170
+ }
171
+ .atelic-ui .bubble-lg {
172
+ width: 60px;
173
+ height: 60px;
174
+ }
175
+ .atelic-ui .bubble-lg .bubble-num {
176
+ font-size: 0.95rem;
177
+ }
178
+ .atelic-ui .bubble-lg .bubble-badge {
179
+ right: -3px;
180
+ bottom: -3px;
181
+ font-size: 0.72rem;
182
+ }
183
+ .atelic-ui .bubble.on-dark {
184
+ background: rgba(255, 255, 255, 0.08);
185
+ border-color: transparent;
186
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
187
+ color: var(--primary-bright);
188
+ }
189
+ .atelic-ui .bubble.on-dark .bubble-num {
190
+ color: var(--primary-bright);
191
+ }
192
+ /* On a dark band the badge's ring takes the band's color, not the card's. */
193
+ .atelic-ui .bubble.on-dark .bubble-badge {
194
+ box-shadow: 0 0 0 2px var(--surface-dark);
195
+ }
196
+
104
197
  /* Eyebrow: mono uppercase kicker trailed by a bar that fades off to the
105
198
  right — the wordmark's signature, in the brand's primary. This fade is
106
199
  the only rendering; the old leading-dash mode is retired. */