@rtkelly-labs/design-system 0.19.0 → 0.20.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/CHANGELOG.md +31 -0
- package/dist/components/BracketText.js +3 -2
- package/dist/components/BracketText.js.map +1 -1
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Card.js +2 -1
- package/dist/components/Card.js.map +1 -1
- package/dist/components/DataTable.js.map +1 -1
- package/dist/components/Divider.js +21 -14
- package/dist/components/Divider.js.map +1 -1
- package/dist/components/InlineAction.js.map +1 -1
- package/dist/components/PageTitle.js +5 -1
- package/dist/components/PageTitle.js.map +1 -1
- package/dist/components/ResourceState.js.map +1 -1
- package/dist/components/SocialIcon.js.map +1 -1
- package/dist/components/StatCard.js +2 -2
- package/dist/components/StatCard.js.map +1 -1
- package/dist/components/StatusPage.js.map +1 -1
- package/dist/components/docs/figures/ActivityGrid.js.map +1 -1
- package/dist/components/docs/figures/ChangeSummary.js +68 -25
- package/dist/components/docs/figures/ChangeSummary.js.map +1 -1
- package/dist/components/docs/figures/FigureFrame.js.map +1 -1
- package/dist/components/docs/figures/index.js.map +1 -1
- package/dist/components/experiments/ExperimentsView.js.map +1 -1
- package/dist/components/marketing/FeatureGrid.js.map +1 -1
- package/dist/components/marketing/Hero.js +2 -2
- package/dist/components/marketing/Hero.js.map +1 -1
- package/dist/components/marketing/PricingGrid.js.map +1 -1
- package/dist/components/review/ChangeBar.js +29 -0
- package/dist/components/review/ChangeBar.js.map +1 -0
- package/dist/components/review/ChangeCount.js +27 -0
- package/dist/components/review/ChangeCount.js.map +1 -0
- package/dist/components/review/ChangeIndex.js +50 -0
- package/dist/components/review/ChangeIndex.js.map +1 -0
- package/dist/components/review/DeltaValue.js +87 -0
- package/dist/components/review/DeltaValue.js.map +1 -0
- package/dist/components/review/DiffView.js +115 -0
- package/dist/components/review/DiffView.js.map +1 -0
- package/dist/components/review/KeyedDiff.js +43 -0
- package/dist/components/review/KeyedDiff.js.map +1 -0
- package/dist/components/review/ProvenanceStrip.js +17 -0
- package/dist/components/review/ProvenanceStrip.js.map +1 -0
- package/dist/components/review/PullRequestPage.js +223 -0
- package/dist/components/review/PullRequestPage.js.map +1 -0
- package/dist/components/review/ReviewReportPage.js +111 -0
- package/dist/components/review/ReviewReportPage.js.map +1 -0
- package/dist/components/review/StatusMark.js +32 -0
- package/dist/components/review/StatusMark.js.map +1 -0
- package/dist/components/review/VerdictBand.js +45 -0
- package/dist/components/review/VerdictBand.js.map +1 -0
- package/dist/components/review/diff.js +53 -0
- package/dist/components/review/diff.js.map +1 -0
- package/dist/components/review/index.js +16 -0
- package/dist/components/review/index.js.map +1 -0
- package/dist/components/review/samples.js +235 -0
- package/dist/components/review/samples.js.map +1 -0
- package/dist/components/review/vocabulary.js +51 -0
- package/dist/components/review/vocabulary.js.map +1 -0
- package/dist/components/saas/SaasLandingPage.js +10 -2
- package/dist/components/saas/SaasLandingPage.js.map +1 -1
- package/dist/index.d.ts +640 -24
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/experiments/ExperimentsView.tsx"],"sourcesContent":["'use client';\n\nimport type React from 'react';\nimport { Beaker, Boxes, Palette, Type, Sparkles, Projector, Terminal } from 'lucide-react';\nimport { PageTitle } from '../PageTitle';\nimport { Badge } from '../Badge';\nimport type { AccentToken } from '../../lib/theme';\n\nexport interface ExperimentItem {\n /** Stable identifier, handed back by `onSelectExperiment`. */\n id: string;\n /** Card heading, uppercased by the type scale. */\n name: string;\n /** One line under the heading saying what the experiment explores. */\n description: string;\n /** Leading glyph. A node rather than a component type, so it can carry its own size. */\n icon?: React.ReactNode;\n /**\n * Lifecycle state, shown as a badge and coloured by {@link STATUS_ACCENT} —\n * `success` for `active`, `info` for `experimental`, `quiet` for `archived`.\n */\n status: 'active' | 'archived' | 'experimental';\n /** How many primitives the experiment exercises, shown in the footer line. */\n componentCount: number;\n}\n\n/**\n * The catalogue `ExperimentsView` falls back to — ryankelly.dev's own.\n *\n * Exported so a consumer can spread it, slice it or use it as the shape of\n * their own list. Until #95 it was exported and *not* accepted as a prop, so\n * the name promised a fallback the component had no way to take.\n */\nexport const DEFAULT_EXPERIMENTS: ExperimentItem[] = [\n {\n id: 'component-library',\n name: 'Component Library',\n description: 'Every core primitive component rendered across the full theme ladder, side by side',\n icon: <Boxes size={36} color=\"var(--ds-accent-primary)\" />,\n status: 'active',\n componentCount: 8,\n },\n {\n id: 'design-sandbox',\n name: 'Design System Sandbox',\n description: 'Interactive component variations, theme toggles, and live presentation playground',\n icon: <Palette size={36} color=\"var(--ds-accent-tertiary)\" />,\n status: 'active',\n componentCount: 12,\n },\n {\n id: 'typography-proposals',\n name: 'Editorial Typography Proposals',\n description: 'Three-role font pairings (Space Grotesk + Inter + IBM Plex Mono + VT323)',\n icon: <Type size={36} color=\"var(--ds-accent-secondary)\" />,\n status: 'active',\n componentCount: 4,\n },\n {\n id: 'presentation-decks',\n name: 'Brutalist Slide Decks',\n description: 'Keyboard-navigated presentation deck engine with fullscreen support',\n icon: <Projector size={36} color=\"var(--ds-intent-success)\" />,\n status: 'active',\n componentCount: 6,\n },\n {\n id: 'graphics-generators',\n name: 'Graphics Generators',\n description: 'Seed-driven SVG background and hero graphics generators for talks',\n icon: <Sparkles size={36} color=\"var(--ds-accent-primary)\" />,\n status: 'active',\n componentCount: 5,\n },\n];\n\n/**\n * How a lifecycle state is coloured.\n *\n * A `Record` over the union rather than a ternary, which is the ladder rule\n * from AGENTS.md applied to a smaller union: a fourth status becomes a compile\n * error here instead of silently falling through to whichever branch the\n * ternary ended on. The expression this replaced —\n * `status === 'active' ? 'cyan' : 'yellow'` — rendered `archived` and\n * `experimental` identically, so two different states looked the same while\n * their labels differed.\n *\n * `active` and `experimental` take **intent** roles because they are states a\n * reader acts on: one is live, one is in progress. `archived` takes `quiet`,\n * an *emphasis* role, and that is the deliberate exception — \"archived\" is not\n * a signal, it is the absence of one, so the right treatment is to recede\n * rather than to communicate.\n */\nconst STATUS_ACCENT: Record<ExperimentItem['status'], AccentToken> = {\n active: 'success',\n experimental: 'info',\n archived: 'quiet',\n};\n\nexport interface ExperimentsViewProps {\n /**\n * The catalogue to render, in display order. Defaults to\n * {@link DEFAULT_EXPERIMENTS}, which is *this site's* list rather than a\n * neutral one — pass your own to use this anywhere else.\n */\n experiments?: readonly ExperimentItem[];\n /**\n * Called with the experiment's `id` when a card is chosen. Omit it and the\n * grid is a read-only display: the cards lose their pointer cursor and do\n * nothing when clicked.\n */\n onSelectExperiment?: (id: string) => void;\n}\n\n/**\n * The experiments index: a grid of cards, one per experiment, each with a\n * status badge and a component count.\n *\n * Pass `experiments` to supply the catalogue; it defaults to\n * {@link DEFAULT_EXPERIMENTS}, which is this site's own list and is exported so\n * a consumer can extend it rather than start from nothing.\n * `onSelectExperiment` turns the cards into navigation — without it the grid is\n * a read-only display.\n *\n * `status` is the only place the component uses colour to mean something, and\n * it reads from {@link STATUS_ACCENT} — intent roles for the two states a\n * reader acts on, `quiet` for `archived`. See that constant for why the third\n * one is the exception.\n */\nexport const ExperimentsView: React.FC<ExperimentsViewProps> = ({\n experiments = DEFAULT_EXPERIMENTS,\n onSelectExperiment,\n}) => {\n return (\n <div data-slot=\"experiments-view\"\n style={{\n maxWidth: '1000px',\n margin: '0 auto',\n padding: '2rem 1.5rem',\n color: 'var(--ds-text-primary)',\n }}\n >\n <div style={{ display: 'flex', alignItems: 'center', gap: '1rem', marginBottom: '1.5rem' }}>\n <Beaker size={40} color=\"var(--ds-accent-primary)\" />\n <PageTitle subtitle=\"Interactive prototypes, design systems, and creative explorations\" bracketed>\n EXPERIMENTS & LABS\n </PageTitle>\n </div>\n\n <div style={{ display: 'flex', flexDirection: 'column', gap: '1.5rem', marginTop: '2rem' }}>\n {experiments.map((exp) => (\n <div\n key={exp.id}\n onClick={() => onSelectExperiment && onSelectExperiment(exp.id)}\n className=\"bg-surface-raised text-content-primary border-2 border-edge-strong shadow-hard-md p-6 transition-[transform,box-shadow] duration-150 ease-out hover:-translate-x-0.5 hover:-translate-y-0.5 hover:shadow-[6px_6px_0_0_var(--ds-accent-primary)] motion-reduce:transition-none motion-reduce:hover:translate-x-0 motion-reduce:hover:translate-y-0\"\n style={{\n display: 'flex',\n gap: '1.5rem',\n alignItems: 'center',\n cursor: onSelectExperiment ? 'pointer' : 'default',\n }}\n >\n <div>{exp.icon}</div>\n <div style={{ flex: 1 }}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '1rem', marginBottom: '0.4rem' }}>\n <h3\n style={{\n fontFamily: 'var(--ds-font-display)',\n fontSize: '1.4rem',\n fontWeight: 800,\n textTransform: 'uppercase',\n margin: 0,\n color: 'var(--ds-text-primary)',\n }}\n >\n {exp.name}\n </h3>\n <Badge accent={STATUS_ACCENT[exp.status]}>{exp.status.toUpperCase()}</Badge>\n </div>\n <p\n style={{\n fontFamily: 'var(--ds-font-mono)',\n fontSize: '0.875rem',\n color: 'var(--ds-text-primary)',\n opacity: 0.8,\n margin: 0,\n }}\n >\n {exp.description}\n </p>\n <div style={{ marginTop: '0.75rem', fontSize: '0.8rem', fontFamily: 'var(--ds-font-mono)', color: 'var(--ds-accent-secondary)', display: 'flex', alignItems: 'center', gap: '0.4rem' }}>\n <Terminal size={14} />\n <span>{exp.componentCount} primitives contained</span>\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n"],"mappings":";;;AAGA,SAAS,QAAQ,OAAO,SAAS,MAAM,UAAU,WAAW,gBAAgB;AAC5E,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AAiCZ,cAwGJ,YAxGI;AALH,IAAM,sBAAwC;AAAA,EACnD;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,MAAM,oBAAC,SAAM,MAAM,IAAI,OAAM,4BAA2B;AAAA,IACxD,QAAQ;AAAA,IACR,gBAAgB;AAAA,EAClB;AAAA,EACA;AAA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AI;AAAA,QA2CX,CACD,GACH;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/experiments/ExperimentsView.tsx"],"sourcesContent":["'use client';\n\nimport type React from 'react';\nimport { Beaker, Boxes, Palette, Type, Sparkles, Projector, Terminal } from 'lucide-react';\nimport { PageTitle } from '../PageTitle';\nimport { Badge } from '../Badge';\nimport type { AccentToken } from '../../lib/theme';\n\nexport interface ExperimentItem {\n /** Stable identifier, handed back by `onSelectExperiment`. */\n id: string;\n /** Card heading, uppercased by the type scale. */\n name: string;\n /** One line under the heading saying what the experiment explores. */\n description: string;\n /** Leading glyph. A node rather than a component type, so it can carry its own size. */\n icon?: React.ReactNode;\n /**\n * Lifecycle state, shown as a badge and coloured by `STATUS_ACCENT` —\n * `success` for `active`, `info` for `experimental`, `quiet` for `archived`.\n */\n status: 'active' | 'archived' | 'experimental';\n /** How many primitives the experiment exercises, shown in the footer line. */\n componentCount: number;\n}\n\n/**\n * The catalogue `ExperimentsView` falls back to — ryankelly.dev's own.\n *\n * Exported so a consumer can spread it, slice it or use it as the shape of\n * their own list. Until #95 it was exported and *not* accepted as a prop, so\n * the name promised a fallback the component had no way to take.\n */\nexport const DEFAULT_EXPERIMENTS: ExperimentItem[] = [\n {\n id: 'component-library',\n name: 'Component Library',\n description: 'Every core primitive component rendered across the full theme ladder, side by side',\n icon: <Boxes size={36} color=\"var(--ds-accent-primary)\" />,\n status: 'active',\n componentCount: 8,\n },\n {\n id: 'design-sandbox',\n name: 'Design System Sandbox',\n description: 'Interactive component variations, theme toggles, and live presentation playground',\n icon: <Palette size={36} color=\"var(--ds-accent-tertiary)\" />,\n status: 'active',\n componentCount: 12,\n },\n {\n id: 'typography-proposals',\n name: 'Editorial Typography Proposals',\n description: 'Three-role font pairings (Space Grotesk + Inter + IBM Plex Mono + VT323)',\n icon: <Type size={36} color=\"var(--ds-accent-secondary)\" />,\n status: 'active',\n componentCount: 4,\n },\n {\n id: 'presentation-decks',\n name: 'Brutalist Slide Decks',\n description: 'Keyboard-navigated presentation deck engine with fullscreen support',\n icon: <Projector size={36} color=\"var(--ds-intent-success)\" />,\n status: 'active',\n componentCount: 6,\n },\n {\n id: 'graphics-generators',\n name: 'Graphics Generators',\n description: 'Seed-driven SVG background and hero graphics generators for talks',\n icon: <Sparkles size={36} color=\"var(--ds-accent-primary)\" />,\n status: 'active',\n componentCount: 5,\n },\n];\n\n/**\n * How a lifecycle state is coloured.\n *\n * A `Record` over the union rather than a ternary, which is the ladder rule\n * from AGENTS.md applied to a smaller union: a fourth status becomes a compile\n * error here instead of silently falling through to whichever branch the\n * ternary ended on. The expression this replaced —\n * `status === 'active' ? 'cyan' : 'yellow'` — rendered `archived` and\n * `experimental` identically, so two different states looked the same while\n * their labels differed.\n *\n * `active` and `experimental` take **intent** roles because they are states a\n * reader acts on: one is live, one is in progress. `archived` takes `quiet`,\n * an *emphasis* role, and that is the deliberate exception — \"archived\" is not\n * a signal, it is the absence of one, so the right treatment is to recede\n * rather than to communicate.\n */\nconst STATUS_ACCENT: Record<ExperimentItem['status'], AccentToken> = {\n active: 'success',\n experimental: 'info',\n archived: 'quiet',\n};\n\nexport interface ExperimentsViewProps {\n /**\n * The catalogue to render, in display order. Defaults to\n * {@link DEFAULT_EXPERIMENTS}, which is *this site's* list rather than a\n * neutral one — pass your own to use this anywhere else.\n */\n experiments?: readonly ExperimentItem[];\n /**\n * Called with the experiment's `id` when a card is chosen. Omit it and the\n * grid is a read-only display: the cards lose their pointer cursor and do\n * nothing when clicked.\n */\n onSelectExperiment?: (id: string) => void;\n}\n\n/**\n * The experiments index: a grid of cards, one per experiment, each with a\n * status badge and a component count.\n *\n * Pass `experiments` to supply the catalogue; it defaults to\n * {@link DEFAULT_EXPERIMENTS}, which is this site's own list and is exported so\n * a consumer can extend it rather than start from nothing.\n * `onSelectExperiment` turns the cards into navigation — without it the grid is\n * a read-only display.\n *\n * `status` is the only place the component uses colour to mean something, and\n * it reads from `STATUS_ACCENT` — intent roles for the two states a\n * reader acts on, `quiet` for `archived`. See that constant for why the third\n * one is the exception.\n */\nexport const ExperimentsView: React.FC<ExperimentsViewProps> = ({\n experiments = DEFAULT_EXPERIMENTS,\n onSelectExperiment,\n}) => {\n return (\n <div data-slot=\"experiments-view\"\n style={{\n maxWidth: '1000px',\n margin: '0 auto',\n padding: '2rem 1.5rem',\n color: 'var(--ds-text-primary)',\n }}\n >\n <div style={{ display: 'flex', alignItems: 'center', gap: '1rem', marginBottom: '1.5rem' }}>\n <Beaker size={40} color=\"var(--ds-accent-primary)\" />\n <PageTitle subtitle=\"Interactive prototypes, design systems, and creative explorations\" bracketed>\n EXPERIMENTS & LABS\n </PageTitle>\n </div>\n\n <div style={{ display: 'flex', flexDirection: 'column', gap: '1.5rem', marginTop: '2rem' }}>\n {experiments.map((exp) => (\n <div\n key={exp.id}\n onClick={() => onSelectExperiment && onSelectExperiment(exp.id)}\n className=\"bg-surface-raised text-content-primary border-2 border-edge-strong shadow-hard-md p-6 transition-[transform,box-shadow] duration-150 ease-out hover:-translate-x-0.5 hover:-translate-y-0.5 hover:shadow-[6px_6px_0_0_var(--ds-accent-primary)] motion-reduce:transition-none motion-reduce:hover:translate-x-0 motion-reduce:hover:translate-y-0\"\n style={{\n display: 'flex',\n gap: '1.5rem',\n alignItems: 'center',\n cursor: onSelectExperiment ? 'pointer' : 'default',\n }}\n >\n <div>{exp.icon}</div>\n <div style={{ flex: 1 }}>\n <div style={{ display: 'flex', alignItems: 'center', gap: '1rem', marginBottom: '0.4rem' }}>\n <h3\n style={{\n fontFamily: 'var(--ds-font-display)',\n fontSize: '1.4rem',\n fontWeight: 800,\n textTransform: 'uppercase',\n margin: 0,\n color: 'var(--ds-text-primary)',\n }}\n >\n {exp.name}\n </h3>\n <Badge accent={STATUS_ACCENT[exp.status]}>{exp.status.toUpperCase()}</Badge>\n </div>\n <p\n style={{\n fontFamily: 'var(--ds-font-mono)',\n fontSize: '0.875rem',\n color: 'var(--ds-text-primary)',\n opacity: 0.8,\n margin: 0,\n }}\n >\n {exp.description}\n </p>\n <div style={{ marginTop: '0.75rem', fontSize: '0.8rem', fontFamily: 'var(--ds-font-mono)', color: 'var(--ds-accent-secondary)', display: 'flex', alignItems: 'center', gap: '0.4rem' }}>\n <Terminal size={14} />\n <span>{exp.componentCount} primitives contained</span>\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n"],"mappings":";;;AAGA,SAAS,QAAQ,OAAO,SAAS,MAAM,UAAU,WAAW,gBAAgB;AAC5E,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AAiCZ,cAwGJ,YAxGI;AALH,IAAM,sBAAwC;AAAA,EACnD;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,MAAM,oBAAC,SAAM,MAAM,IAAI,OAAM,4BAA2B;AAAA,IACxD,QAAQ;AAAA,IACR,gBAAgB;AAAA,EAClB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,MAAM,oBAAC,WAAQ,MAAM,IAAI,OAAM,6BAA4B;AAAA,IAC3D,QAAQ;AAAA,IACR,gBAAgB;AAAA,EAClB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,MAAM,oBAAC,QAAK,MAAM,IAAI,OAAM,8BAA6B;AAAA,IACzD,QAAQ;AAAA,IACR,gBAAgB;AAAA,EAClB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,MAAM,oBAAC,aAAU,MAAM,IAAI,OAAM,4BAA2B;AAAA,IAC5D,QAAQ;AAAA,IACR,gBAAgB;AAAA,EAClB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,MAAM,oBAAC,YAAS,MAAM,IAAI,OAAM,4BAA2B;AAAA,IAC3D,QAAQ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C,cAAI;AAAA;AAAA,kBACP;AAAA,kBACA,oBAAC,SAAM,QAAQ,cAAc,IAAI,MAAM,GAAI,cAAI,OAAO,YAAY,GAAE;AAAA,mBACtE;AAAA,gBACA;AAAA,kBAAC;AAAA;AAAA,oBACC,OAAO;AAAA,sBACL,YAAY;AAAA,sBACZ,UAAU;AAAA,sBACV,OAAO;AAAA,sBACP,SAAS;AAAA,sBACT,QAAQ;AAAA,oBACV;AAAA,oBAEC,cAAI;AAAA;AAAA,gBACP;AAAA,gBACA,qBAAC,SAAI,OAAO,EAAE,WAAW,WAAW,UAAU,UAAU,YAAY,uBAAuB,OAAO,8BAA8B,SAAS,QAAQ,YAAY,UAAU,KAAK,SAAS,GACnL;AAAA,sCAAC,YAAS,MAAM,IAAI;AAAA,kBACpB,qBAAC,UAAM;AAAA,wBAAI;AAAA,oBAAe;AAAA,qBAAqB;AAAA,mBACjD;AAAA,iBACF;AAAA;AAAA;AAAA,UA1CK,IAAI;AAAA,QA2CX,CACD,GACH;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/marketing/FeatureGrid.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport type { HTMLAttributes, ReactNode } from 'react';\nimport { recipe } from '../../lib/recipe';\nimport { accentTextClass } from '../../lib/accentClasses';\nimport type { AccentToken } from '../../lib/theme';\nimport { Card } from '../Card';\nimport { SectionGrid } from './SectionGrid';\nimport type { SectionAlign, SectionColumns } from './SectionGrid';\n\nexport type { SectionAlign, SectionColumns };\n\nexport interface FeatureGridProps\n extends Omit<HTMLAttributes<HTMLElement>, 'title' | 'className'> {\n /**\n * The section's heading, rendered as its `<h2>`. When present the section is\n * named by it, so it becomes a landmark a screen reader can list.\n */\n title?: ReactNode;\n /** A line under the heading — what the features add up to. */\n description?: ReactNode;\n /**\n * How many columns at desktop widths: `2`, `3` (the default) or `4`. Below\n * `md` the grid is always one column, so a phone never gets three cramped\n * cards side by side.\n */\n columns?: SectionColumns;\n /** Where the heading block sits — `center` (the default) or `start`. */\n align?: SectionAlign;\n /** The cells — normally `Feature`s. */\n children?: ReactNode;\n /** Merged into the `<section>`'s classes. Spacing between sections is the page's to set. */\n className?: string;\n}\n\n/**\n * A marketing section of features: an optional heading and line, over a grid\n * of {@link Feature} cells.\n *\n * A layout, not content. It holds no copy, no icons and no product name — the\n * page passes all of them — so the same section is a product's feature list, a\n * project's principles, or a service's \"how it works\".\n *\n * The grid is one column below `md` and `columns` wide above it. Vertical\n * margin is `my-12`, which collapses with a neighbouring section's, so a page\n * of sections stacked in a column spaces itself.\n *\n * @example\n * ```tsx\n * <FeatureGrid title=\"Built for control\" columns={3}>\n * <Feature title=\"Sync\" icon={<Cpu size={28} />} accent=\"primary\">\n * Changes land everywhere at once.\n * </Feature>\n * </FeatureGrid>\n * ```\n */\nexport const FeatureGrid = forwardRef<HTMLElement, FeatureGridProps>(function FeatureGrid(props, ref) {\n return <SectionGrid ref={ref} slot=\"feature-grid\" {...props} />;\n});\n\nexport interface FeatureProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** The feature's name, set as the cell's `<h3>` in the accent. */\n title: string;\n /**\n * A decorative icon above the text — a `lucide-react` icon at about 28px.\n * Coloured by `accent`, and hidden from assistive technology: the title\n * already names the feature.\n */\n icon?: ReactNode;\n /** The semantic accent for the stripe, the title and the icon. None by default. */\n accent?: AccentToken;\n /** The description — a sentence or two. */\n children?: ReactNode;\n /** Merged into the cell's classes. */\n className?: string;\n}\n\nconst feature = recipe({\n slots: {\n body: 'mt-2',\n icon: 'block',\n description: 'mt-3 font-mono text-[0.85rem] leading-[1.6] text-content-primary opacity-90',\n },\n});\n\n/**\n * One cell of a {@link FeatureGrid}: a titled `Card` panel with an optional\n * icon and a short description.\n *\n * The accent is the whole colour budget — the panel's stripe, its title and\n * the icon all take it — so choose it by role, and let neighbouring cells\n * differ to tell them apart.\n *\n * @example\n * ```tsx\n * <Feature title=\"Backups\" icon={<Shield size={28} />} accent=\"secondary\">\n * Written on a schedule, restored in one step.\n * </Feature>\n * ```\n */\nexport const Feature = forwardRef<HTMLDivElement, FeatureProps>(function Feature(\n { title, icon, accent, children, className, ...props },\n ref,\n) {\n const styles = feature();\n return (\n <Card\n ref={ref}\n variant=\"panel\"\n accent={accent}\n title={title}\n data-slot=\"feature\"\n {...props}\n className={className}\n >\n <div data-slot=\"feature-body\" className={styles.body()}>\n {icon ? (\n <span\n data-slot=\"feature-icon\"\n aria-hidden=\"true\"\n className={styles.icon({ class: accent ? accentTextClass(accent) : undefined })}\n >\n {icon}\n </span>\n ) : null}\n {children ? (\n <div data-slot=\"feature-description\" className={styles.description()}>\n {children}\n </div>\n ) : null}\n </div>\n </Card>\n );\n});\n"],"mappings":";AAAA,SAAS,kBAAkB;AAE3B,SAAS,cAAc;AACvB,SAAS,uBAAuB;AAEhC,SAAS,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/marketing/FeatureGrid.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport type { HTMLAttributes, ReactNode } from 'react';\nimport { recipe } from '../../lib/recipe';\nimport { accentTextClass } from '../../lib/accentClasses';\nimport type { AccentToken } from '../../lib/theme';\nimport { Card, type CardWeight } from '../Card';\nimport { SectionGrid } from './SectionGrid';\nimport type { SectionAlign, SectionColumns } from './SectionGrid';\n\nexport type { SectionAlign, SectionColumns };\n\nexport interface FeatureGridProps\n extends Omit<HTMLAttributes<HTMLElement>, 'title' | 'className'> {\n /**\n * The section's heading, rendered as its `<h2>`. When present the section is\n * named by it, so it becomes a landmark a screen reader can list.\n */\n title?: ReactNode;\n /** A line under the heading — what the features add up to. */\n description?: ReactNode;\n /**\n * How many columns at desktop widths: `2`, `3` (the default) or `4`. Below\n * `md` the grid is always one column, so a phone never gets three cramped\n * cards side by side.\n */\n columns?: SectionColumns;\n /** Where the heading block sits — `center` (the default) or `start`. */\n align?: SectionAlign;\n /** The cells — normally `Feature`s. */\n children?: ReactNode;\n /** Merged into the `<section>`'s classes. Spacing between sections is the page's to set. */\n className?: string;\n}\n\n/**\n * A marketing section of features: an optional heading and line, over a grid\n * of {@link Feature} cells.\n *\n * A layout, not content. It holds no copy, no icons and no product name — the\n * page passes all of them — so the same section is a product's feature list, a\n * project's principles, or a service's \"how it works\".\n *\n * The grid is one column below `md` and `columns` wide above it. Vertical\n * margin is `my-12`, which collapses with a neighbouring section's, so a page\n * of sections stacked in a column spaces itself.\n *\n * @example\n * ```tsx\n * <FeatureGrid title=\"Built for control\" columns={3}>\n * <Feature title=\"Sync\" icon={<Cpu size={28} />} accent=\"primary\">\n * Changes land everywhere at once.\n * </Feature>\n * </FeatureGrid>\n * ```\n */\nexport const FeatureGrid = forwardRef<HTMLElement, FeatureGridProps>(function FeatureGrid(props, ref) {\n return <SectionGrid ref={ref} slot=\"feature-grid\" {...props} />;\n});\n\nexport interface FeatureProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** The feature's name, set as the cell's `<h3>` in the accent. */\n title: string;\n /**\n * A decorative icon above the text — a `lucide-react` icon at about 28px.\n * Coloured by `accent`, and hidden from assistive technology: the title\n * already names the feature.\n */\n icon?: ReactNode;\n /** The semantic accent for the stripe, the title and the icon. None by default. */\n accent?: AccentToken;\n /** The panel's weight. `quiet` for a grid of features beside a heavier object on the page. */\n weight?: CardWeight;\n /** The description — a sentence or two. */\n children?: ReactNode;\n /** Merged into the cell's classes. */\n className?: string;\n}\n\nconst feature = recipe({\n slots: {\n body: 'mt-2',\n icon: 'block',\n description: 'mt-3 font-mono text-[0.85rem] leading-[1.6] text-content-primary opacity-90',\n },\n});\n\n/**\n * One cell of a {@link FeatureGrid}: a titled `Card` panel with an optional\n * icon and a short description.\n *\n * The accent is the whole colour budget — the panel's stripe, its title and\n * the icon all take it — so choose it by role, and let neighbouring cells\n * differ to tell them apart.\n *\n * @example\n * ```tsx\n * <Feature title=\"Backups\" icon={<Shield size={28} />} accent=\"secondary\">\n * Written on a schedule, restored in one step.\n * </Feature>\n * ```\n */\nexport const Feature = forwardRef<HTMLDivElement, FeatureProps>(function Feature(\n { title, icon, accent, children, className, ...props },\n ref,\n) {\n const styles = feature();\n return (\n <Card\n ref={ref}\n variant=\"panel\"\n accent={accent}\n title={title}\n data-slot=\"feature\"\n {...props}\n className={className}\n >\n <div data-slot=\"feature-body\" className={styles.body()}>\n {icon ? (\n <span\n data-slot=\"feature-icon\"\n aria-hidden=\"true\"\n className={styles.icon({ class: accent ? accentTextClass(accent) : undefined })}\n >\n {icon}\n </span>\n ) : null}\n {children ? (\n <div data-slot=\"feature-description\" className={styles.description()}>\n {children}\n </div>\n ) : null}\n </div>\n </Card>\n );\n});\n"],"mappings":";AAAA,SAAS,kBAAkB;AAE3B,SAAS,cAAc;AACvB,SAAS,uBAAuB;AAEhC,SAAS,YAA6B;AACtC,SAAS,mBAAmB;AAkDnB,cA4DH,YA5DG;AADF,IAAM,cAAc,WAA0C,SAASA,aAAY,OAAO,KAAK;AACpG,SAAO,oBAAC,eAAY,KAAU,MAAK,gBAAgB,GAAG,OAAO;AAC/D,CAAC;AAqBD,IAAM,UAAU,OAAO;AAAA,EACrB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AACF,CAAC;AAiBM,IAAM,UAAU,WAAyC,SAASC,SACvE,EAAE,OAAO,MAAM,QAAQ,UAAU,WAAW,GAAG,MAAM,GACrD,KACA;AACA,QAAM,SAAS,QAAQ;AACvB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAQ;AAAA,MACR;AAAA,MACA;AAAA,MACA,aAAU;AAAA,MACT,GAAG;AAAA,MACJ;AAAA,MAEA,+BAAC,SAAI,aAAU,gBAAe,WAAW,OAAO,KAAK,GAClD;AAAA,eACC;AAAA,UAAC;AAAA;AAAA,YACC,aAAU;AAAA,YACV,eAAY;AAAA,YACZ,WAAW,OAAO,KAAK,EAAE,OAAO,SAAS,gBAAgB,MAAM,IAAI,OAAU,CAAC;AAAA,YAE7E;AAAA;AAAA,QACH,IACE;AAAA,QACH,WACC,oBAAC,SAAI,aAAU,uBAAsB,WAAW,OAAO,YAAY,GAChE,UACH,IACE;AAAA,SACN;AAAA;AAAA,EACF;AAEJ,CAAC;","names":["FeatureGrid","Feature"]}
|
|
@@ -18,7 +18,7 @@ var hero = recipe({
|
|
|
18
18
|
},
|
|
19
19
|
defaultVariants: { align: "center" }
|
|
20
20
|
});
|
|
21
|
-
var Hero = forwardRef(function Hero2({ title, subtitle, eyebrow, actions, children, bracketed = true, align = "center", className, ...props }, ref) {
|
|
21
|
+
var Hero = forwardRef(function Hero2({ title, subtitle, eyebrow, actions, children, bracketed = true, framed = true, align = "center", className, ...props }, ref) {
|
|
22
22
|
const styles = hero({ align });
|
|
23
23
|
const titleId = useId();
|
|
24
24
|
return /* @__PURE__ */ jsxs(
|
|
@@ -31,7 +31,7 @@ var Hero = forwardRef(function Hero2({ title, subtitle, eyebrow, actions, childr
|
|
|
31
31
|
className: styles.root({ class: className }),
|
|
32
32
|
children: [
|
|
33
33
|
eyebrow ? /* @__PURE__ */ jsx("span", { "data-slot": "hero-eyebrow", className: styles.eyebrow(), children: eyebrow }) : null,
|
|
34
|
-
/* @__PURE__ */ jsx(PageTitle, { id: titleId, subtitle, bracketed, children: title }),
|
|
34
|
+
/* @__PURE__ */ jsx(PageTitle, { id: titleId, subtitle, bracketed, framed, children: title }),
|
|
35
35
|
actions ? /* @__PURE__ */ jsx("div", { "data-slot": "hero-actions", className: styles.actions(), children: actions }) : null,
|
|
36
36
|
children ? /* @__PURE__ */ jsx("div", { "data-slot": "hero-media", className: styles.media(), children }) : null
|
|
37
37
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/marketing/Hero.tsx"],"sourcesContent":["import { forwardRef, useId } from 'react';\nimport type { HTMLAttributes, ReactNode } from 'react';\nimport { recipe } from '../../lib/recipe';\nimport { PageTitle } from '../PageTitle';\nimport type { SectionAlign } from './SectionGrid';\n\nexport interface HeroProps\n extends Omit<HTMLAttributes<HTMLElement>, 'title' | 'children' | 'className'> {\n /** The page's headline, rendered as its one `<h1>` through `PageTitle`. */\n title: ReactNode;\n /** A line under the headline, in the primary accent. */\n subtitle?: string;\n /**\n * A short marker above the headline — normally a `Badge`: a release, a\n * category, a status.\n */\n eyebrow?: ReactNode;\n /**\n * The calls to action, in a row under the headline that wraps on a narrow\n * screen — normally one or two `Button`s, the first the one you want pressed.\n */\n actions?: ReactNode;\n /**\n * The hero's media, below the actions — a screenshot, a terminal, a code\n * sample. Give it its own width; the hero does not constrain it.\n */\n children?: ReactNode;\n /** Draw the headline's brackets. On by default, as `PageTitle` does. */\n bracketed?: boolean;\n /** Where the headline and actions sit — `center` (the default) or `start`. */\n align?: SectionAlign;\n /** Merged into the `<section>`'s classes. */\n className?: string;\n}\n\nconst hero = recipe({\n slots: {\n root: 'mb-16',\n eyebrow: 'mb-6 inline-block',\n actions: 'mt-10 flex flex-wrap gap-5',\n media: 'mt-14',\n },\n variants: {\n align: {\n center: { root: 'text-center', actions: 'justify-center' },\n start: { root: 'text-left', actions: 'justify-start' },\n },\n },\n defaultVariants: { align: 'center' },\n});\n\n/**\n * The opening section of a marketing page: an eyebrow, the headline, a line\n * under it, the calls to action and an optional piece of media.\n *\n * Every slot is the caller's. The hero holds no copy, no product name and no\n * default buttons, so one component opens a product launch and a project site\n * without either knowing about the other. The headline is the page's `<h1>`,\n * and it names the section.\n *\n * @example\n * ```tsx\n * <Hero\n * eyebrow={<Badge accent=\"primary\">NEW</Badge>}\n * title=\"Ship the thing\"\n * subtitle=\"One line on why.\"\n * actions={<Button href=\"/start\" variant=\"tertiary\" bracketed size=\"lg\">START</Button>}\n * />\n * ```\n */\nexport const Hero = forwardRef<HTMLElement, HeroProps>(function Hero(\n { title, subtitle, eyebrow, actions, children, bracketed = true, align = 'center', className, ...props },\n ref,\n) {\n const styles = hero({ align });\n const titleId = useId();\n\n return (\n <section\n ref={ref}\n data-slot=\"hero\"\n aria-labelledby={titleId}\n {...props}\n className={styles.root({ class: className })}\n >\n {eyebrow ? (\n <span data-slot=\"hero-eyebrow\" className={styles.eyebrow()}>\n {eyebrow}\n </span>\n ) : null}\n <PageTitle id={titleId} subtitle={subtitle} bracketed={bracketed}>\n {title}\n </PageTitle>\n {actions ? (\n <div data-slot=\"hero-actions\" className={styles.actions()}>\n {actions}\n </div>\n ) : null}\n {children ? (\n <div data-slot=\"hero-media\" className={styles.media()}>\n {children}\n </div>\n ) : null}\n </section>\n );\n});\n"],"mappings":";AAAA,SAAS,YAAY,aAAa;AAElC,SAAS,cAAc;AACvB,SAAS,iBAAiB;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/marketing/Hero.tsx"],"sourcesContent":["import { forwardRef, useId } from 'react';\nimport type { HTMLAttributes, ReactNode } from 'react';\nimport { recipe } from '../../lib/recipe';\nimport { PageTitle } from '../PageTitle';\nimport type { SectionAlign } from './SectionGrid';\n\nexport interface HeroProps\n extends Omit<HTMLAttributes<HTMLElement>, 'title' | 'children' | 'className'> {\n /** The page's headline, rendered as its one `<h1>` through `PageTitle`. */\n title: ReactNode;\n /** A line under the headline, in the primary accent. */\n subtitle?: string;\n /**\n * A short marker above the headline — normally a `Badge`: a release, a\n * category, a status.\n */\n eyebrow?: ReactNode;\n /**\n * The calls to action, in a row under the headline that wraps on a narrow\n * screen — normally one or two `Button`s, the first the one you want pressed.\n */\n actions?: ReactNode;\n /**\n * The hero's media, below the actions — a screenshot, a terminal, a code\n * sample. Give it its own width; the hero does not constrain it.\n */\n children?: ReactNode;\n /** Draw the headline's brackets. On by default, as `PageTitle` does. */\n bracketed?: boolean;\n /** Draw the title in its double-ruled box. `true` by default; `false` when the hero's media leads. */\n framed?: boolean;\n /** Where the headline and actions sit — `center` (the default) or `start`. */\n align?: SectionAlign;\n /** Merged into the `<section>`'s classes. */\n className?: string;\n}\n\nconst hero = recipe({\n slots: {\n root: 'mb-16',\n eyebrow: 'mb-6 inline-block',\n actions: 'mt-10 flex flex-wrap gap-5',\n media: 'mt-14',\n },\n variants: {\n align: {\n center: { root: 'text-center', actions: 'justify-center' },\n start: { root: 'text-left', actions: 'justify-start' },\n },\n },\n defaultVariants: { align: 'center' },\n});\n\n/**\n * The opening section of a marketing page: an eyebrow, the headline, a line\n * under it, the calls to action and an optional piece of media.\n *\n * Every slot is the caller's. The hero holds no copy, no product name and no\n * default buttons, so one component opens a product launch and a project site\n * without either knowing about the other. The headline is the page's `<h1>`,\n * and it names the section.\n *\n * @example\n * ```tsx\n * <Hero\n * eyebrow={<Badge accent=\"primary\">NEW</Badge>}\n * title=\"Ship the thing\"\n * subtitle=\"One line on why.\"\n * actions={<Button href=\"/start\" variant=\"tertiary\" bracketed size=\"lg\">START</Button>}\n * />\n * ```\n */\nexport const Hero = forwardRef<HTMLElement, HeroProps>(function Hero(\n { title, subtitle, eyebrow, actions, children, bracketed = true, framed = true, align = 'center', className, ...props },\n ref,\n) {\n const styles = hero({ align });\n const titleId = useId();\n\n return (\n <section\n ref={ref}\n data-slot=\"hero\"\n aria-labelledby={titleId}\n {...props}\n className={styles.root({ class: className })}\n >\n {eyebrow ? (\n <span data-slot=\"hero-eyebrow\" className={styles.eyebrow()}>\n {eyebrow}\n </span>\n ) : null}\n <PageTitle id={titleId} subtitle={subtitle} bracketed={bracketed} framed={framed}>\n {title}\n </PageTitle>\n {actions ? (\n <div data-slot=\"hero-actions\" className={styles.actions()}>\n {actions}\n </div>\n ) : null}\n {children ? (\n <div data-slot=\"hero-media\" className={styles.media()}>\n {children}\n </div>\n ) : null}\n </section>\n );\n});\n"],"mappings":";AAAA,SAAS,YAAY,aAAa;AAElC,SAAS,cAAc;AACvB,SAAS,iBAAiB;AA6EtB,SAQI,KARJ;AA3CJ,IAAM,OAAO,OAAO;AAAA,EAClB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,OAAO;AAAA,EACT;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,MACL,QAAQ,EAAE,MAAM,eAAe,SAAS,iBAAiB;AAAA,MACzD,OAAO,EAAE,MAAM,aAAa,SAAS,gBAAgB;AAAA,IACvD;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,OAAO,SAAS;AACrC,CAAC;AAqBM,IAAM,OAAO,WAAmC,SAASA,MAC9D,EAAE,OAAO,UAAU,SAAS,SAAS,UAAU,YAAY,MAAM,SAAS,MAAM,QAAQ,UAAU,WAAW,GAAG,MAAM,GACtH,KACA;AACA,QAAM,SAAS,KAAK,EAAE,MAAM,CAAC;AAC7B,QAAM,UAAU,MAAM;AAEtB,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,aAAU;AAAA,MACV,mBAAiB;AAAA,MAChB,GAAG;AAAA,MACJ,WAAW,OAAO,KAAK,EAAE,OAAO,UAAU,CAAC;AAAA,MAE1C;AAAA,kBACC,oBAAC,UAAK,aAAU,gBAAe,WAAW,OAAO,QAAQ,GACtD,mBACH,IACE;AAAA,QACJ,oBAAC,aAAU,IAAI,SAAS,UAAoB,WAAsB,QAC/D,iBACH;AAAA,QACC,UACC,oBAAC,SAAI,aAAU,gBAAe,WAAW,OAAO,QAAQ,GACrD,mBACH,IACE;AAAA,QACH,WACC,oBAAC,SAAI,aAAU,cAAa,WAAW,OAAO,MAAM,GACjD,UACH,IACE;AAAA;AAAA;AAAA,EACN;AAEJ,CAAC;","names":["Hero"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/marketing/PricingGrid.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport type { HTMLAttributes, ReactNode } from 'react';\nimport { Check } from 'lucide-react';\nimport { recipe } from '../../lib/recipe';\nimport { ACCENT_CLASS_MAPS, accentTextClass, canonicalAccent } from '../../lib/accentClasses';\nimport { Card } from '../Card';\nimport { SectionGrid } from './SectionGrid';\nimport type { SectionAlign, SectionColumns } from './SectionGrid';\n\nexport interface PricingGridProps\n extends Omit<HTMLAttributes<HTMLElement>, 'title' | 'className'> {\n /**\n * The section's heading, rendered as its `<h2>`. When present the section is\n * named by it, so it becomes a landmark a screen reader can list.\n */\n title?: ReactNode;\n /** A line under the heading — billing terms, a trial, a guarantee. */\n description?: ReactNode;\n /**\n * How many columns at desktop widths: `2`, `3` (the default) or `4`. Match\n * it to the number of tiers. Below `md` the tiers stack in one column.\n */\n columns?: SectionColumns;\n /** Where the heading block sits — `center` (the default) or `start`. */\n align?: SectionAlign;\n /** The tiers — normally `PricingTier`s. Every cell in a row stretches to the tallest. */\n children?: ReactNode;\n /** Merged into the `<section>`'s classes. Spacing between sections is the page's to set. */\n className?: string;\n}\n\n/**\n * A marketing section of price plans: an optional heading and line, over a\n * grid of {@link PricingTier} cells stretched to one height so their actions\n * line up.\n *\n * Holds no prices, plan names or currency. The same grid is a SaaS plan table,\n * a consulting rate card or a donation ladder.\n *\n * @example\n * ```tsx\n * <PricingGrid title=\"Pricing\" columns={2}>\n * <PricingTier name=\"Solo\" price=\"$0\" period=\"/month\" features={['One workspace']} />\n * <PricingTier name=\"Team\" price=\"$12\" period=\"/seat\" badge=\"POPULAR\" accent=\"tertiary\" />\n * </PricingGrid>\n * ```\n */\nexport const PricingGrid = forwardRef<HTMLElement, PricingGridProps>(function PricingGrid(props, ref) {\n return <SectionGrid ref={ref} slot=\"pricing-grid\" {...props} />;\n});\n\n/**\n * The roles a tier's accent may take. The emphasis roles less `quiet`, because\n * the accent colours the price and is the natural `variant` for the tier's\n * `Button`, and `Button` omits `quiet`: inverse text on a quiet fill is not a\n * gated pair.\n */\nexport type PricingTierAccent = 'primary' | 'secondary' | 'tertiary';\n\n/**\n * One tier as data — the shape `SaasLandingPage`'s `pricingTiers` takes.\n *\n * It shares the component's name because it was public under that name before\n * the component existed: the type `PricingTier` is this record, the value\n * `PricingTier` is the component. `highlighted` and `ctaText` are the landing\n * page's own vocabulary; the component takes a `badge` and an `action` instead,\n * so that no label is decided on the caller's behalf.\n */\nexport interface PricingTier {\n name: string;\n price: string;\n period?: string;\n description: string;\n features: string[];\n /**\n * The tier's accent, used three ways — `Card accent`, the price, and\n * `Button variant` for the CTA. See {@link PricingTierAccent}.\n */\n accent: PricingTierAccent;\n highlighted?: boolean;\n ctaText?: string;\n}\n\nexport interface PricingTierProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** The plan's name, set as the tier's `<h3>`. */\n name: ReactNode;\n /** The price as displayed — currency and all, since only the caller knows the locale. */\n price: ReactNode;\n /** What the price is per — `/month`, `/seat`, `one-off`. Set small, in the muted ink. */\n period?: ReactNode;\n /** A line on who the plan is for. */\n description?: ReactNode;\n /** What the plan includes, one entry per line, each ticked. */\n features?: readonly ReactNode[];\n /**\n * The semantic accent for the stripe and the price. `primary` by default.\n * Pass the same role as the action `Button`'s `variant` so the tier reads as\n * one colour.\n */\n accent?: PricingTierAccent;\n /**\n * A label in the tier's header strip — `POPULAR`, `BEST VALUE`. None by\n * default: which tier is recommended, and what that is called, is the page's\n * decision.\n */\n badge?: string;\n /**\n * The call to action, pinned to the bottom of the tier below a rule — a\n * `Button`, normally in the tier's accent and full width. Omit it for a\n * tier with nothing to choose.\n */\n action?: ReactNode;\n /** Merged into the tier's classes. */\n className?: string;\n}\n\nconst pricingTier = recipe({\n slots: {\n root: 'relative flex flex-col justify-between',\n badge: 'absolute -top-3 left-4 inline-block px-2 py-[0.15rem] font-mono text-[0.65rem] font-bold uppercase text-content-inverse',\n name: 'mb-2 font-display text-[1.1rem] font-extrabold uppercase text-content-primary',\n priceRow: 'mb-4',\n price: 'font-display text-[3rem] font-black',\n period: 'font-mono text-[0.85rem] text-content-muted',\n description: 'mb-6 font-mono text-[0.75rem] leading-[1.5] text-content-primary opacity-80',\n features: 'm-0 mb-6 list-none p-0',\n feature: 'mb-[0.6rem] flex items-start gap-2 font-mono text-[0.8rem] text-content-primary opacity-90',\n tick: 'mt-[2px] shrink-0 text-intent-success',\n action: 'mt-auto border-t border-edge-strong pt-4',\n },\n});\n\n/**\n * One plan in a {@link PricingGrid}: name, price, a line about it, a ticked\n * feature list, and an action pinned to the bottom.\n *\n * A `Card` panel in a column, so the action sits on the tier's floor however\n * long its list is, and tiers of different lengths in one row keep their\n * actions level. Holds no labels of its own: the badge, the action's text and\n * whether there is one at all come from the caller.\n *\n * @example\n * ```tsx\n * <PricingTier\n * name=\"Team\"\n * price=\"$12\"\n * period=\"/seat\"\n * description=\"For a team that ships together.\"\n * features={['Shared workspaces', 'Audit log']}\n * accent=\"tertiary\"\n * badge=\"POPULAR\"\n * action={<Button variant=\"tertiary\" bracketed className=\"w-full justify-center\">START</Button>}\n * />\n * ```\n */\nexport const PricingTier = forwardRef<HTMLDivElement, PricingTierProps>(function PricingTier(\n { name, price, period, description, features, accent = 'primary', badge, action, className, ...props },\n ref,\n) {\n const styles = pricingTier();\n return (\n <Card\n ref={ref}\n variant=\"panel\"\n accent={accent}\n data-slot=\"pricing-tier\"\n {...props}\n className={styles.root({ class: className })}\n >\n {badge ? (\n // Hung on the card's top edge rather than set in its flow: in flow it\n // pushes this tier's name, price and list below its neighbours'.\n <span data-slot=\"pricing-tier-badge\" className={styles.badge({ class: ACCENT_CLASS_MAPS.FILL[canonicalAccent(accent)] })}>\n {badge}\n </span>\n ) : null}\n <div data-slot=\"pricing-tier-body\">\n <h3 className={styles.name()}>{name}</h3>\n <div data-slot=\"pricing-tier-price\" className={styles.priceRow()}>\n <span className={styles.price({ class: accentTextClass(accent) })}>{price}</span>\n {period ? <span className={styles.period()}>{period}</span> : null}\n </div>\n {description ? <p className={styles.description()}>{description}</p> : null}\n {features && features.length > 0 ? (\n <ul data-slot=\"pricing-tier-features\" className={styles.features()}>\n {features.map((item, i) => (\n <li key={typeof item === 'string' ? item : i} className={styles.feature()}>\n <Check size={14} aria-hidden=\"true\" className={styles.tick()} />\n <span>{item}</span>\n </li>\n ))}\n </ul>\n ) : null}\n </div>\n {action ? (\n <div data-slot=\"pricing-tier-action\" className={styles.action()}>\n {action}\n </div>\n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AAE,OAAO,gBAAgB,MAAM,EAAE,CAAC,GAAI,iBAAM;AAAA,YACzE,SAAS,oBAAC,UAAK,WAAW,OAAO,OAAO,GAAI,kBAAO,IAAU;AAAA,aAChE;AAAA,UACC,cAAc,oBAAC,OAAE,WAAW,OAAO,YAAY,GAAI,uBAAY,IAAO;AAAA,UACtE,YAAY,SAAS,SAAS,IAC7B,oBAAC,QAAG,aAAU,yBAAwB,WAAW,OAAO,SAAS,GAC9D,mBAAS,IAAI,CAAC,MAAM,MACnB,qBAAC,QAA6C,WAAW,OAAO,QAAQ,GACtE;AAAA,gCAAC,SAAM,MAAM,IAAI,eAAY,QAAO,WAAW,OAAO,KAAK,GAAG;AAAA,YAC9D,oBAAC,UAAM,gBAAK;AAAA,eAFL,OAAO,SAAS,WAAW,OAAO,CAG3C,CACD,GACH,IACE;AAAA,WACN;AAAA,QACC,SACC,oBAAC,SAAI,aAAU,uBAAsB,WAAW,OAAO,OAAO,GAC3D,kBACH,IACE;AAAA;AAAA;AAAA,EACN;AAEJ,CAAC;","names":["PricingGrid","PricingTier"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/marketing/PricingGrid.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport type { HTMLAttributes, ReactNode } from 'react';\nimport { Check } from 'lucide-react';\nimport { recipe } from '../../lib/recipe';\nimport { ACCENT_CLASS_MAPS, accentTextClass, canonicalAccent } from '../../lib/accentClasses';\nimport { Card, type CardWeight } from '../Card';\nimport { SectionGrid } from './SectionGrid';\nimport type { SectionAlign, SectionColumns } from './SectionGrid';\n\nexport interface PricingGridProps\n extends Omit<HTMLAttributes<HTMLElement>, 'title' | 'className'> {\n /**\n * The section's heading, rendered as its `<h2>`. When present the section is\n * named by it, so it becomes a landmark a screen reader can list.\n */\n title?: ReactNode;\n /** A line under the heading — billing terms, a trial, a guarantee. */\n description?: ReactNode;\n /**\n * How many columns at desktop widths: `2`, `3` (the default) or `4`. Match\n * it to the number of tiers. Below `md` the tiers stack in one column.\n */\n columns?: SectionColumns;\n /** Where the heading block sits — `center` (the default) or `start`. */\n align?: SectionAlign;\n /** The tiers — normally `PricingTier`s. Every cell in a row stretches to the tallest. */\n children?: ReactNode;\n /** Merged into the `<section>`'s classes. Spacing between sections is the page's to set. */\n className?: string;\n}\n\n/**\n * A marketing section of price plans: an optional heading and line, over a\n * grid of {@link (PricingTier:variable)} cells stretched to one height so their actions\n * line up.\n *\n * Holds no prices, plan names or currency. The same grid is a SaaS plan table,\n * a consulting rate card or a donation ladder.\n *\n * @example\n * ```tsx\n * <PricingGrid title=\"Pricing\" columns={2}>\n * <PricingTier name=\"Solo\" price=\"$0\" period=\"/month\" features={['One workspace']} />\n * <PricingTier name=\"Team\" price=\"$12\" period=\"/seat\" badge=\"POPULAR\" accent=\"tertiary\" />\n * </PricingGrid>\n * ```\n */\nexport const PricingGrid = forwardRef<HTMLElement, PricingGridProps>(function PricingGrid(props, ref) {\n return <SectionGrid ref={ref} slot=\"pricing-grid\" {...props} />;\n});\n\n/**\n * The roles a tier's accent may take. The emphasis roles less `quiet`, because\n * the accent colours the price and is the natural `variant` for the tier's\n * `Button`, and `Button` omits `quiet`: inverse text on a quiet fill is not a\n * gated pair.\n */\nexport type PricingTierAccent = 'primary' | 'secondary' | 'tertiary';\n\n/**\n * One tier as data — the shape `SaasLandingPage`'s `pricingTiers` takes.\n *\n * It shares the component's name because it was public under that name before\n * the component existed: the type `PricingTier` is this record, the value\n * `PricingTier` is the component. `highlighted` and `ctaText` are the landing\n * page's own vocabulary; the component takes a `badge` and an `action` instead,\n * so that no label is decided on the caller's behalf.\n */\nexport interface PricingTier {\n name: string;\n price: string;\n period?: string;\n description: string;\n features: string[];\n /**\n * The tier's accent, used three ways — `Card accent`, the price, and\n * `Button variant` for the CTA. See {@link PricingTierAccent}.\n */\n accent: PricingTierAccent;\n highlighted?: boolean;\n ctaText?: string;\n}\n\nexport interface PricingTierProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** The plan's name, set as the tier's `<h3>`. */\n name: ReactNode;\n /**\n * The tier's weight. Leave the recommended tier `strong` and set the others `quiet`, so the\n * plan the page recommends is the one heavy object in the row.\n */\n weight?: CardWeight;\n /** The price as displayed — currency and all, since only the caller knows the locale. */\n price: ReactNode;\n /** What the price is per — `/month`, `/seat`, `one-off`. Set small, in the muted ink. */\n period?: ReactNode;\n /** A line on who the plan is for. */\n description?: ReactNode;\n /** What the plan includes, one entry per line, each ticked. */\n features?: readonly ReactNode[];\n /**\n * The semantic accent for the stripe and the price. `primary` by default.\n * Pass the same role as the action `Button`'s `variant` so the tier reads as\n * one colour.\n */\n accent?: PricingTierAccent;\n /**\n * A label in the tier's header strip — `POPULAR`, `BEST VALUE`. None by\n * default: which tier is recommended, and what that is called, is the page's\n * decision.\n */\n badge?: string;\n /**\n * The call to action, pinned to the bottom of the tier below a rule — a\n * `Button`, normally in the tier's accent and full width. Omit it for a\n * tier with nothing to choose.\n */\n action?: ReactNode;\n /** Merged into the tier's classes. */\n className?: string;\n}\n\nconst pricingTier = recipe({\n slots: {\n root: 'relative flex flex-col justify-between',\n badge: 'absolute -top-3 left-4 inline-block px-2 py-[0.15rem] font-mono text-[0.65rem] font-bold uppercase text-content-inverse',\n name: 'mb-2 font-display text-[1.1rem] font-extrabold uppercase text-content-primary',\n priceRow: 'mb-4',\n price: 'font-display text-[3rem] font-black',\n period: 'font-mono text-[0.85rem] text-content-muted',\n description: 'mb-6 font-mono text-[0.75rem] leading-[1.5] text-content-primary opacity-80',\n features: 'm-0 mb-6 list-none p-0',\n feature: 'mb-[0.6rem] flex items-start gap-2 font-mono text-[0.8rem] text-content-primary opacity-90',\n tick: 'mt-[2px] shrink-0 text-intent-success',\n action: 'mt-auto border-t border-edge-strong pt-4',\n },\n});\n\n/**\n * One plan in a {@link PricingGrid}: name, price, a line about it, a ticked\n * feature list, and an action pinned to the bottom.\n *\n * A `Card` panel in a column, so the action sits on the tier's floor however\n * long its list is, and tiers of different lengths in one row keep their\n * actions level. Holds no labels of its own: the badge, the action's text and\n * whether there is one at all come from the caller.\n *\n * @example\n * ```tsx\n * <PricingTier\n * name=\"Team\"\n * price=\"$12\"\n * period=\"/seat\"\n * description=\"For a team that ships together.\"\n * features={['Shared workspaces', 'Audit log']}\n * accent=\"tertiary\"\n * badge=\"POPULAR\"\n * action={<Button variant=\"tertiary\" bracketed className=\"w-full justify-center\">START</Button>}\n * />\n * ```\n */\nexport const PricingTier = forwardRef<HTMLDivElement, PricingTierProps>(function PricingTier(\n { name, price, period, description, features, accent = 'primary', badge, action, className, ...props },\n ref,\n) {\n const styles = pricingTier();\n return (\n <Card\n ref={ref}\n variant=\"panel\"\n accent={accent}\n data-slot=\"pricing-tier\"\n {...props}\n className={styles.root({ class: className })}\n >\n {badge ? (\n // Hung on the card's top edge rather than set in its flow: in flow it\n // pushes this tier's name, price and list below its neighbours'.\n <span data-slot=\"pricing-tier-badge\" className={styles.badge({ class: ACCENT_CLASS_MAPS.FILL[canonicalAccent(accent)] })}>\n {badge}\n </span>\n ) : null}\n <div data-slot=\"pricing-tier-body\">\n <h3 className={styles.name()}>{name}</h3>\n <div data-slot=\"pricing-tier-price\" className={styles.priceRow()}>\n <span className={styles.price({ class: accentTextClass(accent) })}>{price}</span>\n {period ? <span className={styles.period()}>{period}</span> : null}\n </div>\n {description ? <p className={styles.description()}>{description}</p> : null}\n {features && features.length > 0 ? (\n <ul data-slot=\"pricing-tier-features\" className={styles.features()}>\n {features.map((item, i) => (\n <li key={typeof item === 'string' ? item : i} className={styles.feature()}>\n <Check size={14} aria-hidden=\"true\" className={styles.tick()} />\n <span>{item}</span>\n </li>\n ))}\n </ul>\n ) : null}\n </div>\n {action ? (\n <div data-slot=\"pricing-tier-action\" className={styles.action()}>\n {action}\n </div>\n ) : null}\n </Card>\n );\n});\n"],"mappings":";AAAA,SAAS,kBAAkB;AAE3B,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,mBAAmB,iBAAiB,uBAAuB;AACpE,SAAS,YAA6B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Ac,oBAAC,OAAE,WAAW,OAAO,YAAY,GAAI,uBAAY,IAAO;AAAA,UACtE,YAAY,SAAS,SAAS,IAC7B,oBAAC,QAAG,aAAU,yBAAwB,WAAW,OAAO,SAAS,GAC9D,mBAAS,IAAI,CAAC,MAAM,MACnB,qBAAC,QAA6C,WAAW,OAAO,QAAQ,GACtE;AAAA,gCAAC,SAAM,MAAM,IAAI,eAAY,QAAO,WAAW,OAAO,KAAK,GAAG;AAAA,YAC9D,oBAAC,UAAM,gBAAK;AAAA,eAFL,OAAO,SAAS,WAAW,OAAO,CAG3C,CACD,GACH,IACE;AAAA,WACN;AAAA,QACC,SACC,oBAAC,SAAI,aAAU,uBAAsB,WAAW,OAAO,OAAO,GAC3D,kBACH,IACE;AAAA;AAAA;AAAA,EACN;AAEJ,CAAC;","names":["PricingGrid","PricingTier"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// src/components/review/ChangeBar.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../lib/recipe.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var ChangeBar = React.forwardRef(function ChangeBar2({ added, removed, max, label, className, ...rest }, ref) {
|
|
6
|
+
const scale = Math.max(max ?? added + removed, 1);
|
|
7
|
+
const a = Math.min(added / scale * 100, 100);
|
|
8
|
+
const d = Math.min(removed / scale * 100, 100 - a);
|
|
9
|
+
return /* @__PURE__ */ jsxs(
|
|
10
|
+
"svg",
|
|
11
|
+
{
|
|
12
|
+
ref,
|
|
13
|
+
"data-slot": "change-bar",
|
|
14
|
+
viewBox: "0 0 100 10",
|
|
15
|
+
preserveAspectRatio: "none",
|
|
16
|
+
...label ? { role: "img", "aria-label": label } : { "aria-hidden": true },
|
|
17
|
+
...rest,
|
|
18
|
+
className: cn("inline-block h-2.5 w-[4.5rem] shrink-0 border border-edge-default bg-surface-sunken align-middle", className),
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ jsx("rect", { "data-slot": "change-bar-added", x: "0", y: "0", width: a, height: "10", className: "fill-delta-added" }),
|
|
21
|
+
/* @__PURE__ */ jsx("rect", { "data-slot": "change-bar-removed", x: a, y: "0", width: d, height: "10", className: "fill-delta-removed" })
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
export {
|
|
27
|
+
ChangeBar
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=ChangeBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/review/ChangeBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/recipe';\n\nexport interface ChangeBarProps extends Omit<React.SVGAttributes<SVGSVGElement>, 'children'> {\n /** Lines or records added. */\n added: number;\n /** Lines or records removed. */\n removed: number;\n /**\n * The size of a full bar. Pass the largest change in the list so sibling bars share a scale;\n * defaults to this change alone, which fills the bar.\n */\n max?: number;\n /** Accessible name. Without one the bar is decorative, and a `ChangeCount` beside it carries the figures. */\n label?: string;\n /** Additional classes for the bar. */\n className?: string;\n}\n\n/**\n * The share of a change, added then removed, on a track scaled to the largest change beside it.\n *\n * Drawn as SVG so the proportion is geometry rather than an inline style, and the fills take the\n * `delta` roles. Decorative by default: it repeats a count printed next to it.\n */\nexport const ChangeBar = React.forwardRef<SVGSVGElement, ChangeBarProps>(function ChangeBar(\n { added, removed, max, label, className, ...rest },\n ref,\n) {\n const scale = Math.max(max ?? added + removed, 1);\n const a = Math.min((added / scale) * 100, 100);\n const d = Math.min((removed / scale) * 100, 100 - a);\n return (\n <svg\n ref={ref}\n data-slot=\"change-bar\"\n viewBox=\"0 0 100 10\"\n preserveAspectRatio=\"none\"\n {...(label ? { role: 'img', 'aria-label': label } : { 'aria-hidden': true })}\n {...rest}\n className={cn('inline-block h-2.5 w-[4.5rem] shrink-0 border border-edge-default bg-surface-sunken align-middle', className)}\n >\n <rect data-slot=\"change-bar-added\" x=\"0\" y=\"0\" width={a} height=\"10\" className=\"fill-delta-added\" />\n <rect data-slot=\"change-bar-removed\" x={a} y=\"0\" width={d} height=\"10\" className=\"fill-delta-removed\" />\n </svg>\n );\n});\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,UAAU;AAgCf,SASE,KATF;AARG,IAAM,YAAkB,iBAA0C,SAASA,WAChF,EAAE,OAAO,SAAS,KAAK,OAAO,WAAW,GAAG,KAAK,GACjD,KACA;AACA,QAAM,QAAQ,KAAK,IAAI,OAAO,QAAQ,SAAS,CAAC;AAChD,QAAM,IAAI,KAAK,IAAK,QAAQ,QAAS,KAAK,GAAG;AAC7C,QAAM,IAAI,KAAK,IAAK,UAAU,QAAS,KAAK,MAAM,CAAC;AACnD,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,aAAU;AAAA,MACV,SAAQ;AAAA,MACR,qBAAoB;AAAA,MACnB,GAAI,QAAQ,EAAE,MAAM,OAAO,cAAc,MAAM,IAAI,EAAE,eAAe,KAAK;AAAA,MACzE,GAAG;AAAA,MACJ,WAAW,GAAG,oGAAoG,SAAS;AAAA,MAE3H;AAAA,4BAAC,UAAK,aAAU,oBAAmB,GAAE,KAAI,GAAE,KAAI,OAAO,GAAG,QAAO,MAAK,WAAU,oBAAmB;AAAA,QAClG,oBAAC,UAAK,aAAU,sBAAqB,GAAG,GAAG,GAAE,KAAI,OAAO,GAAG,QAAO,MAAK,WAAU,sBAAqB;AAAA;AAAA;AAAA,EACxG;AAEJ,CAAC;","names":["ChangeBar"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// src/components/review/ChangeCount.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../lib/recipe.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var ChangeCount = React.forwardRef(function ChangeCount2({ added, removed, moved, noun, className, ...rest }, ref) {
|
|
6
|
+
const say = (count, verb) => noun ? `${count} ${count === 1 ? noun[0] : noun[1]} ${verb}` : `${count} ${verb}`;
|
|
7
|
+
const spoken = [say(added, "added"), say(removed, "removed"), ...moved != null ? [say(moved, "moved")] : []].join(", ");
|
|
8
|
+
return /* @__PURE__ */ jsxs("span", { ref, "data-slot": "change-count", ...rest, className: cn("inline-flex gap-2 whitespace-nowrap font-mono text-sm tabular-nums", className), children: [
|
|
9
|
+
/* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: "text-delta-added", children: [
|
|
10
|
+
"+",
|
|
11
|
+
added
|
|
12
|
+
] }),
|
|
13
|
+
/* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: "text-delta-removed", children: [
|
|
14
|
+
"\u2212",
|
|
15
|
+
removed
|
|
16
|
+
] }),
|
|
17
|
+
moved != null ? /* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: "text-delta-moved", children: [
|
|
18
|
+
"\u2192",
|
|
19
|
+
moved
|
|
20
|
+
] }) : null,
|
|
21
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: spoken })
|
|
22
|
+
] });
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
ChangeCount
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=ChangeCount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/review/ChangeCount.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/recipe';\n\nexport interface ChangeCountProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {\n /** Lines or records added. */\n added: number;\n /** Lines or records removed. */\n removed: number;\n /** Lines or records moved or renamed. Printed only when given. */\n moved?: number;\n /**\n * The thing counted, for the spoken form, singular then plural: `['line', 'lines']` reads\n * \"1 line added, 50 lines removed\".\n */\n noun?: readonly [one: string, other: string];\n /** Additional classes for the count. */\n className?: string;\n}\n\n/**\n * The size of a change as `+77 −50`, in the `delta` roles.\n *\n * Change, not meaning: the added count is green because it was added, not because adding is\n * good. Screen readers hear the words rather than the signs.\n */\nexport const ChangeCount = React.forwardRef<HTMLSpanElement, ChangeCountProps>(function ChangeCount(\n { added, removed, moved, noun, className, ...rest },\n ref,\n) {\n const say = (count: number, verb: string) => (noun ? `${count} ${count === 1 ? noun[0] : noun[1]} ${verb}` : `${count} ${verb}`);\n const spoken = [say(added, 'added'), say(removed, 'removed'), ...(moved != null ? [say(moved, 'moved')] : [])].join(', ');\n return (\n <span ref={ref} data-slot=\"change-count\" {...rest} className={cn('inline-flex gap-2 whitespace-nowrap font-mono text-sm tabular-nums', className)}>\n <span aria-hidden=\"true\" className=\"text-delta-added\">+{added}</span>\n <span aria-hidden=\"true\" className=\"text-delta-removed\">−{removed}</span>\n {moved != null ? <span aria-hidden=\"true\" className=\"text-delta-moved\">→{moved}</span> : null}\n <span className=\"sr-only\">{spoken}</span>\n </span>\n );\n});\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,UAAU;AAgCb,SAGA,KAHA;AARC,IAAM,cAAoB,iBAA8C,SAASA,aACtF,EAAE,OAAO,SAAS,OAAO,MAAM,WAAW,GAAG,KAAK,GAClD,KACA;AACA,QAAM,MAAM,CAAC,OAAe,SAAkB,OAAO,GAAG,KAAK,IAAI,UAAU,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,KAAK,GAAG,KAAK,IAAI,IAAI;AAC7H,QAAM,SAAS,CAAC,IAAI,OAAO,OAAO,GAAG,IAAI,SAAS,SAAS,GAAG,GAAI,SAAS,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,IAAI,CAAC,CAAE,EAAE,KAAK,IAAI;AACxH,SACE,qBAAC,UAAK,KAAU,aAAU,gBAAgB,GAAG,MAAM,WAAW,GAAG,sEAAsE,SAAS,GAC9I;AAAA,yBAAC,UAAK,eAAY,QAAO,WAAU,oBAAmB;AAAA;AAAA,MAAE;AAAA,OAAM;AAAA,IAC9D,qBAAC,UAAK,eAAY,QAAO,WAAU,sBAAqB;AAAA;AAAA,MAAE;AAAA,OAAQ;AAAA,IACjE,SAAS,OAAO,qBAAC,UAAK,eAAY,QAAO,WAAU,oBAAmB;AAAA;AAAA,MAAE;AAAA,OAAM,IAAU;AAAA,IACzF,oBAAC,UAAK,WAAU,WAAW,kBAAO;AAAA,KACpC;AAEJ,CAAC;","names":["ChangeCount"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/components/review/ChangeIndex.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../lib/recipe.js";
|
|
4
|
+
import { ChangeBar } from "./ChangeBar.js";
|
|
5
|
+
import { ChangeCount } from "./ChangeCount.js";
|
|
6
|
+
import { diffAnchor } from "./diff.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
var LINES = ["line", "lines"];
|
|
9
|
+
function PathLabel({ path }) {
|
|
10
|
+
const cut = path.lastIndexOf("/");
|
|
11
|
+
return /* @__PURE__ */ jsxs("span", { className: "min-w-0 [overflow-wrap:anywhere]", children: [
|
|
12
|
+
cut >= 0 ? /* @__PURE__ */ jsx("span", { className: "text-content-muted", children: path.slice(0, cut + 1) }) : null,
|
|
13
|
+
path.slice(cut + 1)
|
|
14
|
+
] });
|
|
15
|
+
}
|
|
16
|
+
var ChangeIndex = React.forwardRef(function ChangeIndex2({ label = "Changed files", groups, emptyText = "No files changed.", className, ...rest }, ref) {
|
|
17
|
+
const files = groups.flatMap((group) => group.files);
|
|
18
|
+
const max = Math.max(1, ...files.map((file) => file.added + file.removed));
|
|
19
|
+
return /* @__PURE__ */ jsxs("nav", { ref, "aria-label": label, "data-slot": "change-index", ...rest, className: cn("border-t-2 border-edge-strong font-mono text-sm", className), children: [
|
|
20
|
+
files.length === 0 ? /* @__PURE__ */ jsx("p", { className: "m-0 py-3 font-sans text-content-muted", children: emptyText }) : null,
|
|
21
|
+
groups.filter((group) => group.files.length > 0).map((group) => {
|
|
22
|
+
const added = group.files.reduce((sum, file) => sum + file.added, 0);
|
|
23
|
+
const removed = group.files.reduce((sum, file) => sum + file.removed, 0);
|
|
24
|
+
return /* @__PURE__ */ jsxs("section", { "data-slot": "change-index-group", "aria-label": group.title, className: "border-b border-dashed border-edge-subtle pb-2 last:border-b-0", children: [
|
|
25
|
+
/* @__PURE__ */ jsxs("h3", { className: "m-0 flex items-center gap-3 px-0 pb-1 pt-2.5 text-xs font-bold uppercase tracking-wider text-content-primary", children: [
|
|
26
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1", children: group.title }),
|
|
27
|
+
/* @__PURE__ */ jsx(ChangeCount, { added, removed, noun: LINES, className: "text-xs" })
|
|
28
|
+
] }),
|
|
29
|
+
/* @__PURE__ */ jsx("ul", { className: "m-0 list-none p-0", children: group.files.map((file) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
30
|
+
"a",
|
|
31
|
+
{
|
|
32
|
+
href: file.href ?? `#${diffAnchor(file.path)}`,
|
|
33
|
+
"data-slot": "change-index-file",
|
|
34
|
+
"data-path": file.path,
|
|
35
|
+
className: "grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 py-1.5 pl-4 pr-0 text-content-primary no-underline hover:bg-surface-sunken focus-visible:bg-surface-sunken sm:grid-cols-[minmax(0,1fr)_auto_auto]",
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsx(PathLabel, { path: file.path }),
|
|
38
|
+
/* @__PURE__ */ jsx(ChangeCount, { added: file.added, removed: file.removed, noun: LINES }),
|
|
39
|
+
/* @__PURE__ */ jsx(ChangeBar, { added: file.added, removed: file.removed, max, className: "hidden sm:inline-block" })
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
) }, file.path)) })
|
|
43
|
+
] }, group.title);
|
|
44
|
+
})
|
|
45
|
+
] });
|
|
46
|
+
});
|
|
47
|
+
export {
|
|
48
|
+
ChangeIndex
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=ChangeIndex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/review/ChangeIndex.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/recipe';\nimport { ChangeBar } from './ChangeBar';\nimport { ChangeCount } from './ChangeCount';\n\nconst LINES = ['line', 'lines'] as const;\nimport { diffAnchor } from './diff';\n\nexport interface ChangeIndexFile {\n /** The file's path. */\n path: string;\n /** Lines added. */\n added: number;\n /** Lines removed. */\n removed: number;\n /** Where the file's diff is. Defaults to `#` + `diffAnchor(path)`, which `DiffView` uses for its id. */\n href?: string;\n}\n\nexport interface ChangeIndexGroup {\n /** The group's name, such as `Call graph` or `Hand-written code metrics`. */\n title: string;\n /** The group's files, in reading order. A group with none is left out. */\n files: readonly ChangeIndexFile[];\n}\n\nexport interface ChangeIndexProps extends React.HTMLAttributes<HTMLElement> {\n /** Accessible name for the index. */\n label?: string;\n /** Groups in reading order. Each prints its own total before its files. */\n groups: readonly ChangeIndexGroup[];\n /** Printed when every group is empty. */\n emptyText?: React.ReactNode;\n /** Additional classes for the root. */\n className?: string;\n}\n\nfunction PathLabel({ path }: { path: string }) {\n const cut = path.lastIndexOf('/');\n return (\n <span className=\"min-w-0 [overflow-wrap:anywhere]\">\n {cut >= 0 ? <span className=\"text-content-muted\">{path.slice(0, cut + 1)}</span> : null}\n {path.slice(cut + 1)}\n </span>\n );\n}\n\n/**\n * The files a change touched, grouped, each group totalled before its files, each file with a\n * count and a bar on one shared scale, and each linking to its diff.\n *\n * Plain anchors, so the index works in a report with no script. A flat, scannable list rather\n * than `FileChangeTree`'s drawn directory layout: that figure explains a small changeset's shape,\n * this one indexes a large one.\n */\nexport const ChangeIndex = React.forwardRef<HTMLElement, ChangeIndexProps>(function ChangeIndex(\n { label = 'Changed files', groups, emptyText = 'No files changed.', className, ...rest },\n ref,\n) {\n const files = groups.flatMap((group) => group.files);\n const max = Math.max(1, ...files.map((file) => file.added + file.removed));\n return (\n <nav ref={ref} aria-label={label} data-slot=\"change-index\" {...rest} className={cn('border-t-2 border-edge-strong font-mono text-sm', className)}>\n {files.length === 0 ? <p className=\"m-0 py-3 font-sans text-content-muted\">{emptyText}</p> : null}\n {groups\n .filter((group) => group.files.length > 0)\n .map((group) => {\n const added = group.files.reduce((sum, file) => sum + file.added, 0);\n const removed = group.files.reduce((sum, file) => sum + file.removed, 0);\n return (\n <section key={group.title} data-slot=\"change-index-group\" aria-label={group.title} className=\"border-b border-dashed border-edge-subtle pb-2 last:border-b-0\">\n <h3 className=\"m-0 flex items-center gap-3 px-0 pb-1 pt-2.5 text-xs font-bold uppercase tracking-wider text-content-primary\">\n <span className=\"flex-1\">{group.title}</span>\n <ChangeCount added={added} removed={removed} noun={LINES} className=\"text-xs\" />\n </h3>\n <ul className=\"m-0 list-none p-0\">\n {group.files.map((file) => (\n <li key={file.path}>\n <a\n href={file.href ?? `#${diffAnchor(file.path)}`}\n data-slot=\"change-index-file\"\n data-path={file.path}\n className=\"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 py-1.5 pl-4 pr-0 text-content-primary no-underline hover:bg-surface-sunken focus-visible:bg-surface-sunken sm:grid-cols-[minmax(0,1fr)_auto_auto]\"\n >\n <PathLabel path={file.path} />\n <ChangeCount added={file.added} removed={file.removed} noun={LINES} />\n <ChangeBar added={file.added} removed={file.removed} max={max} className=\"hidden sm:inline-block\" />\n </a>\n </li>\n ))}\n </ul>\n </section>\n );\n })}\n </nav>\n );\n});\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAG5B,SAAS,kBAAkB;AAkCvB,SACc,KADd;AAnCJ,IAAM,QAAQ,CAAC,QAAQ,OAAO;AAgC9B,SAAS,UAAU,EAAE,KAAK,GAAqB;AAC7C,QAAM,MAAM,KAAK,YAAY,GAAG;AAChC,SACE,qBAAC,UAAK,WAAU,oCACb;AAAA,WAAO,IAAI,oBAAC,UAAK,WAAU,sBAAsB,eAAK,MAAM,GAAG,MAAM,CAAC,GAAE,I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C5B,oBAAC,eAAY,OAAO,KAAK,OAAO,SAAS,KAAK,SAAS,MAAM,OAAO;AAAA,cACpE,oBAAC,aAAU,OAAO,KAAK,OAAO,SAAS,KAAK,SAAS,KAAU,WAAU,0BAAyB;AAAA;AAAA;AAAA,QACpG,KAVO,KAAK,IAWd,CACD,GACH;AAAA,WApBY,MAAM,KAqBpB;AAAA,IAEJ,CAAC;AAAA,KACL;AAEJ,CAAC;","names":["ChangeIndex"]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// src/components/review/DeltaValue.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../lib/recipe.js";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
var DEFAULT_FORMAT = new Intl.NumberFormat("en", { maximumFractionDigits: 2 });
|
|
6
|
+
function signed(value, format) {
|
|
7
|
+
if (value > 0) return `+${format(value)}`;
|
|
8
|
+
if (value < 0) return `\u2212${format(-value)}`;
|
|
9
|
+
return format(0);
|
|
10
|
+
}
|
|
11
|
+
function deltaTrend(change, direction) {
|
|
12
|
+
if (direction == null || change === 0) return void 0;
|
|
13
|
+
const up = change > 0;
|
|
14
|
+
return direction === "lower-is-better" === up ? "against" : "with";
|
|
15
|
+
}
|
|
16
|
+
var DEFAULT_SIGNIFICANCE = { noise: 0.02, major: 0.1 };
|
|
17
|
+
function deltaSignificance(relative, bands = {}) {
|
|
18
|
+
if (relative == null || !Number.isFinite(relative)) return "notable";
|
|
19
|
+
const { noise, major } = { ...DEFAULT_SIGNIFICANCE, ...bands };
|
|
20
|
+
const size = Math.abs(relative);
|
|
21
|
+
if (size < noise) return "noise";
|
|
22
|
+
return size >= major ? "major" : "notable";
|
|
23
|
+
}
|
|
24
|
+
function trendTone(trend, significance) {
|
|
25
|
+
if (trend == null || significance === "noise") return "text-content-secondary";
|
|
26
|
+
return trend === "against" ? "text-intent-danger" : "text-intent-success";
|
|
27
|
+
}
|
|
28
|
+
var DeltaValue = React.forwardRef(function DeltaValue2({ before, after, unit, direction, significance, relative = false, format = DEFAULT_FORMAT.format, className, ...rest }, ref) {
|
|
29
|
+
const withUnit = (value) => unit ? `${format(value)} ${unit}` : format(value);
|
|
30
|
+
const base = "inline-flex items-baseline gap-1.5 whitespace-nowrap font-mono text-sm tabular-nums";
|
|
31
|
+
const invalid = (v) => v != null && !Number.isFinite(v);
|
|
32
|
+
if (before == null && after == null || invalid(before) || invalid(after)) {
|
|
33
|
+
return /* @__PURE__ */ jsxs("span", { ref, "data-slot": "delta-value", "data-state": "unmeasured", ...rest, className: cn(base, "text-content-muted", className), children: [
|
|
34
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u2014" }),
|
|
35
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "not measured" })
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
if (before == null) {
|
|
39
|
+
return /* @__PURE__ */ jsxs("span", { ref, "data-slot": "delta-value", "data-state": "new", ...rest, className: cn(base, "text-content-primary", className), children: [
|
|
40
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-bold uppercase tracking-wider text-content-muted", children: "new" }),
|
|
41
|
+
/* @__PURE__ */ jsx("span", { children: withUnit(after) })
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
if (after == null) {
|
|
45
|
+
return /* @__PURE__ */ jsxs("span", { ref, "data-slot": "delta-value", "data-state": "missing", ...rest, className: cn(base, "text-content-secondary", className), children: [
|
|
46
|
+
/* @__PURE__ */ jsx("span", { className: "line-through", children: withUnit(before) }),
|
|
47
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-bold uppercase tracking-wider text-content-muted", children: "gone" })
|
|
48
|
+
] });
|
|
49
|
+
}
|
|
50
|
+
const change = after - before;
|
|
51
|
+
if (change === 0) {
|
|
52
|
+
return /* @__PURE__ */ jsxs("span", { ref, "data-slot": "delta-value", "data-state": "unchanged", ...rest, className: cn(base, "text-content-muted", className), children: [
|
|
53
|
+
/* @__PURE__ */ jsx("span", { children: withUnit(after) }),
|
|
54
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "=" }),
|
|
55
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "unchanged" })
|
|
56
|
+
] });
|
|
57
|
+
}
|
|
58
|
+
const trend = deltaTrend(change, direction);
|
|
59
|
+
const size = deltaSignificance(before === 0 ? void 0 : change / Math.abs(before), significance);
|
|
60
|
+
const rel = relative ? before === 0 ? "n/a" : `${signed(change / Math.abs(before) * 100, (v) => DEFAULT_FORMAT.format(Number(v.toFixed(1))))}%` : null;
|
|
61
|
+
return /* @__PURE__ */ jsxs("span", { ref, "data-slot": "delta-value", "data-state": "changed", "data-trend": trend, "data-significance": size, ...rest, className: cn(base, "text-content-primary", className), children: [
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: "text-content-secondary", children: withUnit(before) }),
|
|
63
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-content-muted", children: "\u2192" }),
|
|
64
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "to" }),
|
|
65
|
+
/* @__PURE__ */ jsx("span", { children: withUnit(after) }),
|
|
66
|
+
/* @__PURE__ */ jsxs("span", { "data-slot": "delta-value-change", className: cn(trendTone(trend, size), trend && size !== "noise" && (trend === "against" || size === "major") && "font-bold"), children: [
|
|
67
|
+
signed(change, format),
|
|
68
|
+
rel != null ? /* @__PURE__ */ jsxs("span", { className: "pl-1 text-content-muted", children: [
|
|
69
|
+
"(",
|
|
70
|
+
rel,
|
|
71
|
+
")"
|
|
72
|
+
] }) : null
|
|
73
|
+
] }),
|
|
74
|
+
trend ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn("text-xs", trendTone(trend, size)), children: change > 0 ? "\u25B2" : "\u25BC" }),
|
|
76
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: trend === "against" ? `, against the preferred direction (${direction?.replace(/-/g, " ")})` : `, with the preferred direction (${direction?.replace(/-/g, " ")})` })
|
|
77
|
+
] }) : null
|
|
78
|
+
] });
|
|
79
|
+
});
|
|
80
|
+
export {
|
|
81
|
+
DEFAULT_SIGNIFICANCE,
|
|
82
|
+
DeltaValue,
|
|
83
|
+
deltaSignificance,
|
|
84
|
+
deltaTrend,
|
|
85
|
+
trendTone
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=DeltaValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/review/DeltaValue.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/recipe';\n\n/** Which way a measurement is preferred to move. Omit when neither is. */\nexport type MetricDirection = 'higher-is-better' | 'lower-is-better';\n\nexport interface DeltaValueProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {\n /** The baseline's value. `null` or omitted when the measurement is new. */\n before?: number | null;\n /** The candidate's value. `null` or omitted when the measurement is gone. */\n after?: number | null;\n /** Printed after each value, e.g. `kB` or `ms`. */\n unit?: string;\n /**\n * The measurement's declared direction. A move with it is drawn in the success role, a move\n * against it in danger with ▲ or ▼ in bold. Without one, change stays uncoloured.\n */\n direction?: MetricDirection;\n /** Relative-change bands. A move under `noise` stays uncoloured; at or over `major` it is bold. */\n significance?: DeltaSignificance;\n /** Also print the relative change. A zero baseline prints `n/a` rather than infinity. */\n relative?: boolean;\n /** Formats each number. Defaults to a fixed `en` grouping, so output does not vary by machine. */\n format?: (value: number) => string;\n /** Additional classes for the value. */\n className?: string;\n}\n\nconst DEFAULT_FORMAT = new Intl.NumberFormat('en', { maximumFractionDigits: 2 });\n\nfunction signed(value: number, format: (value: number) => string): string {\n if (value > 0) return `+${format(value)}`;\n if (value < 0) return `−${format(-value)}`;\n return format(0);\n}\n\n/** `against` when the change moves away from the preferred direction, `with` when toward it. */\nexport function deltaTrend(change: number, direction?: MetricDirection): 'against' | 'with' | undefined {\n if (direction == null || change === 0) return undefined;\n const up = change > 0;\n return (direction === 'lower-is-better') === up ? 'against' : 'with';\n}\n\n/** Relative-change bands, as fractions of the baseline: under `noise` is drawn quiet, at or over `major` heavy. */\nexport interface DeltaSignificance {\n noise?: number;\n major?: number;\n}\n\nexport const DEFAULT_SIGNIFICANCE: Required<DeltaSignificance> = { noise: 0.02, major: 0.1 };\n\n/** How loudly a relative change should read. `undefined` relative (no baseline to divide by) is `notable`. */\nexport function deltaSignificance(relative: number | undefined, bands: DeltaSignificance = {}): 'noise' | 'notable' | 'major' {\n if (relative == null || !Number.isFinite(relative)) return 'notable';\n const { noise, major } = { ...DEFAULT_SIGNIFICANCE, ...bands };\n const size = Math.abs(relative);\n if (size < noise) return 'noise';\n return size >= major ? 'major' : 'notable';\n}\n\n/** Text colour for a directed change: better is success, worse is danger, noise and undirected change stay neutral. */\nexport function trendTone(trend: 'against' | 'with' | undefined, significance: 'noise' | 'notable' | 'major'): string {\n if (trend == null || significance === 'noise') return 'text-content-secondary';\n return trend === 'against' ? 'text-intent-danger' : 'text-intent-success';\n}\n\n/**\n * A measured change, `before → after +n`, the form a numeric Delta reports.\n *\n * Colour follows the declared direction and the size of the move: toward the preferred direction\n * reads as success, away from it as danger, and a relative move under the noise band stays\n * neutral. With no direction declared a change is only a change and is never coloured. Whether a\n * move is acceptable is still the Assessment's call; this only says which way it went and how far. A new or missing measurement says so\n * in words, and a zero baseline makes the relative change `n/a` rather than an infinite percent.\n */\nexport const DeltaValue = React.forwardRef<HTMLSpanElement, DeltaValueProps>(function DeltaValue(\n { before, after, unit, direction, significance, relative = false, format = DEFAULT_FORMAT.format, className, ...rest },\n ref,\n) {\n const withUnit = (value: number) => (unit ? `${format(value)} ${unit}` : format(value));\n const base = 'inline-flex items-baseline gap-1.5 whitespace-nowrap font-mono text-sm tabular-nums';\n\n // NaN or an infinity is not a measurement: say so rather than report a zero or infinite move.\n const invalid = (v: number | null | undefined) => v != null && !Number.isFinite(v);\n if ((before == null && after == null) || invalid(before) || invalid(after)) {\n return (\n <span ref={ref} data-slot=\"delta-value\" data-state=\"unmeasured\" {...rest} className={cn(base, 'text-content-muted', className)}>\n <span aria-hidden=\"true\">—</span>\n <span className=\"sr-only\">not measured</span>\n </span>\n );\n }\n if (before == null) {\n return (\n <span ref={ref} data-slot=\"delta-value\" data-state=\"new\" {...rest} className={cn(base, 'text-content-primary', className)}>\n <span className=\"text-xs font-bold uppercase tracking-wider text-content-muted\">new</span>\n <span>{withUnit(after!)}</span>\n </span>\n );\n }\n if (after == null) {\n return (\n <span ref={ref} data-slot=\"delta-value\" data-state=\"missing\" {...rest} className={cn(base, 'text-content-secondary', className)}>\n <span className=\"line-through\">{withUnit(before)}</span>\n <span className=\"text-xs font-bold uppercase tracking-wider text-content-muted\">gone</span>\n </span>\n );\n }\n\n const change = after - before;\n if (change === 0) {\n return (\n <span ref={ref} data-slot=\"delta-value\" data-state=\"unchanged\" {...rest} className={cn(base, 'text-content-muted', className)}>\n <span>{withUnit(after)}</span>\n <span aria-hidden=\"true\">=</span>\n <span className=\"sr-only\">unchanged</span>\n </span>\n );\n }\n\n const trend = deltaTrend(change, direction);\n const size = deltaSignificance(before === 0 ? undefined : change / Math.abs(before), significance);\n const rel = relative ? (before === 0 ? 'n/a' : `${signed((change / Math.abs(before)) * 100, (v) => DEFAULT_FORMAT.format(Number(v.toFixed(1))))}%`) : null;\n return (\n <span ref={ref} data-slot=\"delta-value\" data-state=\"changed\" data-trend={trend} data-significance={size} {...rest} className={cn(base, 'text-content-primary', className)}>\n <span className=\"text-content-secondary\">{withUnit(before)}</span>\n <span aria-hidden=\"true\" className=\"text-content-muted\">→</span>\n <span className=\"sr-only\">to</span>\n <span>{withUnit(after)}</span>\n <span data-slot=\"delta-value-change\" className={cn(trendTone(trend, size), trend && size !== 'noise' && (trend === 'against' || size === 'major') && 'font-bold')}>\n {signed(change, format)}\n {rel != null ? <span className=\"pl-1 text-content-muted\">({rel})</span> : null}\n </span>\n {trend ? (\n <>\n <span aria-hidden=\"true\" className={cn('text-xs', trendTone(trend, size))}>{change > 0 ? '▲' : '▼'}</span>\n <span className=\"sr-only\">{trend === 'against' ? `, against the preferred direction (${direction?.replace(/-/g, ' ')})` : `, with the preferred direction (${direction?.replace(/-/g, ' ')})`}</span>\n </>\n ) : null}\n </span>\n );\n});\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,UAAU;AAqFb,SAgDE,UA/CA,KADF;AA1DN,IAAM,iBAAiB,IAAI,KAAK,aAAa,MAAM,EAAE,uBAAuB,EAAE,CAAC;AAE/E,SAAS,OAAO,OAAe,QAA2C;AACxE,MAAI,QAAQ,EAAG,QAAO,IAAI,OAAO,KAAK,CAAC;AACvC,MAAI,QAAQ,EAAG,QAAO,SAAI,OAAO,CAAC,KAAK,CAAC;AACxC,SAAO,OAAO,CAAC;AACjB;AAGO,SAAS,WAAW,QAAgB,WAA6D;AACtG,MAAI,aAAa,QAAQ,WAAW,EAAG,QAAO;AAC9C,QAAM,KAAK,SAAS;AACpB,SAAQ,cAAc,sBAAuB,KAAK,YAAY;AAChE;AAQO,IAAM,uBAAoD,EAAE,OAAO,MAAM,OAAO,IAAI;AAGpF,SAAS,kBAAkB,UAA8B,QAA2B,CAAC,GAAkC;AAC5H,MAAI,YAAY,QAAQ,CAAC,OAAO,SAAS,QAAQ,EAAG,QAAO;AAC3D,QAAM,EAAE,OAAO,MAAM,IAAI,EAAE,GAAG,sBAAsB,GAAG,MAAM;AAC7D,QAAM,OAAO,KAAK,IAAI,QAAQ;AAC9B,MAAI,OAAO,MAAO,QAAO;AACzB,SAAO,QAAQ,QAAQ,UAAU;AACnC;AAGO,SAAS,UAAU,OAAuC,cAAqD;AACpH,MAAI,SAAS,QAAQ,iBAAiB,QAAS,QAAO;AACtD,SAAO,UAAU,YAAY,uBAAuB;AACtD;AAWO,IAAM,aAAmB,iBAA6C,SAASA,YACpF,EAAE,QAAQ,OAAO,MAAM,WAAW,cAAc,WAAW,OAAO,SAAS,eAAe,QA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KAAI;AAAA,OAChM,IACE;AAAA,KACN;AAEJ,CAAC;","names":["DeltaValue"]}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// src/components/review/DiffView.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn, recipe } from "../../lib/recipe.js";
|
|
4
|
+
import { ChangeBar } from "./ChangeBar.js";
|
|
5
|
+
import { ChangeCount } from "./ChangeCount.js";
|
|
6
|
+
import { countDiff, diffAnchor } from "./diff.js";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
var LINES = ["line", "lines"];
|
|
9
|
+
var SIGN = { added: "+", removed: "\u2212", context: " " };
|
|
10
|
+
var SPOKEN = { added: "added", removed: "removed", context: "" };
|
|
11
|
+
var diffStyles = recipe({
|
|
12
|
+
slots: {
|
|
13
|
+
root: "border border-edge-default bg-surface-raised scroll-mt-3",
|
|
14
|
+
summary: "grid cursor-pointer list-none grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 px-3 py-2.5 font-mono text-sm sm:grid-cols-[auto_minmax(0,1fr)_auto_auto] [&::-webkit-details-marker]:hidden group-open:border-b group-open:border-edge-default group-open:bg-surface-sunken",
|
|
15
|
+
scroll: "overflow-x-auto",
|
|
16
|
+
table: "w-full border-collapse font-mono text-xs leading-relaxed",
|
|
17
|
+
gutter: "w-px select-none whitespace-nowrap border-r border-edge-subtle px-2.5 text-right align-top tabular-nums text-content-muted",
|
|
18
|
+
sign: "w-px select-none px-2 align-top font-bold",
|
|
19
|
+
text: "px-2.5 align-top text-content-primary"
|
|
20
|
+
},
|
|
21
|
+
variants: {
|
|
22
|
+
wrap: {
|
|
23
|
+
true: { text: "whitespace-pre-wrap [overflow-wrap:anywhere]" },
|
|
24
|
+
false: { text: "whitespace-pre" }
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: { wrap: false }
|
|
28
|
+
});
|
|
29
|
+
var ROW = {
|
|
30
|
+
added: "bg-delta-ground-added",
|
|
31
|
+
removed: "bg-delta-ground-removed",
|
|
32
|
+
context: ""
|
|
33
|
+
};
|
|
34
|
+
var SIGN_TONE = {
|
|
35
|
+
added: "text-delta-added",
|
|
36
|
+
removed: "text-delta-removed",
|
|
37
|
+
context: "text-content-muted"
|
|
38
|
+
};
|
|
39
|
+
function PathLabel({ path }) {
|
|
40
|
+
const cut = path.lastIndexOf("/");
|
|
41
|
+
return /* @__PURE__ */ jsxs("span", { "data-slot": "diff-view-path", className: "min-w-0 font-semibold [overflow-wrap:anywhere]", children: [
|
|
42
|
+
cut >= 0 ? /* @__PURE__ */ jsx("span", { className: "font-normal text-content-muted", children: path.slice(0, cut + 1) }) : null,
|
|
43
|
+
path.slice(cut + 1)
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
var DiffView = React.forwardRef(function DiffView2({ path, hunks, collapsible = true, defaultOpen = false, wrap = false, max, id, className, ...rest }, ref) {
|
|
47
|
+
const styles = diffStyles({ wrap });
|
|
48
|
+
const { added, removed } = countDiff(hunks);
|
|
49
|
+
const anchor = id ?? diffAnchor(path);
|
|
50
|
+
const body = hunks.length === 0 ? /* @__PURE__ */ jsx("p", { className: "m-0 px-3 py-3 text-sm text-content-muted", children: "No line changes." }) : (
|
|
51
|
+
// A long line scrolls sideways; the region takes focus so the keyboard can scroll it too.
|
|
52
|
+
/* @__PURE__ */ jsx("div", { className: styles.scroll(), tabIndex: 0, role: "region", "aria-label": `Diff of ${path}`, children: /* @__PURE__ */ jsxs("table", { "data-slot": "diff-view-table", className: styles.table(), children: [
|
|
53
|
+
/* @__PURE__ */ jsx("caption", { className: "sr-only", children: `Changes to ${path}: ${added} added, ${removed} removed` }),
|
|
54
|
+
hunks.map((hunk, h) => /* @__PURE__ */ jsxs("tbody", { "data-slot": "diff-view-hunk", children: [
|
|
55
|
+
/* @__PURE__ */ jsxs("tr", { className: "bg-delta-ground-hunk", children: [
|
|
56
|
+
/* @__PURE__ */ jsx("td", { className: cn(styles.gutter(), "border-r-0"), colSpan: 3, "aria-hidden": "true" }),
|
|
57
|
+
/* @__PURE__ */ jsx("td", { className: "px-2.5 py-0.5 text-content-secondary whitespace-pre-wrap [overflow-wrap:anywhere]", children: hunk.header })
|
|
58
|
+
] }),
|
|
59
|
+
hunk.lines.flatMap((line, l) => [
|
|
60
|
+
/* @__PURE__ */ jsxs("tr", { "data-kind": line.kind, className: ROW[line.kind], children: [
|
|
61
|
+
/* @__PURE__ */ jsx("td", { className: styles.gutter(), children: line.oldNumber ?? "" }),
|
|
62
|
+
/* @__PURE__ */ jsx("td", { className: styles.gutter(), children: line.newNumber ?? "" }),
|
|
63
|
+
/* @__PURE__ */ jsxs("td", { className: cn(styles.sign(), SIGN_TONE[line.kind]), children: [
|
|
64
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: SIGN[line.kind] }),
|
|
65
|
+
line.kind !== "context" ? /* @__PURE__ */ jsx("span", { className: "sr-only", children: SPOKEN[line.kind] }) : null
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ jsx("td", { className: styles.text(), children: line.text })
|
|
68
|
+
] }, l),
|
|
69
|
+
...(line.comments ?? []).map((comment, c) => /* @__PURE__ */ jsx("tr", { "data-slot": "diff-view-comment", children: /* @__PURE__ */ jsx("td", { colSpan: 4, className: "px-2.5 py-2 font-sans", children: /* @__PURE__ */ jsxs("div", { className: "sticky left-2 flex w-[min(48rem,calc(100vw-4.5rem))] flex-col sm:ml-24 gap-1.5 whitespace-normal border border-l-2 border-edge-default border-l-accent-primary bg-surface-raised px-3 py-2.5", children: [
|
|
70
|
+
/* @__PURE__ */ jsxs("p", { className: "m-0 flex flex-wrap items-baseline gap-x-2 font-mono text-xs", children: [
|
|
71
|
+
/* @__PURE__ */ jsx("span", { className: "font-bold text-content-primary", children: comment.author }),
|
|
72
|
+
comment.meta ? /* @__PURE__ */ jsx("span", { className: "text-content-muted", children: comment.meta }) : null,
|
|
73
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: `commented on ${line.kind === "removed" ? "removed" : ""} line ${line.newNumber ?? line.oldNumber ?? ""}` })
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm text-content-primary [overflow-wrap:anywhere]", children: comment.body })
|
|
76
|
+
] }) }) }, `${l}-comment-${c}`))
|
|
77
|
+
])
|
|
78
|
+
] }, `${hunk.header}-${h}`))
|
|
79
|
+
] }) })
|
|
80
|
+
);
|
|
81
|
+
const summary = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
82
|
+
collapsible ? /* @__PURE__ */ jsxs("span", { "aria-hidden": "true", className: "font-bold text-content-muted", children: [
|
|
83
|
+
/* @__PURE__ */ jsx("span", { className: "group-open:hidden", children: "[+]" }),
|
|
84
|
+
/* @__PURE__ */ jsx("span", { className: "hidden group-open:inline", children: "[\u2212]" })
|
|
85
|
+
] }) : /* @__PURE__ */ jsx("span", { "aria-hidden": "true" }),
|
|
86
|
+
/* @__PURE__ */ jsx(PathLabel, { path }),
|
|
87
|
+
/* @__PURE__ */ jsx(ChangeCount, { added, removed, noun: LINES }),
|
|
88
|
+
/* @__PURE__ */ jsx(ChangeBar, { added, removed, max, className: "hidden sm:inline-block" })
|
|
89
|
+
] });
|
|
90
|
+
if (!collapsible) {
|
|
91
|
+
return /* @__PURE__ */ jsxs("section", { ref, id: anchor, "aria-label": path, "data-slot": "diff-view", ...rest, className: cn(styles.root(), className), children: [
|
|
92
|
+
/* @__PURE__ */ jsx("div", { className: cn(styles.summary(), "cursor-auto border-b border-edge-default bg-surface-sunken"), children: summary }),
|
|
93
|
+
body
|
|
94
|
+
] });
|
|
95
|
+
}
|
|
96
|
+
return /* @__PURE__ */ jsxs(
|
|
97
|
+
"details",
|
|
98
|
+
{
|
|
99
|
+
ref,
|
|
100
|
+
id: anchor,
|
|
101
|
+
open: defaultOpen,
|
|
102
|
+
"data-slot": "diff-view",
|
|
103
|
+
...rest,
|
|
104
|
+
className: cn("group", styles.root(), className),
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ jsx("summary", { className: styles.summary(), children: summary }),
|
|
107
|
+
body
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
export {
|
|
113
|
+
DiffView
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=DiffView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/review/DiffView.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn, recipe } from '../../lib/recipe';\nimport { ChangeBar } from './ChangeBar';\nimport { ChangeCount } from './ChangeCount';\n\nconst LINES = ['line', 'lines'] as const;\nimport { countDiff, diffAnchor, type DiffHunk, type DiffLineKind } from './diff';\n\nexport interface DiffViewProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {\n /** The file's path. The directory part is drawn muted; the anchor `id` is derived from it. */\n path: string;\n /** The hunks to draw. `parseUnifiedDiff` reads them from `git diff` output. */\n hunks: readonly DiffHunk[];\n /** Fold the file behind its summary row, as a `<details>`. Defaults to `true`. */\n collapsible?: boolean;\n /** Start unfolded. Printing prints only what is open. */\n defaultOpen?: boolean;\n /** Wrap long lines instead of scrolling them. */\n wrap?: boolean;\n /** The largest change beside this one, so the summary bars share a scale. */\n max?: number;\n /** Additional classes for the root. */\n className?: string;\n}\n\nconst SIGN: Record<DiffLineKind, string> = { added: '+', removed: '−', context: ' ' };\nconst SPOKEN: Record<DiffLineKind, string> = { added: 'added', removed: 'removed', context: '' };\n\nconst diffStyles = recipe({\n slots: {\n root: 'border border-edge-default bg-surface-raised scroll-mt-3',\n summary: 'grid cursor-pointer list-none grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 px-3 py-2.5 font-mono text-sm sm:grid-cols-[auto_minmax(0,1fr)_auto_auto] [&::-webkit-details-marker]:hidden group-open:border-b group-open:border-edge-default group-open:bg-surface-sunken',\n scroll: 'overflow-x-auto',\n table: 'w-full border-collapse font-mono text-xs leading-relaxed',\n gutter: 'w-px select-none whitespace-nowrap border-r border-edge-subtle px-2.5 text-right align-top tabular-nums text-content-muted',\n sign: 'w-px select-none px-2 align-top font-bold',\n text: 'px-2.5 align-top text-content-primary',\n },\n variants: {\n wrap: {\n true: { text: 'whitespace-pre-wrap [overflow-wrap:anywhere]' },\n false: { text: 'whitespace-pre' },\n },\n },\n defaultVariants: { wrap: false },\n});\n\nconst ROW: Record<DiffLineKind, string> = {\n added: 'bg-delta-ground-added',\n removed: 'bg-delta-ground-removed',\n context: '',\n};\n\nconst SIGN_TONE: Record<DiffLineKind, string> = {\n added: 'text-delta-added',\n removed: 'text-delta-removed',\n context: 'text-content-muted',\n};\n\nfunction PathLabel({ path }: { path: string }) {\n const cut = path.lastIndexOf('/');\n return (\n <span data-slot=\"diff-view-path\" className=\"min-w-0 font-semibold [overflow-wrap:anywhere]\">\n {cut >= 0 ? <span className=\"font-normal text-content-muted\">{path.slice(0, cut + 1)}</span> : null}\n {path.slice(cut + 1)}\n </span>\n );\n}\n\n/**\n * One file's line diff: a summary row with the path, a change count and a bar, then each hunk's\n * header and its lines with baseline and candidate line numbers in two gutters.\n *\n * A changed row is told by its sign column as well as its ground, so the diff survives\n * greyscale printing. Folds as a `<details>` by default — the one disclosure a static report\n * has — with a `[+]`/`[−]` text marker. Colours are the `delta` roles: an added line is added,\n * not approved.\n */\nexport const DiffView = React.forwardRef<HTMLElement, DiffViewProps>(function DiffView(\n { path, hunks, collapsible = true, defaultOpen = false, wrap = false, max, id, className, ...rest },\n ref,\n) {\n const styles = diffStyles({ wrap });\n const { added, removed } = countDiff(hunks);\n const anchor = id ?? diffAnchor(path);\n\n const body =\n hunks.length === 0 ? (\n <p className=\"m-0 px-3 py-3 text-sm text-content-muted\">No line changes.</p>\n ) : (\n // A long line scrolls sideways; the region takes focus so the keyboard can scroll it too.\n <div className={styles.scroll()} tabIndex={0} role=\"region\" aria-label={`Diff of ${path}`}>\n <table data-slot=\"diff-view-table\" className={styles.table()}>\n <caption className=\"sr-only\">{`Changes to ${path}: ${added} added, ${removed} removed`}</caption>\n {hunks.map((hunk, h) => (\n <tbody key={`${hunk.header}-${h}`} data-slot=\"diff-view-hunk\">\n <tr className=\"bg-delta-ground-hunk\">\n <td className={cn(styles.gutter(), 'border-r-0')} colSpan={3} aria-hidden=\"true\" />\n <td className=\"px-2.5 py-0.5 text-content-secondary whitespace-pre-wrap [overflow-wrap:anywhere]\">{hunk.header}</td>\n </tr>\n {hunk.lines.flatMap((line, l) => [\n <tr key={l} data-kind={line.kind} className={ROW[line.kind]}>\n <td className={styles.gutter()}>{line.oldNumber ?? ''}</td>\n <td className={styles.gutter()}>{line.newNumber ?? ''}</td>\n <td className={cn(styles.sign(), SIGN_TONE[line.kind])}>\n <span aria-hidden=\"true\">{SIGN[line.kind]}</span>\n {line.kind !== 'context' ? <span className=\"sr-only\">{SPOKEN[line.kind]}</span> : null}\n </td>\n <td className={styles.text()}>{line.text}</td>\n </tr>,\n ...(line.comments ?? []).map((comment, c) => (\n <tr key={`${l}-comment-${c}`} data-slot=\"diff-view-comment\">\n <td colSpan={4} className=\"px-2.5 py-2 font-sans\">\n {/* Sticky to the scroller's left edge and no wider than the viewport, so a comment stays\n readable on a narrow screen while the long lines beside it scroll. */}\n <div className=\"sticky left-2 flex w-[min(48rem,calc(100vw-4.5rem))] flex-col sm:ml-24 gap-1.5 whitespace-normal border border-l-2 border-edge-default border-l-accent-primary bg-surface-raised px-3 py-2.5\">\n <p className=\"m-0 flex flex-wrap items-baseline gap-x-2 font-mono text-xs\">\n <span className=\"font-bold text-content-primary\">{comment.author}</span>\n {comment.meta ? <span className=\"text-content-muted\">{comment.meta}</span> : null}\n <span className=\"sr-only\">{`commented on ${line.kind === 'removed' ? 'removed' : ''} line ${line.newNumber ?? line.oldNumber ?? ''}`}</span>\n </p>\n <div className=\"text-sm text-content-primary [overflow-wrap:anywhere]\">{comment.body}</div>\n </div>\n </td>\n </tr>\n )),\n ])}\n </tbody>\n ))}\n </table>\n </div>\n );\n\n const summary = (\n <>\n {collapsible ? (\n <span aria-hidden=\"true\" className=\"font-bold text-content-muted\">\n <span className=\"group-open:hidden\">[+]</span>\n <span className=\"hidden group-open:inline\">[−]</span>\n </span>\n ) : (\n <span aria-hidden=\"true\" />\n )}\n <PathLabel path={path} />\n <ChangeCount added={added} removed={removed} noun={LINES} />\n <ChangeBar added={added} removed={removed} max={max} className=\"hidden sm:inline-block\" />\n </>\n );\n\n if (!collapsible) {\n return (\n <section ref={ref} id={anchor} aria-label={path} data-slot=\"diff-view\" {...rest} className={cn(styles.root(), className)}>\n <div className={cn(styles.summary(), 'cursor-auto border-b border-edge-default bg-surface-sunken')}>{summary}</div>\n {body}\n </section>\n );\n }\n return (\n <details\n ref={ref as React.Ref<HTMLDetailsElement>}\n id={anchor}\n open={defaultOpen}\n data-slot=\"diff-view\"\n {...(rest as React.HTMLAttributes<HTMLDetailsElement>)}\n className={cn('group', styles.root(), className)}\n >\n <summary className={styles.summary()}>{summary}</summary>\n {body}\n </details>\n );\n});\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,IAAI,cAAc;AAC3B,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAG5B,SAAS,WAAW,kBAAoD;AAwDpE,SAwEA,UAvEc,KADd;AAzDJ,IAAM,QAAQ,CAAC,QAAQ,OAAO;AAoB9B,IAAM,OAAqC,EAAE,OAAO,KAAK,SAAS,UAAK,SAAS,IAAI;AACpF,IAAM,SAAuC,EAAE,OAAO,SAAS,SAAS,WAAW,SAAS,GAAG;AAE/F,IAAM,aAAa,OAAO;AAAA,EACxB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM,EAAE,MAAM,+CAA+C;AAAA,MAC7D,OAAO,EAAE,MAAM,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