create-ailk 0.34.0 → 0.35.1

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.
Files changed (55) hide show
  1. package/component-catalog.json +25 -3
  2. package/component-catalog.md +9 -8
  3. package/dist/add-module.js +7 -2
  4. package/dist/derive-architecture.js +2 -0
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/module-architecture.js +9 -0
  8. package/dist/programmatic.js +5 -2
  9. package/dist/site-listing-path.d.ts +8 -0
  10. package/dist/site-listing-path.js +8 -0
  11. package/dist/surfaces.d.ts +20 -0
  12. package/dist/surfaces.js +26 -0
  13. package/dist/template-record.js +2 -0
  14. package/dist/update.js +11 -0
  15. package/package.json +3 -3
  16. package/templates/apps/api/CLAUDE.md +6 -6
  17. package/templates/apps/mcp/CLAUDE.md +16 -7
  18. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/item.test.tsx +43 -0
  19. package/templates/apps/web/app/[locale]/(authed)/account/__tests__/page.test.tsx +6 -5
  20. package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +6 -1
  21. package/templates/apps/web/app/[locale]/flows/[slug]/FlowStepperClient.tsx +43 -4
  22. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.deliverable.test.tsx +23 -9
  23. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.invite.test.tsx +15 -0
  24. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.permalink.test.tsx +74 -0
  25. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.test.tsx +34 -1
  26. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/magnet-page.test.tsx +257 -4
  27. package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/save.actions.test.ts +72 -92
  28. package/templates/apps/web/app/[locale]/flows/[slug]/email-moment.ts +2 -2
  29. package/templates/apps/web/app/[locale]/flows/[slug]/magnet-page.tsx +164 -65
  30. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/LevelChart.tsx +100 -0
  31. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsCard.tsx +99 -0
  32. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsClient.tsx +415 -253
  33. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsEmailStep.tsx +113 -32
  34. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.no-commerce.test.tsx +16 -17
  35. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.report.test.tsx +284 -0
  36. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/by-result.test.tsx +52 -19
  37. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/cards.test.tsx +402 -0
  38. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/page.test.tsx +100 -12
  39. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/score.test.tsx +153 -101
  40. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/meeting-seam.ts +36 -0
  41. package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/page.tsx +121 -33
  42. package/templates/apps/web/app/[locale]/flows/[slug]/save.actions.ts +27 -17
  43. package/templates/apps/web/app/[locale]/flows/[slug]/served-flow.ts +91 -0
  44. package/templates/apps/web/app/[locale]/layout.tsx +18 -1
  45. package/templates/apps/web/app/api/auth/hub/authorize/__tests__/route.test.ts +24 -0
  46. package/templates/apps/web/app/api/auth/hub/authorize/route.ts +5 -1
  47. package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +122 -0
  48. package/templates/apps/web/app/llms.txt/route.ts +14 -2
  49. package/templates/apps/web/app/sitemap.xml/__tests__/site-listing.test.ts +98 -0
  50. package/templates/apps/web/app/sitemap.xml/route.ts +13 -2
  51. package/templates/apps/web/lib/account-config.ts +24 -9
  52. package/templates/apps/web/lib/hub-children.tsx +15 -11
  53. package/templates/apps/web/lib/site-listing.ts +7 -0
  54. package/templates/apps/web/messages/en.json +13 -1
  55. package/versions.json +47 -47
