create-ailk 0.37.1 → 0.38.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 +129 -0
- package/component-catalog.json +44 -6
- package/component-catalog.md +6 -5
- package/dist/add-module.js +16 -1
- package/dist/add-route.d.ts +2 -2
- package/dist/add-route.js +18 -11
- package/dist/cli.js +52 -0
- package/dist/declined-routes.d.ts +13 -0
- package/dist/declined-routes.js +74 -0
- package/dist/derive-architecture.d.ts +0 -6
- package/dist/derive-architecture.js +9 -15
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -0
- package/dist/language-import.d.ts +93 -0
- package/dist/language-import.js +270 -43
- package/dist/lib/import-mdx.js +1 -1
- package/dist/lib/scaffold-render-sweep.d.ts +6 -3
- package/dist/lib/scaffold-render-sweep.js +8 -4
- package/dist/migrate-content.d.ts +6 -2
- package/dist/migrate-content.js +62 -5
- package/dist/module-architecture.js +139 -103
- package/dist/paid-sections.d.ts +13 -0
- package/dist/paid-sections.js +35 -5
- package/dist/programmatic.js +6 -16
- package/dist/remove-module.js +67 -0
- package/dist/routes.d.ts +103 -0
- package/dist/routes.js +708 -0
- package/dist/site-manifest.js +1 -1
- package/dist/site-roster.d.ts +2 -1
- package/dist/site-roster.js +30 -8
- package/dist/spoke-checkout.d.ts +28 -27
- package/dist/spoke-checkout.js +71 -102
- package/dist/surfaces.d.ts +18 -0
- package/dist/surfaces.js +47 -282
- package/dist/sync-routes.d.ts +14 -1
- package/dist/sync-routes.js +86 -5
- package/dist/topology.d.ts +15 -1
- package/dist/topology.js +20 -4
- package/dist/update.d.ts +17 -2
- package/dist/update.js +480 -77
- package/package.json +3 -3
- package/templates/README.md +1 -1
- package/templates/apps/mcp/CLAUDE.md +5 -3
- package/templates/apps/web/CLAUDE.md +62 -20
- package/templates/apps/web/account.config.tsx +101 -0
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/[slug]/page.tsx +3 -161
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/page.tsx +3 -139
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/page.tsx +3 -406
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/versions/[version]/file/route.ts +2 -190
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/page.tsx +3 -182
- package/templates/apps/web/app/[locale]/(authed)/account/billing/page.tsx +8 -420
- package/templates/apps/web/app/[locale]/(authed)/account/connect/page.tsx +1 -1
- package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +8 -214
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +8 -115
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/route.ts +2 -80
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/page.tsx +8 -121
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/page.tsx +3 -154
- package/templates/apps/web/app/[locale]/(authed)/account/layout.tsx +7 -149
- package/templates/apps/web/app/[locale]/(authed)/account/notifications/page.tsx +3 -143
- package/templates/apps/web/app/[locale]/(authed)/account/onboarding/page.tsx +3 -126
- package/templates/apps/web/app/[locale]/(authed)/account/page.tsx +8 -302
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/export/route.ts +2 -102
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/page.tsx +3 -240
- package/templates/apps/web/app/[locale]/(authed)/account/security/page.tsx +3 -131
- package/templates/apps/web/app/[locale]/(authed)/account/settings/page.tsx +2 -24
- package/templates/apps/web/app/[locale]/(authed)/account/support/page.tsx +3 -60
- package/templates/apps/web/app/[locale]/layout.tsx +45 -28
- package/templates/apps/web/app/apple-icon.tsx +72 -0
- package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +22 -12
- package/templates/apps/web/app/og/__tests__/__snapshots__/card.test.tsx.snap +3 -0
- package/templates/apps/web/app/og/__tests__/card.test.tsx +129 -0
- package/templates/apps/web/app/og/__tests__/route.test.ts +3 -4
- package/templates/apps/web/app/og/route.tsx +155 -72
- package/templates/apps/web/app/sitemap.xml/__tests__/site-listing.test.ts +12 -0
- package/templates/apps/web/i18n/request.ts +44 -1
- package/templates/apps/web/jest.config.cjs +13 -1
- package/templates/apps/web/lib/__tests__/auth-phone.test.ts +11 -0
- package/templates/apps/web/lib/__tests__/fixtures/site-topology.ts +70 -0
- package/templates/apps/web/lib/__tests__/nav-label-keys.test.ts +14 -0
- package/templates/apps/web/lib/__tests__/profile-back-link.test.ts +148 -61
- package/templates/apps/web/lib/__tests__/served-pages.test.ts +77 -0
- package/templates/apps/web/lib/__tests__/server-api.test.ts +37 -5
- package/templates/apps/web/lib/__tests__/structured-data.test.tsx +26 -13
- package/templates/apps/web/lib/listings.tsx +2 -2
- package/templates/apps/web/lib/nav-label-keys.ts +16 -2
- package/templates/apps/web/lib/paid-section-contracts.ts +35 -6
- package/templates/apps/web/lib/paid-sections.generated.ts +8 -0
- package/templates/apps/web/lib/profile-back-link.ts +105 -32
- package/templates/apps/web/lib/served-pages.ts +95 -0
- package/templates/apps/web/lib/site-brand.tsx +3 -5
- package/templates/apps/web/messages/en.json +8 -684
- package/templates/apps/web/middleware.ts +3 -1
- package/templates/apps/web/next.config.mjs +27 -0
- package/templates/apps/web/package.json +1 -0
- package/templates/customizations.yaml +9 -0
- package/templates/package.json +3 -1
- package/templates/tools/lint-architecture.ts +164 -11
- package/versions.json +48 -47
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/account-frame-sign-out.test.tsx +0 -175
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/agreements-prompt.test.tsx +0 -301
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/billing.test.tsx +0 -515
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/general.test.tsx +0 -883
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/hub-mode.test.tsx +0 -758
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/item.test.tsx +0 -264
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout-sign-out.test.tsx +0 -167
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout.test.tsx +0 -730
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-menu.test.tsx +0 -355
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-popups.test.tsx +0 -97
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/notifications.test.tsx +0 -375
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/onboarding.test.tsx +0 -323
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/page.test.tsx +0 -1208
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/popups.test.tsx +0 -418
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/privacy.test.tsx +0 -462
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/rich-translator.ts +0 -63
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/security.test.tsx +0 -406
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/settings.test.tsx +0 -93
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/support.test.tsx +0 -208
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/thread.test.tsx +0 -340
- package/templates/apps/web/app/[locale]/(authed)/account/account-data.ts +0 -182
- package/templates/apps/web/app/[locale]/(authed)/account/account-frame.tsx +0 -353
- package/templates/apps/web/app/[locale]/(authed)/account/actions.ts +0 -57
- package/templates/apps/web/app/[locale]/(authed)/account/agreements-actions.ts +0 -58
- package/templates/apps/web/app/[locale]/(authed)/account/agreements-gate.ts +0 -61
- package/templates/apps/web/app/[locale]/(authed)/account/agreements-prompt.tsx +0 -184
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/__tests__/page.test.tsx +0 -426
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/appointments-data.ts +0 -76
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/pay-form.tsx +0 -65
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/review-form.tsx +0 -172
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/file-route.test.ts +0 -333
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/page.test.tsx +0 -936
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/pay.test.tsx +0 -193
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/review.test.tsx +0 -476
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-actions.ts +0 -184
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-data.ts +0 -197
- package/templates/apps/web/app/[locale]/(authed)/account/billing/__tests__/offerings.test.ts +0 -99
- package/templates/apps/web/app/[locale]/(authed)/account/billing/offerings.ts +0 -123
- package/templates/apps/web/app/[locale]/(authed)/account/billing-source.ts +0 -303
- package/templates/apps/web/app/[locale]/(authed)/account/components/request-quote.tsx +0 -274
- package/templates/apps/web/app/[locale]/(authed)/account/error-row.tsx +0 -35
- package/templates/apps/web/app/[locale]/(authed)/account/for-you-labels.ts +0 -36
- package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/phone-verification.test.tsx +0 -215
- package/templates/apps/web/app/[locale]/(authed)/account/general/__tests__/seam-imports.test.ts +0 -65
- package/templates/apps/web/app/[locale]/(authed)/account/general/account-name.ts +0 -36
- package/templates/apps/web/app/[locale]/(authed)/account/general/billing-anchor.tsx +0 -27
- package/templates/apps/web/app/[locale]/(authed)/account/general/contact-actions.ts +0 -149
- package/templates/apps/web/app/[locale]/(authed)/account/general/contact-details.tsx +0 -42
- package/templates/apps/web/app/[locale]/(authed)/account/general/deletion-request.tsx +0 -132
- package/templates/apps/web/app/[locale]/(authed)/account/general/phone-actions.ts +0 -122
- package/templates/apps/web/app/[locale]/(authed)/account/general/phone-verification.tsx +0 -215
- package/templates/apps/web/app/[locale]/(authed)/account/general/photo-actions.ts +0 -73
- package/templates/apps/web/app/[locale]/(authed)/account/general/profile-form.tsx +0 -107
- package/templates/apps/web/app/[locale]/(authed)/account/general/profile-source.ts +0 -87
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/message/[id]/file/__tests__/route.test.ts +0 -215
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/member-thread-composer.tsx +0 -43
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-data.ts +0 -88
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-write.ts +0 -31
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/invitation-id.test.ts +0 -35
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/__tests__/page.test.tsx +0 -266
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/actions.ts +0 -116
- package/templates/apps/web/app/[locale]/(authed)/account/invitations/[invitationId]/invitation-id.ts +0 -12
- package/templates/apps/web/app/[locale]/(authed)/account/new-actions.ts +0 -219
- package/templates/apps/web/app/[locale]/(authed)/account/new-menu.tsx +0 -365
- package/templates/apps/web/app/[locale]/(authed)/account/new-popups.tsx +0 -86
- package/templates/apps/web/app/[locale]/(authed)/account/onboarding/actions.ts +0 -120
- package/templates/apps/web/app/[locale]/(authed)/account/onboarding/onboarding-form.tsx +0 -322
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/__tests__/export-route.test.ts +0 -173
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/actions.ts +0 -103
- package/templates/apps/web/app/[locale]/(authed)/account/profile-actions.ts +0 -116
- package/templates/apps/web/app/[locale]/(authed)/account/retry-button.tsx +0 -27
- package/templates/apps/web/app/[locale]/(authed)/account/security/__tests__/hub-variant.test.tsx +0 -258
- package/templates/apps/web/app/[locale]/(authed)/account/security/security-panel.tsx +0 -130
- package/templates/apps/web/app/[locale]/(authed)/account/security/security-source.ts +0 -92
- package/templates/apps/web/app/[locale]/(authed)/account/settings-frame.tsx +0 -121
- package/templates/apps/web/app/[locale]/(authed)/account/sign-in-method.ts +0 -37
- package/templates/apps/web/app/[locale]/(authed)/account/support/support-form.tsx +0 -98
- package/templates/apps/web/app/[locale]/(authed)/account/support-actions.ts +0 -100
- package/templates/apps/web/app/[locale]/checkout/__tests__/pages.test.tsx +0 -139
- package/templates/apps/web/app/[locale]/checkout/__tests__/thank-you-account.test.tsx +0 -146
- package/templates/apps/web/app/[locale]/checkout/thank-you/page.tsx +0 -114
- package/templates/apps/web/app/[locale]/checkout/unavailable/page.tsx +0 -51
- package/templates/apps/web/app/[locale]/flows/[slug]/FlowStepperClient.tsx +0 -614
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.count.test.tsx +0 -43
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.deliverable.test.tsx +0 -214
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.ending.test.tsx +0 -197
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.invite.test.tsx +0 -286
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.permalink.test.tsx +0 -520
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.test.tsx +0 -376
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/FlowStepperClient.thanks-by-tier.test.tsx +0 -306
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/account-invite.actions.test.ts +0 -69
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/flow.actions.test.ts +0 -398
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/magnet-page.test.tsx +0 -704
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/save.actions.test.ts +0 -173
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/two-route-tool.test.tsx +0 -141
- package/templates/apps/web/app/[locale]/flows/[slug]/__tests__/verify.test.tsx +0 -249
- package/templates/apps/web/app/[locale]/flows/[slug]/account-invite.actions.ts +0 -35
- package/templates/apps/web/app/[locale]/flows/[slug]/email-moment.ts +0 -92
- package/templates/apps/web/app/[locale]/flows/[slug]/flow.actions.ts +0 -177
- package/templates/apps/web/app/[locale]/flows/[slug]/magnet-page.tsx +0 -472
- package/templates/apps/web/app/[locale]/flows/[slug]/page.tsx +0 -48
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/LevelChart.tsx +0 -100
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsCard.tsx +0 -99
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsClient.tsx +0 -820
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsEmailStep.tsx +0 -203
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.no-commerce.test.tsx +0 -194
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/ResultsClient.report.test.tsx +0 -284
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/by-result.test.tsx +0 -302
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/cards.test.tsx +0 -402
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/landing.test.tsx +0 -293
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/page.test.tsx +0 -485
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/__tests__/score.test.tsx +0 -231
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/checkout-seam.ts +0 -74
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/meeting-seam.ts +0 -36
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/page.tsx +0 -420
- package/templates/apps/web/app/[locale]/flows/[slug]/save.actions.ts +0 -85
- package/templates/apps/web/app/[locale]/flows/[slug]/served-flow.ts +0 -91
- package/templates/apps/web/app/[locale]/flows/[slug]/start/page.tsx +0 -32
- package/templates/apps/web/app/[locale]/flows/[slug]/verify/page.tsx +0 -153
- package/templates/apps/web/app/[locale]/flows/[slug]/verify.actions.ts +0 -151
- package/templates/apps/web/app/[locale]/meet/confirmed/BookingHandOff.tsx +0 -128
- package/templates/apps/web/app/[locale]/meet/confirmed/__tests__/BookingHandOff.test.tsx +0 -126
- package/templates/apps/web/app/[locale]/purchase/__tests__/cancel.test.tsx +0 -162
- package/templates/apps/web/app/[locale]/purchase/__tests__/module-scope.test.ts +0 -68
- package/templates/apps/web/app/[locale]/purchase/__tests__/success.test.tsx +0 -411
- package/templates/apps/web/app/[locale]/purchase/cancel/page.tsx +0 -115
- package/templates/apps/web/app/[locale]/purchase/success/page.tsx +0 -348
- package/templates/apps/web/lib/__tests__/account-config.test.ts +0 -704
- package/templates/apps/web/lib/account-config.ts +0 -678
- package/templates/apps/web/lib/checkout-config.ts +0 -16
- package/templates/apps/web/src/lib/__tests__/commerce-sections.test.ts +0 -57
- package/templates/apps/web/src/lib/commerce-sections.ts +0 -55
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// oss: false
|
|
2
|
-
/**
|
|
3
|
-
* /[locale]/flows/[slug] — the tool's LANDING route (#5053 D3/D5). Standard
|
|
4
|
-
* magnet page (#8840): rendered by `magnet-page.tsx`'s `renderMagnetLanding`
|
|
5
|
-
* with the pair's path `/flows/<slug>`.
|
|
6
|
-
*
|
|
7
|
-
* An interactive tool is TWO routes. This is the indexed half: the document
|
|
8
|
-
* that describes the tool, carries its structured data, and links to the
|
|
9
|
-
* flow. The flow itself is one segment deeper — `start/page.tsx` — and
|
|
10
|
-
* carries `noindex, follow` by mounting `flowRouteMetadata` (D4).
|
|
11
|
-
*
|
|
12
|
-
* Until #5053 this route WAS the flow, which is the exact defect the
|
|
13
|
-
* convention closes: a page whose entire indexable content is one visible
|
|
14
|
-
* question, with the `WebApplication` page type going unused. The defect is
|
|
15
|
-
* silent — the page renders and the flow works — so the split is what makes
|
|
16
|
-
* the tool visible to search and to answer engines at all.
|
|
17
|
-
*
|
|
18
|
-
* Structured data is the `Assessment` page type's own emit, unchanged:
|
|
19
|
-
* single-layer `@type: "WebApplication"` with no `WebPage` envelope (D2,
|
|
20
|
-
* resting on #5019, which names `assessment` and `calculator` among the
|
|
21
|
-
* builders that keep that shape byte for byte).
|
|
22
|
-
*
|
|
23
|
-
* Copy (#8840 D8): the flow record's `landing` block — its title, line, meta
|
|
24
|
-
* line and button — else the flow's own first-step title and the site's
|
|
25
|
-
* `flow` messages. No consuming site's wording ships here. A flow that is
|
|
26
|
-
* absent has no landing either; a hub that cannot be reached shows the site's
|
|
27
|
-
* contact email. Dynamic rendering — the config is DB-backed live data.
|
|
28
|
-
*/
|
|
29
|
-
import type { Metadata } from "next";
|
|
30
|
-
import type { ReactElement } from "react";
|
|
31
|
-
|
|
32
|
-
import { renderMagnetLanding, renderMagnetLandingMetadata } from "./magnet-page";
|
|
33
|
-
|
|
34
|
-
export const dynamic = "force-dynamic";
|
|
35
|
-
|
|
36
|
-
interface Props {
|
|
37
|
-
params: Promise<{ locale: string; slug: string }>;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
|
41
|
-
const { locale, slug } = await params;
|
|
42
|
-
return renderMagnetLandingMetadata({ slug, locale });
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export default async function Page({ params }: Props): Promise<ReactElement> {
|
|
46
|
-
const { locale, slug } = await params;
|
|
47
|
-
return renderMagnetLanding({ slug, path: `/flows/${slug}`, locale });
|
|
48
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
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
|
-
}
|