@@ -0,0 +1,100 @@
1
+ // oss: false
2
+ /**
3
+ * LevelChart — the results page's Level chart (#11013 decision 10, spec E
4
+ * D-E).
5
+ *
6
+ * Five equal columns numbered 01–05, one per Level (equal fifths of all
7
+ * points, #11034), drawn as a bell — the shape only, never counted
8
+ * respondents (README § Later). The respondent's own Level is filled and a
9
+ * line marks their rounded share of all points. The Level and the share are
10
+ * the evaluator's (`evaluateWaitlistScoring`), computed from the unrounded
11
+ * value; only the marker's position and the accessible name's `{pct}` round.
12
+ *
13
+ * The marker is placed through one `--flow-level-marker` custom property — a
14
+ * per-render data value, the `style` carve-out `.claude/rules/frontend.md`
15
+ * admits — so no arbitrary-value class is needed. This page's alone: it is
16
+ * not a package component (D-E).
17
+ */
18
+ import { Text } from "@working-theory/ui";
19
+ import type { CSSProperties, ReactElement } from "react";
20
+
21
+ /** The bell the five columns draw, by Level (decision 10). */
22
+ const COLUMN_HEIGHTS = ["h-1/4", "h-1/2", "h-full", "h-1/2", "h-1/4"] as const;
23
+
24
+ export interface LevelChartProps {
25
+ /** The respondent's Level, 1–5. */
26
+ level: number;
27
+ /** Their share of all points, 0–100, unrounded. */
28
+ pct: number;
29
+ /** The chart's accessible name (`flow.levelChartLabel`). */
30
+ label: string;
31
+ className?: string;
32
+ }
33
+
34
+ export function LevelChart({ level, pct, label, className }: LevelChartProps): ReactElement {
35
+ const marker = Math.round(Math.min(100, Math.max(0, pct)));
36
+ // A numeric unit on a decorative marker; the chart's accessible name carries the message.
37
+ const markerLabel = `${marker}%`;
38
+ return (
39
+ <div
40
+ role="img"
41
+ aria-label={label}
42
+ data-testid="flow-level-chart"
43
+ className={["pt-7", className].filter(Boolean).join(" ")}
44
+ >
45
+ <div
46
+ className="relative grid h-28 grid-cols-5 items-end gap-1 border-b border-(--color-fg) md:h-32"
47
+ style={{ "--flow-level-marker": `${marker}%` } as CSSProperties}
48
+ >
49
+ {COLUMN_HEIGHTS.map((height, index) => {
50
+ const n = index + 1;
51
+ const filled = n === level;
52
+ return (
53
+ <div
54
+ key={n}
55
+ data-testid={`flow-level-chart-column-${n}`}
56
+ data-level={n}
57
+ data-filled={filled ? "true" : "false"}
58
+ className="relative flex h-full items-end"
59
+ >
60
+ <div
61
+ aria-hidden="true"
62
+ className={[
63
+ "w-full",
64
+ height,
65
+ // The ScoreBar track's token, so the columns flip with the palette.
66
+ filled ? "bg-(--color-accent)" : "bg-(--color-border-strong)",
67
+ ].join(" ")}
68
+ />
69
+ <span className="absolute inset-x-0 top-full mt-2 text-center">
70
+ <Text
71
+ as="span"
72
+ variant="caption"
73
+ tone={filled ? "default" : "muted"}
74
+ className={filled ? "font-semibold tabular-nums" : "tabular-nums"}
75
+ >
76
+ {String(n).padStart(2, "0")}
77
+ </Text>
78
+ </span>
79
+ </div>
80
+ );
81
+ })}
82
+ <span
83
+ aria-hidden="true"
84
+ data-testid="flow-level-chart-marker"
85
+ className="absolute -top-7 bottom-0 w-px bg-(--color-fg) start-(--flow-level-marker)"
86
+ >
87
+ <Text
88
+ as="span"
89
+ variant="caption"
90
+ className="absolute top-0 ms-1.5 whitespace-nowrap bg-(--color-bg) px-0.5 font-semibold tabular-nums"
91
+ >
92
+ {markerLabel}
93
+ </Text>
94
+ </span>
95
+ </div>
96
+ {/* The column labels sit below the baseline; reserve their line. */}
97
+ <div aria-hidden="true" className="h-6" />
98
+ </div>
99
+ );
100
+ }
@@ -0,0 +1,99 @@
1
+ // oss: false
2
+ /**
3
+ * ResultsCard — the results page's one card (#11013 decisions 14–16, spec E
4
+ * D-G, D-H).
5
+ *
6
+ * Two shapes, one component: a **Product** card (an offering — its name, its
7
+ * price, the Stripe description when set, "What's included" from its
8
+ * marketing features, Get Started to its `/pricing?plan=` landing) and a
9
+ * **Meeting** card (an appointment — its title, its description, a button to
10
+ * its `/meet/<slug>` page labelled with `/meet`'s own "Book {n} min"). The
11
+ * by-result row's card (#10827) and the Email-links-to offering's card are
12
+ * the same Product card; the Meeting card's data arrives through the
13
+ * scheduling seam (`meeting-seam.ts`), never from a scheduling import here.
14
+ *
15
+ * The card's button is the primary action when the card shows (decision 16);
16
+ * the consumer passes every string (customer-facing-i18n). Composed from the
17
+ * `Card` block and the `Heading`, `Text`, `Icon`, `Button` and `Link`
18
+ * primitives; no raw HTML the lint bans.
19
+ */
20
+ import { Button, Card, Heading, Icon, Link, Text } from "@working-theory/ui";
21
+ import { Check } from "lucide-react";
22
+ import type { ReactElement } from "react";
23
+
24
+ export interface ResultsCardProps {
25
+ /** "Recommended for you" (`flow.priceCard.eyebrow`). */
26
+ eyebrow: string;
27
+ /** The offering's name or the meeting's title. */
28
+ title: string;
29
+ /** The Product card's price, as `/pricing` words it; a draft has none. */
30
+ price?: string;
31
+ description?: string;
32
+ /** The Product card's "What's included" entries (Stripe's marketing features). */
33
+ features?: string[];
34
+ /** The heading over `features` (`flow.whatsIncluded`). */
35
+ featuresLabel?: string;
36
+ /** The one button: a link, labelled Get Started or "Book {n} min"; a draft has none. */
37
+ action?: { href: string; label: string };
38
+ className?: string;
39
+ "data-testid"?: string;
40
+ }
41
+
42
+ export function ResultsCard({
43
+ eyebrow,
44
+ title,
45
+ price,
46
+ description,
47
+ features = [],
48
+ featuresLabel,
49
+ action,
50
+ className,
51
+ "data-testid": testId = "flow-results-card",
52
+ }: ResultsCardProps): ReactElement {
53
+ return (
54
+ <Card variant="outline" {...(className !== undefined ? { className } : {})} data-testid={testId}>
55
+ <Text as="span" variant="caption" tone="muted" className="uppercase tracking-wide">
56
+ {eyebrow}
57
+ </Text>
58
+ <Heading level={2} className="mt-2 text-heading-4">
59
+ {title}
60
+ </Heading>
61
+ {price !== undefined ? (
62
+ <Text as="p" variant="body-sm" className="mt-1.5 font-medium" data-testid={`${testId}-price`}>
63
+ {price}
64
+ </Text>
65
+ ) : null}
66
+ {description !== undefined ? (
67
+ <Text as="p" variant="body-sm" tone="muted" className="mt-1.5" data-testid={`${testId}-description`}>
68
+ {description}
69
+ </Text>
70
+ ) : null}
71
+ {features.length > 0 ? (
72
+ <div className="mt-4 border-t border-(--color-border) pt-3" data-testid={`${testId}-features`}>
73
+ <Text as="span" variant="body-sm" className="font-semibold">
74
+ {featuresLabel}
75
+ </Text>
76
+ <ul className="mt-2 flex flex-col gap-2">
77
+ {features.map((feature) => (
78
+ <li key={feature} className="flex items-start gap-2 text-body-sm text-fg">
79
+ <Icon icon={Check} size="sm" decorative className="mt-0.5 shrink-0" />
80
+ <span>{feature}</span>
81
+ </li>
82
+ ))}
83
+ </ul>
84
+ </div>
85
+ ) : null}
86
+ {action !== undefined ? (
87
+ // Decision 16 — below `md:` the page's dock carries this button, so the
88
+ // card shows its own from `md:` only (the 390 boards draw the card bare).
89
+ <div className="mt-5 hidden md:block">
90
+ <Button asChild size="big" className="min-h-11 w-full">
91
+ <Link href={action.href} variant="bare" data-testid={`${testId}-action`}>
92
+ {action.label}
93
+ </Link>
94
+ </Button>
95
+ </div>
96
+ ) : null}
97
+ </Card>
98
+ );
99
+ }