@sdxc/kit 2026.10.28 → 2026.10.29

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.jsonl CHANGED
@@ -590,6 +590,7 @@
590
590
  {"release":"2026.10.2","package":"@sdxc/websub","type":"chore","breaking":false,"title":"Update Remix to 3.0.0","body":"Remix 3 is stable. Every workspace now pins `remix@3.0.0`, and\n`@remix-run/data-schema` moves to `^1.0.0`.\n\nThe component runtime moved from `remix/ui` to `remix/component`, along with\nits subpaths (`remix/component/server`, `remix/component/test`, the JSX\nruntimes), so every import and every `jsxImportSource` now points there.\n\nThe headless primitives (`anchor`, `combobox`, `listbox`, `tabs`) are no\nlonger part of `remix`. They ship in the standalone `@remix-run/ui` package,\npinned at 0.12.1, which `@sdxc/ui` and the sdxc app now depend on directly."}
591
591
  {"release":"2026.10.2","package":"@sdxc/well-known","type":"chore","breaking":false,"title":"Update Remix to 3.0.0","body":"Remix 3 is stable. Every workspace now pins `remix@3.0.0`, and\n`@remix-run/data-schema` moves to `^1.0.0`.\n\nThe component runtime moved from `remix/ui` to `remix/component`, along with\nits subpaths (`remix/component/server`, `remix/component/test`, the JSX\nruntimes), so every import and every `jsxImportSource` now points there.\n\nThe headless primitives (`anchor`, `combobox`, `listbox`, `tabs`) are no\nlonger part of `remix`. They ship in the standalone `@remix-run/ui` package,\npinned at 0.12.1, which `@sdxc/ui` and the sdxc app now depend on directly."}
592
592
  {"release":"2026.10.2","package":"@sdxc/workers-cache","type":"chore","breaking":false,"title":"Update Remix to 3.0.0","body":"Remix 3 is stable. Every workspace now pins `remix@3.0.0`, and\n`@remix-run/data-schema` moves to `^1.0.0`.\n\nThe component runtime moved from `remix/ui` to `remix/component`, along with\nits subpaths (`remix/component/server`, `remix/component/test`, the JSX\nruntimes), so every import and every `jsxImportSource` now points there.\n\nThe headless primitives (`anchor`, `combobox`, `listbox`, `tabs`) are no\nlonger part of `remix`. They ship in the standalone `@remix-run/ui` package,\npinned at 0.12.1, which `@sdxc/ui` and the sdxc app now depend on directly."}
593
+ {"release":"2026.10.2","package":"@sdxc/x402","type":"chore","breaking":false,"title":"Update Remix to 3.0.0","body":"Remix 3 is stable. Every workspace now pins `remix@3.0.0`, and\n`@remix-run/data-schema` moves to `^1.0.0`.\n\nThe component runtime moved from `remix/ui` to `remix/component`, along with\nits subpaths (`remix/component/server`, `remix/component/test`, the JSX\nruntimes), so every import and every `jsxImportSource` now points there.\n\nThe headless primitives (`anchor`, `combobox`, `listbox`, `tabs`) are no\nlonger part of `remix`. They ship in the standalone `@remix-run/ui` package,\npinned at 0.12.1, which `@sdxc/ui` and the sdxc app now depend on directly."}
593
594
  {"release":"2026.10.2","package":"@sdxc/xml","type":"chore","breaking":false,"title":"Update Remix to 3.0.0","body":"Remix 3 is stable. Every workspace now pins `remix@3.0.0`, and\n`@remix-run/data-schema` moves to `^1.0.0`.\n\nThe component runtime moved from `remix/ui` to `remix/component`, along with\nits subpaths (`remix/component/server`, `remix/component/test`, the JSX\nruntimes), so every import and every `jsxImportSource` now points there.\n\nThe headless primitives (`anchor`, `combobox`, `listbox`, `tabs`) are no\nlonger part of `remix`. They ship in the standalone `@remix-run/ui` package,\npinned at 0.12.1, which `@sdxc/ui` and the sdxc app now depend on directly."}
594
595
  {"release":"2026.10.2","package":"@sdxc/yaml","type":"chore","breaking":false,"title":"Update Remix to 3.0.0","body":"Remix 3 is stable. Every workspace now pins `remix@3.0.0`, and\n`@remix-run/data-schema` moves to `^1.0.0`.\n\nThe component runtime moved from `remix/ui` to `remix/component`, along with\nits subpaths (`remix/component/server`, `remix/component/test`, the JSX\nruntimes), so every import and every `jsxImportSource` now points there.\n\nThe headless primitives (`anchor`, `combobox`, `listbox`, `tabs`) are no\nlonger part of `remix`. They ship in the standalone `@remix-run/ui` package,\npinned at 0.12.1, which `@sdxc/ui` and the sdxc app now depend on directly."}
595
596
  {"release":"2026.10.2","package":"@sdxc/zip","type":"chore","breaking":false,"title":"Update Remix to 3.0.0","body":"Remix 3 is stable. Every workspace now pins `remix@3.0.0`, and\n`@remix-run/data-schema` moves to `^1.0.0`.\n\nThe component runtime moved from `remix/ui` to `remix/component`, along with\nits subpaths (`remix/component/server`, `remix/component/test`, the JSX\nruntimes), so every import and every `jsxImportSource` now points there.\n\nThe headless primitives (`anchor`, `combobox`, `listbox`, `tabs`) are no\nlonger part of `remix`. They ship in the standalone `@remix-run/ui` package,\npinned at 0.12.1, which `@sdxc/ui` and the sdxc app now depend on directly."}
@@ -1482,3 +1483,20 @@
1482
1483
  {"release":"2026.10.27","package":"@sdxc/raster","type":"feat","breaking":false,"title":"Fill cubic outline commands from @sdxc/font","body":"`Path.from()` now draws the `cubic` command `@sdxc/font` emits for CFF\noutlines; before, a cubic step would have closed the contour. Consumers\nneed no change: glyphs from CFF fonts fill like TrueType ones."}
1483
1484
  {"release":"2026.10.27","package":"@sdxc/ui","type":"fix","breaking":false,"title":"Leave room for the focus ring between a field's label and control","body":"`TextField`, `NumberField`, `SearchField`, `DateField`, `TimeField` and\n`ColorField` now put a `0.5rem` gap between the label, the control and the\ndescription or error under it. Before, the gap was `0.25rem`, so the focus ring\nof a focused control (2px off its edge and 3px wide) covered the bottom of its\nlabel. Their fields were also shorter than a `Select` or `TextArea` laid out\nwith the more common `0.5rem` gap, so the two didn't line up when placed side by\nside.\n\nNo change is needed to adopt it. A layout that relied on the tighter gap\nshows 4px more space per field."}
1484
1485
  {"release":"2026.10.28","package":"@sdxc/ui","type":"feat","breaking":false,"title":"Add marketing layout tokens and style factories","body":"Landing bands can now share one measure, gutter, section-spacing, and\ndisplay type vocabulary through `--ui-marketing-*` tokens and the\n`@sdxc/ui/styles` factories that read them.\n\n```tsx\nimport { viewReveal } from \"@sdxc/ui/animations\";\nimport {\n marketingBandTone,\n marketingContainer,\n marketingSectionSpace,\n displayHeading,\n marketingLead,\n} from \"@sdxc/ui/styles\";\n\n<section mix={[marketingBandTone(\"grid\"), marketingSectionSpace(\"hero\"), viewReveal()]}>\n <div mix={[marketingContainer()]}>\n <h1 mix={[displayHeading()]}>Claim</h1>\n <p mix={[marketingLead()]}>Support copy stays narrower than the headline.</p>\n </div>\n</section>\n```\n\nFactories: `marketingContainer()`, `marketingSectionSpace()`,\n`marketingBandTone()`, `displayHeading()`, `marketingLead()`,\n`marketingHairline()`, `logoCloudMark()`. Default measure is `72rem`\n(uptime's 1152px column); override `--ui-marketing-measure` for a wider\nframe. Apply existing `viewReveal()` on band hosts — no new animation\nsystem. No app migration in this change."}
1486
+ {"release":"2026.10.29","package":"@sdxc/authz","type":"refactor","breaking":false,"title":"Import MCP server from @sdxc/mcp/server","body":"Before this change, imports used `@sdxc/mcp`. After, they use `@sdxc/mcp/server`\nto match the package's entry reshape (ADR-179). No runtime behavior change for\noperators or end users."}
1487
+ {"release":"2026.10.29","package":"@sdxc/codemod","type":"refactor","breaking":false,"title":"Point MCP fixtures at @sdxc/mcp/server","body":"Before this change, imports used `@sdxc/mcp`. After, they use `@sdxc/mcp/server`\nto match the package's entry reshape (ADR-179). No runtime behavior change for\noperators or end users."}
1488
+ {"release":"2026.10.29","package":"@sdxc/kit","type":"refactor","breaking":false,"title":"Import MCP server from @sdxc/mcp/server","body":"Before this change, imports used `@sdxc/mcp`. After, they use `@sdxc/mcp/server`\nto match the package's entry reshape (ADR-179). No runtime behavior change for\noperators or end users."}
1489
+ {"release":"2026.10.29","package":"@sdxc/kit","type":"fix","breaking":false,"title":"Derive json-schema beside @sdxc/mcp/server","body":"\\`sdxc make mcp\\` turned the declarations' MCP import into a schema\nspecifier with \\`replace(/mcp$/, \\\"json-schema\\\")\\`. After ADR-179 that\nimport is \\`@sdxc/mcp/server\\`, so the replace left the MCP server entry\nand typecheck treated \\`s.object\\` as missing on \\`@sdxc/mcp\\`.\n\nBefore: schema import resolved to \\`@sdxc/mcp/server\\`.\nAfter: \\`@sdxc/mcp/server\\` and \\`@sdxc/mcp/client\\` map to\n\\`@sdxc/json-schema\\` (bare \\`@sdxc/mcp\\` still does). Template AGENTS.md\nnames \\`@sdxc/mcp/server\\`. No consumer action beyond upgrading."}
1490
+ {"release":"2026.10.29","package":"@sdxc/mcp","type":"feat","breaking":true,"title":"Split server and client entries; add Streamable HTTP client","body":"**Breaking:** there is no root `@sdxc/mcp` export. Import the server from\n`@sdxc/mcp/server` (today's API) and the client from `@sdxc/mcp/client`.\n\n```ts\n// before\nimport { createHandler } from \"@sdxc/mcp\";\n\n// after\nimport { createHandler } from \"@sdxc/mcp/server\";\n```\n\n`remix` is an optional peer: `/server` still needs it; `/client` does not.\n\nNew `@sdxc/mcp/client` binds a session with sync `connect(options)`. Prefer\n`using mcp = connect(…)` — `[Symbol.dispose]` and `close()` abort in-flight\nwork. One-word methods: `discover`, `list`, `call`, `resources`, `templates`,\n`read`. Upstream speaks `2026-07-28` only; headers/`_meta` stay internal.\nFailures use `@sdxc/result`.\n\n```ts\nimport { connect } from \"@sdxc/mcp/client\";\n\nusing mcp = connect({\n url: \"https://example.com/mcp\",\n client: { name: \"my-app\", version: \"1.0.0\" },\n});\nawait mcp.list();\n```\n\nReserves `bin.mcp-bridge` → `packages/mcp/src/bridge/index.ts` as a stub\n(throws until ADR-180). Bridge body is a follow-up PR."}
1491
+ {"release":"2026.10.29","package":"@sdxc/mcp","type":"fix","breaking":false,"title":"Drop ADR citation from the mcp-bridge stub comment","body":"Doctor's monorepo-comments check forbids ADR numbers in comments. The\nstub still explains why the bin exists and that the bridge is unfinished;\nconsumers need not act."}
1492
+ {"release":"2026.10.29","package":"@sdxc/mcp","type":"feat","breaking":false,"title":"Optional typed catalogs and result-schema validation on call","body":"`connect()` stays untyped. Pass `connect<Tools>(…)` to type tool names and\narguments from a first-party catalog. Pass an `@sdxc/json-schema` schema as\n`call`'s third argument to validate `structuredContent` (or JSON text content)\nat runtime; a miss is `InvalidToolResultError` in a Result failure.\n\n```ts\nusing mcp = connect<UptimeTools>({ url, client });\nawait mcp.call(\"list_monitors\", { limit: 20 }, MonitorList);\n```"}
1493
+ {"release":"2026.10.29","package":"@sdxc/mcp","type":"feat","breaking":false,"title":"Add mcp-bridge stdio protocol bridge","body":"Ship the ADR-180 agent-facing stdio face: local initialize /\nnotifications/initialized shim at 2025-11-25, tools and resources\ntranslated through an UpstreamClient (wired to ./client at runtime),\nand modern-only _meta / resultType / list-cache fields stripped before\nstdout. The mcp-bridge bin takes a remote URL plus --header / --token /\n--allow-http.\n\n mcp-bridge https://example.com/mcp --token \"$TOKEN\"\n\nCursor mcp.json can spawn it via npx @sdxc/mcp@latest the same way\nmcp-remote was configured. OAuth is deferred. A temporary ./client stub\nthrows until this branch rebases onto the ADR-179 client PR; tests inject\nhandlerUpstream against createHandler in-process."}
1494
+ {"release":"2026.10.29","package":"@sdxc/mcp","type":"fix","breaking":false,"title":"Wire mcp-bridge to the real @sdxc/mcp/client","body":"After rebasing onto the ADR-179 client branch, import connect statically,\nreuse McpClientError as the bridge upstream failure, and mark the README\nentry table as shipping the stdio bridge body. No consumer action for\napps already on /client — only the bridge bin path is affected."}
1495
+ {"release":"2026.10.29","package":"@sdxc/mcp","type":"fix","breaking":false,"title":"Drop ADR citations from bridge comments","body":"Rewrite the mcp-bridge module JSDoc and README bridge blurb to state\nthe handshake-vs-modern protocol reason in place, so monorepo-comments\npasses. No runtime or consumer API change."}
1496
+ {"release":"2026.10.29","package":"@sdxc/mcp","type":"feat","breaking":true,"title":"Put call result schema on the input bag","body":"`call`'s optional result schema is no longer a positional third argument.\nPass `schema` on the same object as the tool fields; the client strips it\nbefore sending `arguments` upstream. Validation and Result failures are\nunchanged.\n\nBefore:\n\n```ts\nawait mcp.call(\"list_monitors\", { limit: 20 }, MonitorList);\n```\n\nAfter:\n\n```ts\nawait mcp.call(\"list_monitors\", { limit: 20, schema: MonitorList });\n```\n\n`call(name)` and `call(name, { …tool fields })` without `schema` keep working."}
1497
+ {"release":"2026.10.29","package":"@sdxc/ui","type":"feat","breaking":false,"title":"Add marketing landing primitives","body":"Landing pages can assemble bands from shared markup + style components\ninstead of re-deriving spacing and type per app. Copy stays on the page —\nevery string is a prop or child.\n\n```tsx\nimport {\n CtaGroup,\n Feature,\n LogoCloud,\n MarketingHeader,\n MarketingSection,\n Split,\n StatStrip,\n Button,\n LinkButton,\n HeadingScope,\n} from \"@sdxc/ui\";\nimport { marketingCtaChrome } from \"@sdxc/ui/styles\";\n\n<HeadingScope>\n <MarketingSection tone=\"tinted\" spacing=\"normal\" ruled>\n <MarketingHeader eyebrow={t(\"badge\")} description={t(\"lead\")}>\n {t(\"title\")}\n </MarketingHeader>\n <CtaGroup>\n <Button size=\"lg\" color=\"brand\" mix={[marketingCtaChrome()]}>\n {t(\"cta\")}\n </Button>\n <LinkButton href={docs} size=\"lg\" variant=\"outline\">\n {t(\"docs\")}\n </LinkButton>\n </CtaGroup>\n </MarketingSection>\n</HeadingScope>\n```\n\nPrimitives: `MarketingSection`, `MarketingHeader`, `CtaGroup`, `Split` /\n`Split.Copy` / `Split.Media`, `StatStrip` / `StatStrip.Item`, `LogoCloud`,\n`Feature` / `Feature.Grid`. `Heading` gains `size=\"display\" | \"chapter\"`;\n`marketingCtaChrome()` applies `--ui-marketing-cta-radius` plus a soft\nshadow. Pair nav CTAs at `size=\"sm\"` (~32px) with hero rows at `size=\"lg\"`\n(~48px). No app migration in this change."}
1498
+ {"release":"2026.10.29","package":"@sdxc/ui","type":"fix","breaking":false,"title":"Align marketing docs examples with live frames","body":"Drop the extra Accordion / LinkButton / NavLink `@example` tags that outgrew\ntheir preview coverage, and keep the FAQ pairing and CTA density notes in\nprose instead. Heading keeps a chapter-size example as its third documented\ncase for the matching sdxc-site frame.\n\nNo consumer API change."}
1499
+ {"release":"2026.10.29","package":"@sdxc/ui","type":"feat","breaking":false,"title":"Add landing patterns and composition craft","body":"Landing pages can assemble Hero → Proof → FeatureBand → Faq → ClosingCta\nfrom `@sdxc/ui/patterns` instead of re-deriving band layout per app. Copy\nstays on the page — every string is a prop or child.\n\n```tsx\nimport { Button, LinkButton, HeadingScope } from \"@sdxc/ui\";\nimport {\n LandingHero,\n ProofStrip,\n FeatureBand,\n ClosingCta,\n FaqBand,\n ProductFrame,\n} from \"@sdxc/ui/patterns\";\n\n<HeadingScope>\n <LandingHero\n tone=\"grid\"\n title={t(\"hero.title\")}\n description={t(\"hero.lead\")}\n actions={<Button size=\"lg\">{t(\"hero.cta\")}</Button>}\n media={<ProductFrame lights>{shot}</ProductFrame>}\n />\n <ProofStrip>{/* LogoCloud or StatStrip */}</ProofStrip>\n <FeatureBand layout=\"split\" title={t(\"f1.title\")} media={...}>\n {claims}\n </FeatureBand>\n <FaqBand title={t(\"faq.title\")} columns={2}>\n <Accordion>{left}</Accordion>\n <Accordion>{right}</Accordion>\n </FaqBand>\n <ClosingCta title={t(\"close.title\")} actions={...} />\n</HeadingScope>\n```\n\nBuilding blocks: `LandingHero`, `ProofStrip`, `FeatureBand` (`split` |\n`grid` | `steps`), `FaqBand`, `ClosingCta`. Composition craft:\n`ProductFrame`, `CodeStage`/`TerminalPanel`, `InstallTabs`, `TabbedStage`,\n`CheckList`/`CheckRow`, `IconWell`, `Bento`, `StepList`, `AnnouncementChip`,\n`AccentText`. Install and tabbed stages switch with radios + CSS (no JS).\nNo app migration in this change."}
1500
+ {"release":"2026.10.29","package":"@sdxc/x402","type":"feat","breaking":false,"title":"Add Remix seller middleware for the x402 payment protocol","body":"Install with `npm add @sdxc/x402`. Mount `x402({ facilitator, payTo,\nnetwork, asset })` on a Remix router, then guard a route with\n`requirePayment({ amount, description })`. Unpaid requests answer HTTP\n402 with `PAYMENT-REQUIRED`; a settled `PAYMENT-SIGNATURE` continues\nand attaches `PAYMENT-RESPONSE`. Use `MemoryFacilitator` and\n`@sdxc/x402/testing` in Vitest; point `HTTPFacilitator` at a real\nfacilitator URL in production."}
1501
+ {"release":"2026.10.29","package":"@sdxc/x402","type":"docs","breaking":false,"title":"Document API exports and Patterns in the package README","body":"Expand the npm landing page to the package-documentation structure:\nUsage examples, every public export under API, and Patterns for catalog\npricing, lazy-route guards, MCP header charging, facilitator config,\nVitest payment assertions, and PaymentReceiptKey. No runtime change."}
1502
+ {"release":"2026.10.29","package":"@sdxc/x402","type":"feat","breaking":false,"title":"Stamp Bazaar discovery and forward facilitator auth headers","body":"Sellers can attach `extensions.bazaar` on a 402 so facilitators that index\nBazaar catalog the resource after settle. `HTTPFacilitator` accepts optional\n`headers` (for example a CDP `Authorization` bearer) on every `/verify` and\n`/settle` call.\n\n```typescript\nimport { bazaarHttpPost, HTTPFacilitator } from \"@sdxc/x402\";\nimport { requirePayment } from \"@sdxc/x402/middleware\";\n\nnew HTTPFacilitator({\n url: \"https://api.cdp.coinbase.com/platform/v2/x402\",\n headers: { Authorization: `Bearer ${token}` },\n});\n\nrequirePayment({\n amount: \"1000\",\n description: \"Encode a QR\",\n extensions: {\n bazaar: bazaarHttpPost(\n { text: \"https://sdxc.dev\" },\n { type: \"json\", example: { svgPath: \"M…\" } },\n ),\n },\n});\n```"}
@@ -267,7 +267,7 @@ async function declareMcp(request, root) {
267
267
  return manual(builderImport.error.message);
268
268
  let source = builderImport.data.source;
269
269
  if (!resource) {
270
- let schemaSpecifier = mcpSpecifier.replace(/mcp$/, "json-schema");
270
+ let schemaSpecifier = jsonSchemaBeside(mcpSpecifier);
271
271
  let schema = ensureImport(declarations, source, { kind: "namespace" }, (specifier) => specifier === schemaSpecifier, schemaSpecifier, "s");
272
272
  if (isFailure(schema))
273
273
  return manual(schema.error.message);
@@ -852,6 +852,17 @@ function staticSpecifiers(file) {
852
852
  .filter((reference) => reference.kind === "import")
853
853
  .map((reference) => reference.specifier);
854
854
  }
855
+ /**
856
+ * The `@sdxc/json-schema` (or `sdxc/json-schema`) specifier that sits beside an MCP
857
+ * import — whether that import is the bare package or its `/server` / `/client` entry.
858
+ *
859
+ * @param mcpSpecifier The MCP module the declarations already import.
860
+ */
861
+ function jsonSchemaBeside(mcpSpecifier) {
862
+ return mcpSpecifier
863
+ .replace(/\/mcp\/(?:server|client)$/, "/json-schema")
864
+ .replace(/mcp$/, "json-schema");
865
+ }
855
866
  /** Where a nested declaration goes, for the printed instructions. */
856
867
  function groupNote(path) {
857
868
  return path.length > 1 ? `, under ${path.slice(0, -1).join(".")}` : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdxc/kit",
3
- "version": "2026.10.28",
3
+ "version": "2026.10.29",
4
4
  "description": "The sdxc command line: start a Remix v3 app, generate its files, copy UI components into it and upgrade it",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@sdxc/cli": "2026.10.24",
18
- "@sdxc/codemod": "2026.10.23",
18
+ "@sdxc/codemod": "2026.10.29",
19
19
  "@sdxc/cron": "2026.10.25",
20
20
  "@sdxc/diagram": "2026.10.26",
21
21
  "@sdxc/iife": "2026.10.23",
@@ -29,7 +29,7 @@
29
29
  "peerDependencies": {
30
30
  "remix": "3.1.0"
31
31
  },
32
- "gitHead": "3925ab3050d9a10d86340267d73168bdc8d24531",
32
+ "gitHead": "35512fbdbf4ecc8c8fba95d5f6c8c63f4c026cfe",
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accordion",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.10.29",
4
4
  "dependencies": [
5
5
  "disclosure"
6
6
  ],
@@ -9,7 +9,7 @@
9
9
  ],
10
10
  "source": {
11
11
  "path": "accordion.tsx",
12
- "content": "/**\n * A set of expand/collapse sections built on {@link Disclosure}, stacked into\n * one divider-separated list. Each section holds its state on its native\n * `<details>` element; giving sibling {@link Accordion.Item}s the same `name`\n * makes the set exclusive through the platform's `<details name>` behavior,\n * closing whichever section was open as another opens.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { bg, borderEdge, fg } from \"@sdxc/u/color\";\nimport { opacity, rounded, transition, transitionDuration } from \"@sdxc/u/effects\";\nimport { justify, shrink } from \"@sdxc/u/layout\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is, pb, pbe, pi } from \"@sdxc/u/size\";\nimport { hover, open, when } from \"@sdxc/u/state\";\nimport { rotate } from \"@sdxc/u/transform\";\nimport { pretty, text, textDecoration } from \"@sdxc/u/typography\";\n\nimport { Disclosure } from \"@sdxc/ui/disclosure\";\n\n/**\n * Prop types for {@link Accordion} and its compound parts.\n */\nexport namespace Accordion {\n\t/**\n\t * Props accepted by {@link Accordion}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** One or more {@link Accordion.Item} sections to stack into a list. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Every prop {@link Disclosure.Props} accepts, unchanged: the section's\n\t * `open` state and, when set to the same value across siblings, the\n\t * `name` that makes the group exclusive.\n\t */\n\texport interface ItemProps extends Disclosure.Props {}\n\n\t/** Every prop {@link Disclosure.TriggerProps} accepts, unchanged. */\n\texport interface TriggerProps extends Disclosure.TriggerProps {}\n\n\t/** Every prop {@link Disclosure.PanelProps} accepts, unchanged. */\n\texport interface ContentProps extends Disclosure.PanelProps {}\n}\n\n/**\n * Renders the list's root host: a plain `<div>` that stacks\n * {@link Accordion.Item} sections in normal block flow, each drawing its own\n * divider so the whole list reads as one continuous group.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the list's markup.\n * @example\n * <Accordion>\n * \t<Accordion.Item>\n * \t\t<Accordion.Trigger>\n * \t\t\t{t(\"faq.refunds.question\")}\n * \t\t\t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * \t\t</Accordion.Trigger>\n * \t\t<Accordion.Content>\n * \t\t\t<p>{t(\"faq.refunds.answer\")}</p>\n * \t\t</Accordion.Content>\n * \t</Accordion.Item>\n * \t<Accordion.Item>\n * \t\t<Accordion.Trigger>\n * \t\t\t{t(\"faq.shipping.question\")}\n * \t\t\t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * \t\t</Accordion.Trigger>\n * \t\t<Accordion.Content>\n * \t\t\t<p>{t(\"faq.shipping.answer\")}</p>\n * \t\t</Accordion.Content>\n * \t</Accordion.Item>\n * </Accordion>\n * @example\n * <Accordion>\n * \t<Accordion.Item name=\"faq\" open>\n * \t\t<Accordion.Trigger>\n * \t\t\t{t(\"faq.refunds.question\")}\n * \t\t\t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * \t\t</Accordion.Trigger>\n * \t\t<Accordion.Content>\n * \t\t\t<p>{t(\"faq.refunds.answer\")}</p>\n * \t\t</Accordion.Content>\n * \t</Accordion.Item>\n * \t<Accordion.Item name=\"faq\">\n * \t\t<Accordion.Trigger>\n * \t\t\t{t(\"faq.shipping.question\")}\n * \t\t\t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * \t\t</Accordion.Trigger>\n * \t\t<Accordion.Content>\n * \t\t\t<p>{t(\"faq.shipping.answer\")}</p>\n * \t\t</Accordion.Content>\n * \t</Accordion.Item>\n * </Accordion>\n */\nexport function Accordion(handle: Handle<Accordion.Props>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div {...rest} mix={[is(\"full\"), mix]}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders one section as {@link Disclosure} restyled into a flush list row:\n * only a shared block-end divider survives, restored block-start on the first\n * section. A trigger marked `aria-disabled=\"true\"` dims the whole section.\n *\n * @param handle Runtime handle carrying the host `<details>`'s props.\n * @returns The render function producing the section's markup.\n * @example\n * <Accordion.Item>\n * \t<Accordion.Trigger>\n * \t\t{t(\"faq.refunds.question\")}\n * \t\t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * \t</Accordion.Trigger>\n * \t<Accordion.Content>\n * \t\t<p>{t(\"faq.refunds.answer\")}</p>\n * \t</Accordion.Content>\n * </Accordion.Item>\n * @example\n * <Accordion.Item name=\"faq\" open>\n * \t<Accordion.Trigger>\n * \t\t{t(\"faq.refunds.question\")}\n * \t\t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * \t</Accordion.Trigger>\n * \t<Accordion.Content>\n * \t\t<p>{t(\"faq.refunds.answer\")}</p>\n * \t</Accordion.Content>\n * </Accordion.Item>\n */\nAccordion.Item = function AccordionItem(handle: Handle<Accordion.ItemProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Disclosure\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\trounded(\"none\"),\n\t\t\t\t\tborderEdge(\"inline-start\", { width: \"0\", noStyleDefault: true }),\n\t\t\t\t\tborderEdge(\"inline-end\", { width: \"0\", noStyleDefault: true }),\n\t\t\t\t\tborderEdge(\"block-start\", { width: \"0\", noStyleDefault: true }),\n\t\t\t\t\topen(when('& summary [data-slot=\"icon\"]', rotate(180))),\n\t\t\t\t\twhen(\"&:first-child\", borderEdge(\"block-start\", { width: 1 })),\n\t\t\t\t\twhen('&:has(> summary[aria-disabled=\"true\"])', opacity(50)),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Accordion.TriggerProps.children} as the section's label row,\n * spread to opposite ends and underlined on hover. An icon element carrying\n * `data-slot=\"icon\"` rotates 180 degrees while its section is open.\n *\n * @param handle Runtime handle carrying the host `<summary>`'s props.\n * @returns The render function producing the label row's markup.\n * @example\n * <Accordion.Trigger>\n * \t{t(\"faq.refunds.question\")}\n * \t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * </Accordion.Trigger>\n * @example\n * <Accordion.Trigger aria-disabled=\"true\">\n * \t{t(\"faq.archived.question\")}\n * \t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * </Accordion.Trigger>\n */\nAccordion.Trigger = function AccordionTrigger(handle: Handle<Accordion.TriggerProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Disclosure.Trigger\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tjustify(\"between\"),\n\t\t\t\t\tpb(4),\n\t\t\t\t\tpi(0),\n\t\t\t\t\trounded(\"none\"),\n\t\t\t\t\thover([bg(\"transparent\"), textDecoration(\"underline\")]),\n\t\t\t\t\twhen('& [data-slot=\"icon\"]', [\n\t\t\t\t\t\tis(4),\n\t\t\t\t\t\tbs(4),\n\t\t\t\t\t\tshrink(),\n\t\t\t\t\t\ttransition(\"transform\", { duration: \"200ms\" }),\n\t\t\t\t\t]),\n\t\t\t\t\tmedia(\n\t\t\t\t\t\t\"(prefers-reduced-motion: reduce)\",\n\t\t\t\t\t\twhen('& [data-slot=\"icon\"]', transitionDuration(\"0s\")),\n\t\t\t\t\t),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Accordion.ContentProps.children} as the section's revealed body:\n * {@link Disclosure.Panel} running edge to edge like its trigger, with block-end\n * padding and small, muted text sized for supporting copy.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the body's markup.\n * @example\n * <Accordion.Content>\n * \t<p>{t(\"faq.refunds.answer\")}</p>\n * </Accordion.Content>\n */\nAccordion.Content = function AccordionContent(handle: Handle<Accordion.ContentProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Disclosure.Panel {...rest} mix={[pi(0), pbe(4), fg(\"neutral\"), text(\"sm\"), pretty(), mix]} />\n\t\t);\n\t};\n};\n"
12
+ "content": "/**\n * A set of expand/collapse sections built on {@link Disclosure}, stacked into\n * one divider-separated list. Each section holds its state on its native\n * `<details>` element; giving sibling {@link Accordion.Item}s the same `name`\n * makes the set exclusive through the platform's `<details name>` behavior,\n * closing whichever section was open as another opens.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { bg, borderEdge, fg } from \"@sdxc/u/color\";\nimport { opacity, rounded, transition, transitionDuration } from \"@sdxc/u/effects\";\nimport { justify, shrink } from \"@sdxc/u/layout\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is, pb, pbe, pi } from \"@sdxc/u/size\";\nimport { hover, open, when } from \"@sdxc/u/state\";\nimport { rotate } from \"@sdxc/u/transform\";\nimport { pretty, text, textDecoration } from \"@sdxc/u/typography\";\n\nimport { Disclosure } from \"@sdxc/ui/disclosure\";\n\n/**\n * Prop types for {@link Accordion} and its compound parts.\n */\nexport namespace Accordion {\n\t/**\n\t * Props accepted by {@link Accordion}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** One or more {@link Accordion.Item} sections to stack into a list. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Every prop {@link Disclosure.Props} accepts, unchanged: the section's\n\t * `open` state and, when set to the same value across siblings, the\n\t * `name` that makes the group exclusive.\n\t */\n\texport interface ItemProps extends Disclosure.Props {}\n\n\t/** Every prop {@link Disclosure.TriggerProps} accepts, unchanged. */\n\texport interface TriggerProps extends Disclosure.TriggerProps {}\n\n\t/** Every prop {@link Disclosure.PanelProps} accepts, unchanged. */\n\texport interface ContentProps extends Disclosure.PanelProps {}\n}\n\n/**\n * Renders the list's root host: a plain `<div>` that stacks\n * {@link Accordion.Item} sections in normal block flow, each drawing its own\n * divider so the whole list reads as one continuous group. A marketing FAQ\n * lays two of these in a container-query grid under a {@link MarketingHeader},\n * sharing one `name` across columns so only one item opens at a time.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the list's markup.\n * @example\n * <Accordion>\n * \t<Accordion.Item>\n * \t\t<Accordion.Trigger>\n * \t\t\t{t(\"faq.refunds.question\")}\n * \t\t\t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * \t\t</Accordion.Trigger>\n * \t\t<Accordion.Content>\n * \t\t\t<p>{t(\"faq.refunds.answer\")}</p>\n * \t\t</Accordion.Content>\n * \t</Accordion.Item>\n * \t<Accordion.Item>\n * \t\t<Accordion.Trigger>\n * \t\t\t{t(\"faq.shipping.question\")}\n * \t\t\t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * \t\t</Accordion.Trigger>\n * \t\t<Accordion.Content>\n * \t\t\t<p>{t(\"faq.shipping.answer\")}</p>\n * \t\t</Accordion.Content>\n * \t</Accordion.Item>\n * </Accordion>\n * @example\n * <Accordion>\n * \t<Accordion.Item name=\"faq\" open>\n * \t\t<Accordion.Trigger>\n * \t\t\t{t(\"faq.refunds.question\")}\n * \t\t\t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * \t\t</Accordion.Trigger>\n * \t\t<Accordion.Content>\n * \t\t\t<p>{t(\"faq.refunds.answer\")}</p>\n * \t\t</Accordion.Content>\n * \t</Accordion.Item>\n * \t<Accordion.Item name=\"faq\">\n * \t\t<Accordion.Trigger>\n * \t\t\t{t(\"faq.shipping.question\")}\n * \t\t\t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * \t\t</Accordion.Trigger>\n * \t\t<Accordion.Content>\n * \t\t\t<p>{t(\"faq.shipping.answer\")}</p>\n * \t\t</Accordion.Content>\n * \t</Accordion.Item>\n * </Accordion>\n */\nexport function Accordion(handle: Handle<Accordion.Props>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div {...rest} mix={[is(\"full\"), mix]}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders one section as {@link Disclosure} restyled into a flush list row:\n * only a shared block-end divider survives, restored block-start on the first\n * section. A trigger marked `aria-disabled=\"true\"` dims the whole section.\n *\n * @param handle Runtime handle carrying the host `<details>`'s props.\n * @returns The render function producing the section's markup.\n * @example\n * <Accordion.Item>\n * \t<Accordion.Trigger>\n * \t\t{t(\"faq.refunds.question\")}\n * \t\t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * \t</Accordion.Trigger>\n * \t<Accordion.Content>\n * \t\t<p>{t(\"faq.refunds.answer\")}</p>\n * \t</Accordion.Content>\n * </Accordion.Item>\n * @example\n * <Accordion.Item name=\"faq\" open>\n * \t<Accordion.Trigger>\n * \t\t{t(\"faq.refunds.question\")}\n * \t\t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * \t</Accordion.Trigger>\n * \t<Accordion.Content>\n * \t\t<p>{t(\"faq.refunds.answer\")}</p>\n * \t</Accordion.Content>\n * </Accordion.Item>\n */\nAccordion.Item = function AccordionItem(handle: Handle<Accordion.ItemProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Disclosure\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\trounded(\"none\"),\n\t\t\t\t\tborderEdge(\"inline-start\", { width: \"0\", noStyleDefault: true }),\n\t\t\t\t\tborderEdge(\"inline-end\", { width: \"0\", noStyleDefault: true }),\n\t\t\t\t\tborderEdge(\"block-start\", { width: \"0\", noStyleDefault: true }),\n\t\t\t\t\topen(when('& summary [data-slot=\"icon\"]', rotate(180))),\n\t\t\t\t\twhen(\"&:first-child\", borderEdge(\"block-start\", { width: 1 })),\n\t\t\t\t\twhen('&:has(> summary[aria-disabled=\"true\"])', opacity(50)),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Accordion.TriggerProps.children} as the section's label row,\n * spread to opposite ends and underlined on hover. An icon element carrying\n * `data-slot=\"icon\"` rotates 180 degrees while its section is open.\n *\n * @param handle Runtime handle carrying the host `<summary>`'s props.\n * @returns The render function producing the label row's markup.\n * @example\n * <Accordion.Trigger>\n * \t{t(\"faq.refunds.question\")}\n * \t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * </Accordion.Trigger>\n * @example\n * <Accordion.Trigger aria-disabled=\"true\">\n * \t{t(\"faq.archived.question\")}\n * \t<ChevronDownIcon data-slot=\"icon\" aria-hidden />\n * </Accordion.Trigger>\n */\nAccordion.Trigger = function AccordionTrigger(handle: Handle<Accordion.TriggerProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Disclosure.Trigger\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tjustify(\"between\"),\n\t\t\t\t\tpb(4),\n\t\t\t\t\tpi(0),\n\t\t\t\t\trounded(\"none\"),\n\t\t\t\t\thover([bg(\"transparent\"), textDecoration(\"underline\")]),\n\t\t\t\t\twhen('& [data-slot=\"icon\"]', [\n\t\t\t\t\t\tis(4),\n\t\t\t\t\t\tbs(4),\n\t\t\t\t\t\tshrink(),\n\t\t\t\t\t\ttransition(\"transform\", { duration: \"200ms\" }),\n\t\t\t\t\t]),\n\t\t\t\t\tmedia(\n\t\t\t\t\t\t\"(prefers-reduced-motion: reduce)\",\n\t\t\t\t\t\twhen('& [data-slot=\"icon\"]', transitionDuration(\"0s\")),\n\t\t\t\t\t),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Accordion.ContentProps.children} as the section's revealed body:\n * {@link Disclosure.Panel} running edge to edge like its trigger, with block-end\n * padding and small, muted text sized for supporting copy.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the body's markup.\n * @example\n * <Accordion.Content>\n * \t<p>{t(\"faq.refunds.answer\")}</p>\n * </Accordion.Content>\n */\nAccordion.Content = function AccordionContent(handle: Handle<Accordion.ContentProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<Disclosure.Panel {...rest} mix={[pi(0), pbe(4), fg(\"neutral\"), text(\"sm\"), pretty(), mix]} />\n\t\t);\n\t};\n};\n"
13
13
  },
14
14
  "test": null
15
15
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "button",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.10.29",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "Button"
7
7
  ],
8
8
  "source": {
9
9
  "path": "button.tsx",
10
- "content": "/**\n * An interactive control for a single, immediate action — submitting a form,\n * triggering a command, opening a dialog. Its host renders as a native\n * `<button>` shaped by a semantic color role, a visual weight variant, and a\n * size, and holds its footprint while rendering a busy pending state.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { LoaderCircleIcon } from \"@sdxc/icons\";\nimport { bg, border, fg, outline } from \"@sdxc/u/color\";\nimport { opacity, rounded, visibility } from \"@sdxc/u/effects\";\nimport { cursor, userSelect } from \"@sdxc/u/general\";\nimport {\n\tabsolute,\n\tflex,\n\tgap,\n\tinlineFlex,\n\tinset,\n\titems,\n\tjustify,\n\trelative,\n\tshrink,\n} from \"@sdxc/u/layout\";\nimport { bs, is, minBs, p, pb, pi, pie, pis } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { text, weight } from \"@sdxc/u/typography\";\n\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { hitArea } from \"@sdxc/ui/styles\";\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { glyphEdges } from \"@sdxc/ui/utils\";\nimport { warnIfNoAccessibleName } from \"@sdxc/ui/utils\";\n\nconst DEFAULT_COLOR: Button.Color = \"neutral\";\n\nconst DEFAULT_VARIANT: Button.Variant = \"solid\";\n\nconst DEFAULT_SIZE: Button.Size = \"md\";\n\n/** Edge of a small icon-only button, matching the `sm` row height. */\nconst ICON_ONLY_SIZE_SM = \"var(--ui-button-icon-size-sm, 2rem)\";\n\n/** Edge of a medium icon-only button, matching the `md` row height. */\nconst ICON_ONLY_SIZE_MD = \"var(--ui-button-icon-size-md, 2.5rem)\";\n\n/** Edge of a large icon-only button, matching the `lg` row height. */\nconst ICON_ONLY_SIZE_LG = \"var(--ui-button-icon-size-lg, 3rem)\";\n\n/**\n * Native `type` given to a button carrying `command`/`commandfor` and no\n * `type` of its own: the platform treats a button that could also submit as an\n * ambiguous invoker and skips its command, so an invoker needs this type.\n */\nconst INVOKER_TYPE = \"button\";\n\n/**\n * Prop types for {@link Button}.\n */\nexport namespace Button {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` variables.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Visual weight the button renders with: a solid fill with an on-solid\n\t * foreground, a transparent fill with a strong colored border, or a fully\n\t * transparent fill with just a colored label.\n\t */\n\texport type Variant = \"solid\" | \"outline\" | \"ghost\";\n\n\t/**\n\t * Size variant controlling the button's padding and font size.\n\t */\n\texport type Size = \"sm\" | \"md\" | \"lg\";\n\n\t/**\n\t * Per-part styling for the elements a pending button renders besides its\n\t * own host.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the decorative rotating glyph shown while pending. */\n\t\tspinner?: TagProps<\"span\">[\"mix\"];\n\t\t/**\n\t\t * Styling for the wrapper holding the button's own children while\n\t\t * pending; kept in the layout to preserve the button's footprint, but\n\t\t * hidden from view and from assistive technology.\n\t\t */\n\t\tcontent?: TagProps<\"span\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link Button}.\n\t */\n\texport interface Props extends TagProps<\"button\"> {\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** Visual weight. Defaults to {@link DEFAULT_VARIANT}. */\n\t\tvariant?: Variant;\n\t\t/** Size variant. Defaults to {@link DEFAULT_SIZE}. */\n\t\tsize?: Size;\n\t\t/**\n\t\t * Marks the button busy: merges into the native `disabled` attribute and\n\t\t * swaps the visible content for a spinner glyph while holding the rendered\n\t\t * footprint, so a page mid-request keeps its layout.\n\t\t */\n\t\tisPending?: boolean;\n\t\t/** Per-part styling for the pending state's internal elements. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Reports whether `children` is a lone glyph, which is what makes a button a target for\n * that glyph rather than for a label. A selector cannot answer this: `:only-child`\n * counts elements, so a button holding text beside one icon still matches it.\n *\n * @param children The button's own children.\n * @returns Whether the button renders a single element and no text of its own.\n */\nfunction holdsOnlyAGlyph(children: RemixNode): boolean {\n\treturn typeof children === \"object\" && children !== null && !Array.isArray(children);\n}\n\n/**\n * Visual state lives in `data-color`/`data-variant`/`data-size` on the host, so\n * hover, pressed, and focus-visible stay on native pseudo-classes. `type` precedes\n * the spread so the platform sees it while parsing `command`/`commandfor`.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the button's markup.\n * @example\n * <Button type=\"submit\">{t(\"actions.save\")}</Button>\n * @example\n * <Button color=\"danger\" variant=\"outline\" size=\"sm\">{t(\"actions.delete\")}</Button>\n * @example\n * <Button type=\"submit\" isPending={isSubmitting}>{t(\"actions.save\")}</Button>\n */\nexport function Button(handle: Handle<Button.Props>) {\n\treturn () => {\n\t\tlet { color, variant, size, isPending, disabled, type, parts, children, mix, ...rest } =\n\t\t\thandle.props;\n\t\tlet isInvoker = rest.command !== undefined || rest.commandfor !== undefined;\n\t\tlet resolvedType = type ?? (isInvoker ? INVOKER_TYPE : undefined);\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\t\tlet resolvedVariant = variant ?? DEFAULT_VARIANT;\n\t\tlet resolvedSize = size ?? DEFAULT_SIZE;\n\t\tlet resolvedDisabled = disabled || isPending;\n\t\tlet iconOnly = holdsOnlyAGlyph(children);\n\t\tlet edges = glyphEdges(children);\n\n\t\twarnIfNoAccessibleName(\n\t\t\thandle.props,\n\t\t\tchildren,\n\t\t\t\"Button: an icon-only button needs an `aria-label` describing what it does — assistive technology has no accessible text to announce otherwise.\",\n\t\t);\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype={resolvedType}\n\t\t\t\t{...rest}\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\tdata-variant={resolvedVariant}\n\t\t\t\tdata-size={resolvedSize}\n\t\t\t\tdata-pending={isPending || undefined}\n\t\t\t\tdata-icon-only={iconOnly || undefined}\n\t\t\t\tdata-glyph-start={edges.start || undefined}\n\t\t\t\tdata-glyph-end={edges.end || undefined}\n\t\t\t\tdisabled={resolvedDisabled}\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:focus-visible\", [\n\t\t\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\t\t\twhen('&[data-color=\"neutral\"]', outline(\"neutral.ring\")),\n\t\t\t\t\t\twhen('&[data-color=\"success\"]', outline(\"success.ring\")),\n\t\t\t\t\t\twhen('&[data-color=\"warning\"]', outline(\"warning.ring\")),\n\t\t\t\t\t\twhen('&[data-color=\"danger\"]', outline(\"danger.ring\")),\n\t\t\t\t\t]),\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tgap(2),\n\t\t\t\t\t/**\n\t\t\t\t\t * A glyph is measured against the label it sits beside rather than against\n\t\t\t\t\t * whatever an icon set draws at, so the row keeps the height its text and\n\t\t\t\t\t * padding ask for. It never shrinks either: squeeze the row and the default\n\t\t\t\t\t * `flex-shrink: 1` compresses the glyph rather than the words, and a squashed\n\t\t\t\t\t * icon reads as a rendering fault.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"& > svg\", [shrink(), is(4), bs(4)]),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tweight(\"medium\"),\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\t/** A small control reaches `--ui-target-size` however a consumer positions it. */\n\t\t\t\t\thitArea({ anchor: \"flex-center\" }),\n\t\t\t\t\tuserSelect(),\n\n\t\t\t\t\tpi(4),\n\t\t\t\t\tpb(2),\n\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * Every variant carries the same border width, colored to match its own\n\t\t\t\t\t * fill (transparent for ghost), so solid and ghost render the exact\n\t\t\t\t\t * footprint outline does.\n\t\t\t\t\t */\n\t\t\t\t\tborder({ width: 1, noStyleDefault: true }),\n\n\t\t\t\t\t/**\n\t\t\t\t\t * The row measure is stated rather than left to fall out of the padding and\n\t\t\t\t\t * the border, so the control lines up with a field of the same size when a\n\t\t\t\t\t * Group fuses the two, and still grows when a long label wraps.\n\t\t\t\t\t */\n\t\t\t\t\tminBs(\"2.5rem\"),\n\n\t\t\t\t\twhen('&[data-size=\"sm\"]', [\n\t\t\t\t\t\tpi(3),\n\t\t\t\t\t\tpb(1.5),\n\t\t\t\t\t\ttext(\"xs\"),\n\t\t\t\t\t\tminBs(\"2rem\"),\n\t\t\t\t\t\twhen(\"& > svg\", [is(3), bs(3)]),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('&[data-size=\"lg\"]', [\n\t\t\t\t\t\tpi(5),\n\t\t\t\t\t\tpb(2.5),\n\t\t\t\t\t\ttext(\"base\"),\n\t\t\t\t\t\tminBs(\"3rem\"),\n\t\t\t\t\t\twhen(\"& > svg\", [is(5), bs(5)]),\n\t\t\t\t\t]),\n\n\t\t\t\t\t/**\n\t\t\t\t\t * A glyph beside a label carries its own side bearing, so the padding on that\n\t\t\t\t\t * side drops one step and the glyph and the words read as evenly inset.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"&[data-glyph-start]:has(> svg:first-child)\", [\n\t\t\t\t\t\tpis(3),\n\t\t\t\t\t\twhen('&[data-size=\"sm\"]', pis(2)),\n\t\t\t\t\t\twhen('&[data-size=\"lg\"]', pis(4)),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"&[data-glyph-end]:has(> svg:last-child)\", [\n\t\t\t\t\t\tpie(3),\n\t\t\t\t\t\twhen('&[data-size=\"sm\"]', pie(2)),\n\t\t\t\t\t\twhen('&[data-size=\"lg\"]', pie(4)),\n\t\t\t\t\t]),\n\n\t\t\t\t\t/**\n\t\t\t\t\t * A button holding a glyph and nothing else is a target for that glyph alone, so\n\t\t\t\t\t * it takes a round footprint as tall as the row it would otherwise fill. The\n\t\t\t\t\t * measure is a custom property per size, since a box sized by its own content on\n\t\t\t\t\t * both axes has no ratio to resolve against, and an app or a composing part can\n\t\t\t\t\t * resize it without touching the rule.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"&[data-icon-only]\", [\n\t\t\t\t\t\tp(0),\n\t\t\t\t\t\tis(ICON_ONLY_SIZE_MD),\n\t\t\t\t\t\tbs(ICON_ONLY_SIZE_MD),\n\t\t\t\t\t\tminBs(ICON_ONLY_SIZE_MD),\n\t\t\t\t\t\tshrink(),\n\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('&[data-size=\"sm\"][data-icon-only]', [\n\t\t\t\t\t\tis(ICON_ONLY_SIZE_SM),\n\t\t\t\t\t\tbs(ICON_ONLY_SIZE_SM),\n\t\t\t\t\t\tminBs(ICON_ONLY_SIZE_SM),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('&[data-size=\"lg\"][data-icon-only]', [\n\t\t\t\t\t\tis(ICON_ONLY_SIZE_LG),\n\t\t\t\t\t\tbs(ICON_ONLY_SIZE_LG),\n\t\t\t\t\t\tminBs(ICON_ONLY_SIZE_LG),\n\t\t\t\t\t]),\n\n\t\t\t\t\twhen('&[data-variant=\"solid\"]', [\n\t\t\t\t\t\twhen('&[data-color=\"brand\"]', [\n\t\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\t\tborder(\"brand.solid\"),\n\t\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"brand.bg-solid-hover\"), border(\"brand.bg-solid-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", [bg(\"brand.bg-solid-pressed\"), border(\"brand.bg-solid-pressed\")]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"neutral\"]', [\n\t\t\t\t\t\t\tbg(\"neutral.solid\"),\n\t\t\t\t\t\t\tborder(\"neutral.solid\"),\n\t\t\t\t\t\t\tfg(\"neutral.onSolid\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"neutral.bg-solid-hover\"), border(\"neutral.bg-solid-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", [\n\t\t\t\t\t\t\t\tbg(\"neutral.bg-solid-pressed\"),\n\t\t\t\t\t\t\t\tborder(\"neutral.bg-solid-pressed\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"success\"]', [\n\t\t\t\t\t\t\tbg(\"success.solid\"),\n\t\t\t\t\t\t\tborder(\"success.solid\"),\n\t\t\t\t\t\t\tfg(\"success.onSolid\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"success.bg-solid-hover\"), border(\"success.bg-solid-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", [\n\t\t\t\t\t\t\t\tbg(\"success.bg-solid-pressed\"),\n\t\t\t\t\t\t\t\tborder(\"success.bg-solid-pressed\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"warning\"]', [\n\t\t\t\t\t\t\tbg(\"warning.solid\"),\n\t\t\t\t\t\t\tborder(\"warning.solid\"),\n\t\t\t\t\t\t\tfg(\"warning.onSolid\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"warning.bg-solid-hover\"), border(\"warning.bg-solid-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", [\n\t\t\t\t\t\t\t\tbg(\"warning.bg-solid-pressed\"),\n\t\t\t\t\t\t\t\tborder(\"warning.bg-solid-pressed\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"danger\"]', [\n\t\t\t\t\t\t\tbg(\"danger.solid\"),\n\t\t\t\t\t\t\tborder(\"danger.solid\"),\n\t\t\t\t\t\t\tfg(\"danger.onSolid\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"danger.bg-solid-hover\"), border(\"danger.bg-solid-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", [bg(\"danger.bg-solid-pressed\"), border(\"danger.bg-solid-pressed\")]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\n\t\t\t\t\twhen('&[data-variant=\"outline\"]', [\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\twhen('&[data-color=\"brand\"]', [\n\t\t\t\t\t\t\tborder(\"brand\"),\n\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"brand.tint\"), border(\"brand.border-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"neutral\"]', [\n\t\t\t\t\t\t\tborder(\"neutral\"),\n\t\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"neutral.tint\"), border(\"neutral.border-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"success\"]', [\n\t\t\t\t\t\t\tborder(\"success\"),\n\t\t\t\t\t\t\tfg(\"success\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"success.tint\"), border(\"success.border-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"success.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"warning\"]', [\n\t\t\t\t\t\t\tborder(\"warning\"),\n\t\t\t\t\t\t\tfg(\"warning\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"warning.tint\"), border(\"warning.border-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"warning.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"danger\"]', [\n\t\t\t\t\t\t\tborder(\"danger\"),\n\t\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"danger.tint\"), border(\"danger.border-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"danger.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\n\t\t\t\t\twhen('&[data-variant=\"ghost\"]', [\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\tborder(\"transparent\"),\n\t\t\t\t\t\twhen('&[data-color=\"brand\"]', [\n\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", bg(\"brand.tint\")),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"neutral\"]', [\n\t\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"success\"]', [\n\t\t\t\t\t\t\tfg(\"success\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", bg(\"success.tint\")),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"success.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"warning\"]', [\n\t\t\t\t\t\t\tfg(\"warning\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", bg(\"warning.tint\")),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"warning.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"danger\"]', [\n\t\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", bg(\"danger.tint\")),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"danger.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\n\t\t\t\t\twhen(\"&:disabled:not([data-pending])\", [cursor(\"not-allowed\"), opacity(50)]),\n\n\t\t\t\t\twhen(\"&[data-pending]\", [relative(), cursor(\"wait\")]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{isPending ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\tdata-slot=\"spinner\"\n\t\t\t\t\t\t\tmix={[\n\t\t\t\t\t\t\t\tabsolute(),\n\t\t\t\t\t\t\t\tinset(0),\n\t\t\t\t\t\t\t\tflex(),\n\t\t\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\t\t\t\twhen(\"& svg\", [\n\t\t\t\t\t\t\t\t\tis(\"var(--ui-spinner-icon-size-sm, 1rem)\"),\n\t\t\t\t\t\t\t\t\tbs(\"var(--ui-spinner-icon-size-sm, 1rem)\"),\n\t\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\t\twhen('[data-size=\"lg\"] & svg', [\n\t\t\t\t\t\t\t\t\tis(\"var(--ui-spinner-icon-size-md, 1.25rem)\"),\n\t\t\t\t\t\t\t\t\tbs(\"var(--ui-spinner-icon-size-md, 1.25rem)\"),\n\t\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\t\tparts?.spinner,\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LoaderCircleIcon />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tdata-slot=\"content\"\n\t\t\t\t\t\t\tmix={[visibility(\"hidden\"), inlineFlex(), items(\"center\"), gap(2), parts?.content]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\tchildren\n\t\t\t\t)}\n\t\t\t</button>\n\t\t);\n\t};\n}\n"
10
+ "content": "/**\n * An interactive control for a single, immediate action — submitting a form,\n * triggering a command, opening a dialog. Its host renders as a native\n * `<button>` shaped by a semantic color role, a visual weight variant, and a\n * size, and holds its footprint while rendering a busy pending state.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { LoaderCircleIcon } from \"@sdxc/icons\";\nimport { bg, border, fg, outline } from \"@sdxc/u/color\";\nimport { opacity, rounded, visibility } from \"@sdxc/u/effects\";\nimport { cursor, userSelect } from \"@sdxc/u/general\";\nimport {\n\tabsolute,\n\tflex,\n\tgap,\n\tinlineFlex,\n\tinset,\n\titems,\n\tjustify,\n\trelative,\n\tshrink,\n} from \"@sdxc/u/layout\";\nimport { bs, is, minBs, p, pb, pi, pie, pis } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { text, weight } from \"@sdxc/u/typography\";\n\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { hitArea } from \"@sdxc/ui/styles\";\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { glyphEdges } from \"@sdxc/ui/utils\";\nimport { warnIfNoAccessibleName } from \"@sdxc/ui/utils\";\n\nconst DEFAULT_COLOR: Button.Color = \"neutral\";\n\nconst DEFAULT_VARIANT: Button.Variant = \"solid\";\n\nconst DEFAULT_SIZE: Button.Size = \"md\";\n\n/** Edge of a small icon-only button, matching the `sm` row height. */\nconst ICON_ONLY_SIZE_SM = \"var(--ui-button-icon-size-sm, 2rem)\";\n\n/** Edge of a medium icon-only button, matching the `md` row height. */\nconst ICON_ONLY_SIZE_MD = \"var(--ui-button-icon-size-md, 2.5rem)\";\n\n/** Edge of a large icon-only button, matching the `lg` row height. */\nconst ICON_ONLY_SIZE_LG = \"var(--ui-button-icon-size-lg, 3rem)\";\n\n/**\n * Native `type` given to a button carrying `command`/`commandfor` and no\n * `type` of its own: the platform treats a button that could also submit as an\n * ambiguous invoker and skips its command, so an invoker needs this type.\n */\nconst INVOKER_TYPE = \"button\";\n\n/**\n * Prop types for {@link Button}.\n */\nexport namespace Button {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` variables.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Visual weight the button renders with: a solid fill with an on-solid\n\t * foreground, a transparent fill with a strong colored border, or a fully\n\t * transparent fill with just a colored label.\n\t */\n\texport type Variant = \"solid\" | \"outline\" | \"ghost\";\n\n\t/**\n\t * Size variant controlling the button's padding and font size.\n\t * Marketing pairing: `\"sm\"` is ~32px for nav rows, `\"lg\"` is ~48px for\n\t * hero {@link CtaGroup} actions — keep those slots on different sizes.\n\t */\n\texport type Size = \"sm\" | \"md\" | \"lg\";\n\n\t/**\n\t * Per-part styling for the elements a pending button renders besides its\n\t * own host.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the decorative rotating glyph shown while pending. */\n\t\tspinner?: TagProps<\"span\">[\"mix\"];\n\t\t/**\n\t\t * Styling for the wrapper holding the button's own children while\n\t\t * pending; kept in the layout to preserve the button's footprint, but\n\t\t * hidden from view and from assistive technology.\n\t\t */\n\t\tcontent?: TagProps<\"span\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link Button}.\n\t */\n\texport interface Props extends TagProps<\"button\"> {\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** Visual weight. Defaults to {@link DEFAULT_VARIANT}. */\n\t\tvariant?: Variant;\n\t\t/** Size variant. Defaults to {@link DEFAULT_SIZE}. */\n\t\tsize?: Size;\n\t\t/**\n\t\t * Marks the button busy: merges into the native `disabled` attribute and\n\t\t * swaps the visible content for a spinner glyph while holding the rendered\n\t\t * footprint, so a page mid-request keeps its layout.\n\t\t */\n\t\tisPending?: boolean;\n\t\t/** Per-part styling for the pending state's internal elements. */\n\t\tparts?: PartsProps;\n\t}\n}\n\n/**\n * Reports whether `children` is a lone glyph, which is what makes a button a target for\n * that glyph rather than for a label. A selector cannot answer this: `:only-child`\n * counts elements, so a button holding text beside one icon still matches it.\n *\n * @param children The button's own children.\n * @returns Whether the button renders a single element and no text of its own.\n */\nfunction holdsOnlyAGlyph(children: RemixNode): boolean {\n\treturn typeof children === \"object\" && children !== null && !Array.isArray(children);\n}\n\n/**\n * Visual state lives in `data-color`/`data-variant`/`data-size` on the host, so\n * hover, pressed, and focus-visible stay on native pseudo-classes. `type` precedes\n * the spread so the platform sees it while parsing `command`/`commandfor`.\n *\n * @param handle Runtime handle carrying the host `<button>`'s props.\n * @returns The render function producing the button's markup.\n * @example\n * <Button type=\"submit\">{t(\"actions.save\")}</Button>\n * @example\n * <Button color=\"danger\" variant=\"outline\" size=\"sm\">{t(\"actions.delete\")}</Button>\n * @example\n * <Button type=\"submit\" isPending={isSubmitting}>{t(\"actions.save\")}</Button>\n * @example\n * <Button size=\"lg\" color=\"brand\" mix={[marketingCtaChrome()]}>{t(\"hero.cta\")}</Button>\n */\nexport function Button(handle: Handle<Button.Props>) {\n\treturn () => {\n\t\tlet { color, variant, size, isPending, disabled, type, parts, children, mix, ...rest } =\n\t\t\thandle.props;\n\t\tlet isInvoker = rest.command !== undefined || rest.commandfor !== undefined;\n\t\tlet resolvedType = type ?? (isInvoker ? INVOKER_TYPE : undefined);\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\t\tlet resolvedVariant = variant ?? DEFAULT_VARIANT;\n\t\tlet resolvedSize = size ?? DEFAULT_SIZE;\n\t\tlet resolvedDisabled = disabled || isPending;\n\t\tlet iconOnly = holdsOnlyAGlyph(children);\n\t\tlet edges = glyphEdges(children);\n\n\t\twarnIfNoAccessibleName(\n\t\t\thandle.props,\n\t\t\tchildren,\n\t\t\t\"Button: an icon-only button needs an `aria-label` describing what it does — assistive technology has no accessible text to announce otherwise.\",\n\t\t);\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype={resolvedType}\n\t\t\t\t{...rest}\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\tdata-variant={resolvedVariant}\n\t\t\t\tdata-size={resolvedSize}\n\t\t\t\tdata-pending={isPending || undefined}\n\t\t\t\tdata-icon-only={iconOnly || undefined}\n\t\t\t\tdata-glyph-start={edges.start || undefined}\n\t\t\t\tdata-glyph-end={edges.end || undefined}\n\t\t\t\tdisabled={resolvedDisabled}\n\t\t\t\tmix={[\n\t\t\t\t\twhen(\"&:focus-visible\", [\n\t\t\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\t\t\twhen('&[data-color=\"neutral\"]', outline(\"neutral.ring\")),\n\t\t\t\t\t\twhen('&[data-color=\"success\"]', outline(\"success.ring\")),\n\t\t\t\t\t\twhen('&[data-color=\"warning\"]', outline(\"warning.ring\")),\n\t\t\t\t\t\twhen('&[data-color=\"danger\"]', outline(\"danger.ring\")),\n\t\t\t\t\t]),\n\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tgap(2),\n\t\t\t\t\t/**\n\t\t\t\t\t * A glyph is measured against the label it sits beside rather than against\n\t\t\t\t\t * whatever an icon set draws at, so the row keeps the height its text and\n\t\t\t\t\t * padding ask for. It never shrinks either: squeeze the row and the default\n\t\t\t\t\t * `flex-shrink: 1` compresses the glyph rather than the words, and a squashed\n\t\t\t\t\t * icon reads as a rendering fault.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"& > svg\", [shrink(), is(4), bs(4)]),\n\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\tweight(\"medium\"),\n\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\t/** A small control reaches `--ui-target-size` however a consumer positions it. */\n\t\t\t\t\thitArea({ anchor: \"flex-center\" }),\n\t\t\t\t\tuserSelect(),\n\n\t\t\t\t\tpi(4),\n\t\t\t\t\tpb(2),\n\t\t\t\t\ttext(\"sm\"),\n\t\t\t\t\t/**\n\t\t\t\t\t * Every variant carries the same border width, colored to match its own\n\t\t\t\t\t * fill (transparent for ghost), so solid and ghost render the exact\n\t\t\t\t\t * footprint outline does.\n\t\t\t\t\t */\n\t\t\t\t\tborder({ width: 1, noStyleDefault: true }),\n\n\t\t\t\t\t/**\n\t\t\t\t\t * The row measure is stated rather than left to fall out of the padding and\n\t\t\t\t\t * the border, so the control lines up with a field of the same size when a\n\t\t\t\t\t * Group fuses the two, and still grows when a long label wraps.\n\t\t\t\t\t */\n\t\t\t\t\tminBs(\"2.5rem\"),\n\n\t\t\t\t\twhen('&[data-size=\"sm\"]', [\n\t\t\t\t\t\tpi(3),\n\t\t\t\t\t\tpb(1.5),\n\t\t\t\t\t\ttext(\"xs\"),\n\t\t\t\t\t\tminBs(\"2rem\"),\n\t\t\t\t\t\twhen(\"& > svg\", [is(3), bs(3)]),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('&[data-size=\"lg\"]', [\n\t\t\t\t\t\tpi(5),\n\t\t\t\t\t\tpb(2.5),\n\t\t\t\t\t\ttext(\"base\"),\n\t\t\t\t\t\tminBs(\"3rem\"),\n\t\t\t\t\t\twhen(\"& > svg\", [is(5), bs(5)]),\n\t\t\t\t\t]),\n\n\t\t\t\t\t/**\n\t\t\t\t\t * A glyph beside a label carries its own side bearing, so the padding on that\n\t\t\t\t\t * side drops one step and the glyph and the words read as evenly inset.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"&[data-glyph-start]:has(> svg:first-child)\", [\n\t\t\t\t\t\tpis(3),\n\t\t\t\t\t\twhen('&[data-size=\"sm\"]', pis(2)),\n\t\t\t\t\t\twhen('&[data-size=\"lg\"]', pis(4)),\n\t\t\t\t\t]),\n\t\t\t\t\twhen(\"&[data-glyph-end]:has(> svg:last-child)\", [\n\t\t\t\t\t\tpie(3),\n\t\t\t\t\t\twhen('&[data-size=\"sm\"]', pie(2)),\n\t\t\t\t\t\twhen('&[data-size=\"lg\"]', pie(4)),\n\t\t\t\t\t]),\n\n\t\t\t\t\t/**\n\t\t\t\t\t * A button holding a glyph and nothing else is a target for that glyph alone, so\n\t\t\t\t\t * it takes a round footprint as tall as the row it would otherwise fill. The\n\t\t\t\t\t * measure is a custom property per size, since a box sized by its own content on\n\t\t\t\t\t * both axes has no ratio to resolve against, and an app or a composing part can\n\t\t\t\t\t * resize it without touching the rule.\n\t\t\t\t\t */\n\t\t\t\t\twhen(\"&[data-icon-only]\", [\n\t\t\t\t\t\tp(0),\n\t\t\t\t\t\tis(ICON_ONLY_SIZE_MD),\n\t\t\t\t\t\tbs(ICON_ONLY_SIZE_MD),\n\t\t\t\t\t\tminBs(ICON_ONLY_SIZE_MD),\n\t\t\t\t\t\tshrink(),\n\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('&[data-size=\"sm\"][data-icon-only]', [\n\t\t\t\t\t\tis(ICON_ONLY_SIZE_SM),\n\t\t\t\t\t\tbs(ICON_ONLY_SIZE_SM),\n\t\t\t\t\t\tminBs(ICON_ONLY_SIZE_SM),\n\t\t\t\t\t]),\n\t\t\t\t\twhen('&[data-size=\"lg\"][data-icon-only]', [\n\t\t\t\t\t\tis(ICON_ONLY_SIZE_LG),\n\t\t\t\t\t\tbs(ICON_ONLY_SIZE_LG),\n\t\t\t\t\t\tminBs(ICON_ONLY_SIZE_LG),\n\t\t\t\t\t]),\n\n\t\t\t\t\twhen('&[data-variant=\"solid\"]', [\n\t\t\t\t\t\twhen('&[data-color=\"brand\"]', [\n\t\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\t\tborder(\"brand.solid\"),\n\t\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"brand.bg-solid-hover\"), border(\"brand.bg-solid-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", [bg(\"brand.bg-solid-pressed\"), border(\"brand.bg-solid-pressed\")]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"neutral\"]', [\n\t\t\t\t\t\t\tbg(\"neutral.solid\"),\n\t\t\t\t\t\t\tborder(\"neutral.solid\"),\n\t\t\t\t\t\t\tfg(\"neutral.onSolid\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"neutral.bg-solid-hover\"), border(\"neutral.bg-solid-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", [\n\t\t\t\t\t\t\t\tbg(\"neutral.bg-solid-pressed\"),\n\t\t\t\t\t\t\t\tborder(\"neutral.bg-solid-pressed\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"success\"]', [\n\t\t\t\t\t\t\tbg(\"success.solid\"),\n\t\t\t\t\t\t\tborder(\"success.solid\"),\n\t\t\t\t\t\t\tfg(\"success.onSolid\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"success.bg-solid-hover\"), border(\"success.bg-solid-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", [\n\t\t\t\t\t\t\t\tbg(\"success.bg-solid-pressed\"),\n\t\t\t\t\t\t\t\tborder(\"success.bg-solid-pressed\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"warning\"]', [\n\t\t\t\t\t\t\tbg(\"warning.solid\"),\n\t\t\t\t\t\t\tborder(\"warning.solid\"),\n\t\t\t\t\t\t\tfg(\"warning.onSolid\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"warning.bg-solid-hover\"), border(\"warning.bg-solid-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", [\n\t\t\t\t\t\t\t\tbg(\"warning.bg-solid-pressed\"),\n\t\t\t\t\t\t\t\tborder(\"warning.bg-solid-pressed\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"danger\"]', [\n\t\t\t\t\t\t\tbg(\"danger.solid\"),\n\t\t\t\t\t\t\tborder(\"danger.solid\"),\n\t\t\t\t\t\t\tfg(\"danger.onSolid\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"danger.bg-solid-hover\"), border(\"danger.bg-solid-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", [bg(\"danger.bg-solid-pressed\"), border(\"danger.bg-solid-pressed\")]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\n\t\t\t\t\twhen('&[data-variant=\"outline\"]', [\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\twhen('&[data-color=\"brand\"]', [\n\t\t\t\t\t\t\tborder(\"brand\"),\n\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"brand.tint\"), border(\"brand.border-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"neutral\"]', [\n\t\t\t\t\t\t\tborder(\"neutral\"),\n\t\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"neutral.tint\"), border(\"neutral.border-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"success\"]', [\n\t\t\t\t\t\t\tborder(\"success\"),\n\t\t\t\t\t\t\tfg(\"success\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"success.tint\"), border(\"success.border-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"success.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"warning\"]', [\n\t\t\t\t\t\t\tborder(\"warning\"),\n\t\t\t\t\t\t\tfg(\"warning\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"warning.tint\"), border(\"warning.border-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"warning.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"danger\"]', [\n\t\t\t\t\t\t\tborder(\"danger\"),\n\t\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", [bg(\"danger.tint\"), border(\"danger.border-hover\")]),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"danger.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\n\t\t\t\t\twhen('&[data-variant=\"ghost\"]', [\n\t\t\t\t\t\tbg(\"transparent\"),\n\t\t\t\t\t\tborder(\"transparent\"),\n\t\t\t\t\t\twhen('&[data-color=\"brand\"]', [\n\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", bg(\"brand.tint\")),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"neutral\"]', [\n\t\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"success\"]', [\n\t\t\t\t\t\t\tfg(\"success\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", bg(\"success.tint\")),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"success.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"warning\"]', [\n\t\t\t\t\t\t\tfg(\"warning\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", bg(\"warning.tint\")),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"warning.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[data-color=\"danger\"]', [\n\t\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\t\twhen(\"&:hover\", bg(\"danger.tint\")),\n\t\t\t\t\t\t\twhen(\"&:active\", bg(\"danger.bg-tint-hover\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]),\n\n\t\t\t\t\twhen(\"&:disabled:not([data-pending])\", [cursor(\"not-allowed\"), opacity(50)]),\n\n\t\t\t\t\twhen(\"&[data-pending]\", [relative(), cursor(\"wait\")]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{isPending ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\tdata-slot=\"spinner\"\n\t\t\t\t\t\t\tmix={[\n\t\t\t\t\t\t\t\tabsolute(),\n\t\t\t\t\t\t\t\tinset(0),\n\t\t\t\t\t\t\t\tflex(),\n\t\t\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\t\t\t\twhen(\"& svg\", [\n\t\t\t\t\t\t\t\t\tis(\"var(--ui-spinner-icon-size-sm, 1rem)\"),\n\t\t\t\t\t\t\t\t\tbs(\"var(--ui-spinner-icon-size-sm, 1rem)\"),\n\t\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\t\twhen('[data-size=\"lg\"] & svg', [\n\t\t\t\t\t\t\t\t\tis(\"var(--ui-spinner-icon-size-md, 1.25rem)\"),\n\t\t\t\t\t\t\t\t\tbs(\"var(--ui-spinner-icon-size-md, 1.25rem)\"),\n\t\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\t\tparts?.spinner,\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LoaderCircleIcon />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tdata-slot=\"content\"\n\t\t\t\t\t\t\tmix={[visibility(\"hidden\"), inlineFlex(), items(\"center\"), gap(2), parts?.content]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\tchildren\n\t\t\t\t)}\n\t\t\t</button>\n\t\t);\n\t};\n}\n"
11
11
  },
12
12
  "test": {
13
13
  "path": "button.test.tsx",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "card",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.10.29",
4
4
  "dependencies": [
5
5
  "heading-scope"
6
6
  ],
@@ -9,7 +9,7 @@
9
9
  ],
10
10
  "source": {
11
11
  "path": "card.tsx",
12
- "content": "/**\n * A bounded container grouping a header, body content, and footer actions\n * into one ring-edged, softly lifted panel tinted by a semantic color role.\n * The role colors border, background, and text together, so {@link Card.Title}\n * and {@link Card.Description} inherit their text color from the root through\n * ordinary CSS inheritance.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { border } from \"@sdxc/u/color\";\nimport { opacity, rounded, shadow } from \"@sdxc/u/effects\";\nimport { vars } from \"@sdxc/u/general\";\nimport { flex, flexCol, gap, items } from \"@sdxc/u/layout\";\nimport { p, pbe, pbs, pi } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { balance, fontSize, leading, pretty, tracking, weight } from \"@sdxc/u/typography\";\n\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { SHADOW_RING } from \"@sdxc/ui/styles\";\nimport { semanticColorPanel } from \"@sdxc/ui/styles\";\n\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/** Semantic color role {@link Card} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Card.Color = \"neutral\";\n\n/**\n * Prop types for {@link Card} and its compound parts.\n */\nexport namespace Card {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` border,\n\t * background, and foreground variables.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Every native `<section>` attribute, unchanged, plus the `color` role that\n\t * tints the panel.\n\t */\n\texport interface Props extends TagProps<\"section\"> {\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t}\n\n\t/** Every native `<header>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface HeaderProps extends TagProps<\"header\"> {}\n\n\t/**\n\t * Every native heading-element attribute, unchanged: the rendered tag\n\t * follows the nearest ambient heading level, falling back to `<h1>` where\n\t * nothing supplies one.\n\t */\n\texport interface TitleProps extends TagProps<\"h1\"> {}\n\n\t/** Every native `<p>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface DescriptionProps extends TagProps<\"p\"> {}\n\n\t/** Every native `<div>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface ContentProps extends TagProps<\"div\"> {}\n\n\t/** Every native `<footer>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface FooterProps extends TagProps<\"footer\"> {}\n}\n\n/**\n * The card panel: a rounded, softly lifted `<section>` tinted through the\n * `data-color` attribute contract. A neutral card draws its edge as a ring\n * shadow that takes on the tone behind it; a colored one keeps its tinted\n * border inside that ring. Compose {@link Card.Header},\n * {@link Card.Content}, and {@link Card.Footer} inside it.\n *\n * @param handle Runtime handle carrying the host `<section>`'s props.\n * @returns The render function producing the panel's markup.\n * @example\n * <Card>\n * \t<Card.Header>\n * \t\t<Card.Title>{t(\"plan.title\")}</Card.Title>\n * \t\t<Card.Description>{t(\"plan.description\")}</Card.Description>\n * \t</Card.Header>\n * \t<Card.Content>{t(\"plan.body\")}</Card.Content>\n * \t<Card.Footer>\n * \t\t<Button>{t(\"plan.upgrade\")}</Button>\n * \t</Card.Footer>\n * </Card>\n * @example\n * <Card color=\"danger\">\n * \t<Card.Header>\n * \t\t<Card.Title>{t(\"errors.billing.title\")}</Card.Title>\n * \t</Card.Header>\n * </Card>\n */\nexport function Card(handle: Handle<Card.Props>) {\n\treturn () => {\n\t\tlet { color, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\treturn (\n\t\t\t<section\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tsemanticColorPanel(),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tborder({ width: 1 }),\n\t\t\t\t\twhen('&[data-color=\"neutral\"]', border(\"transparent\")),\n\t\t\t\t\tshadow(\"sm\"),\n\t\t\t\t\tvars({ \"ui-box-shadow-ring\": SHADOW_RING }),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders the card's header slot: a `<header>` stacking its children in a\n * column with a small gap, padded on every side. Nest {@link Card.Title} and\n * {@link Card.Description} inside it.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the header slot's markup.\n * @example\n * <Card.Header>\n * \t<Card.Title>{t(\"plan.title\")}</Card.Title>\n * </Card.Header>\n */\nCard.Header = function CardHeader(handle: Handle<Card.HeaderProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <header {...rest} mix={[flex(), flexCol(), p(6, 6), gap(\"0.375rem\"), mix]} />;\n\t};\n};\n\n/**\n * The card's heading, in the native heading element matching the nearest\n * ambient heading level — `<h1>` where nothing supplies one. Its text color\n * inherits from the card root's `color` value.\n *\n * @param handle Runtime handle carrying the host heading element's props.\n * @returns The render function producing the heading's markup.\n * @example\n * <Card.Title>{t(\"plan.title\")}</Card.Title>\n */\nCard.Title = function CardTitle(handle: Handle<Card.TitleProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\t\tlet resolved = resolveHeadingLevel(handle);\n\t\tlet Tag = TAG_BY_LEVEL[resolved];\n\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\t{...rest}\n\t\t\t\tdata-heading-level={resolved}\n\t\t\t\tmix={[fontSize(\"2xl\"), leading(1), weight(\"semibold\"), tracking(\"tight\"), balance(), mix]}\n\t\t\t>\n\t\t\t\t{rest.children}\n\t\t\t</Tag>\n\t\t);\n\t};\n};\n\n/**\n * Renders the card's supporting copy inside a native `<p>`, muted to\n * seventy percent opacity so it reads as secondary to {@link Card.Title}.\n *\n * @param handle Runtime handle carrying the host `<p>`'s props.\n * @returns The render function producing the description's markup.\n * @example\n * <Card.Description>{t(\"plan.description\")}</Card.Description>\n */\nCard.Description = function CardDescription(handle: Handle<Card.DescriptionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <p {...rest} mix={[fontSize(\"sm\"), opacity(70), pretty(), mix]} />;\n\t};\n};\n\n/**\n * The card's main body slot: a `<div>` padded on its inline and block-end\n * edges, leaving its block-start edge flush against {@link Card.Header}. Its\n * prose wraps with `text-wrap: pretty`, which every paragraph inside inherits.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the body slot's markup.\n * @example\n * <Card.Content>{t(\"plan.body\")}</Card.Content>\n */\nCard.Content = function CardContent(handle: Handle<Card.ContentProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\t/**\n\t\t\t\t\t * The body leaves the gap above it to a header, and takes it back when it opens the card,\n\t\t\t\t\t * so a card of content alone still clears its own top edge.\n\t\t\t\t\t */\n\t\t\t\t\tpbs(0),\n\t\t\t\t\twhen(\"&:first-child\", pbs(6)),\n\t\t\t\t\tpbe(6),\n\t\t\t\t\tpi(6),\n\t\t\t\t\tpretty(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * The card's footer slot: a `<footer>` laying its children out in a\n * vertically centered row, padded on its inline and block-end edges so it\n * sits flush against the content above.\n *\n * @param handle Runtime handle carrying the host `<footer>`'s props.\n * @returns The render function producing the footer slot's markup.\n * @example\n * <Card.Footer>\n * \t<Button>{t(\"plan.upgrade\")}</Button>\n * </Card.Footer>\n */\nCard.Footer = function CardFooter(handle: Handle<Card.FooterProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <footer {...rest} mix={[flex(), items(\"center\"), pbs(0), pbe(6), pi(6), mix]} />;\n\t};\n};\n"
12
+ "content": "/**\n * A bounded container grouping a header, body content, and footer actions\n * into one ring-edged, softly lifted panel tinted by a semantic color role —\n * product chrome, plan tiles, settings panels. Landing claim cells stay on\n * the lighter {@link Feature} (use `variant=\"panel\"` only when the cell itself\n * is the interaction). The role colors border, background, and text together,\n * so {@link Card.Title} and {@link Card.Description} inherit their text color\n * from the root through ordinary CSS inheritance.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { border } from \"@sdxc/u/color\";\nimport { opacity, rounded, shadow } from \"@sdxc/u/effects\";\nimport { vars } from \"@sdxc/u/general\";\nimport { flex, flexCol, gap, items } from \"@sdxc/u/layout\";\nimport { p, pbe, pbs, pi } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { balance, fontSize, leading, pretty, tracking, weight } from \"@sdxc/u/typography\";\n\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { SHADOW_RING } from \"@sdxc/ui/styles\";\nimport { semanticColorPanel } from \"@sdxc/ui/styles\";\n\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/** Semantic color role {@link Card} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: Card.Color = \"neutral\";\n\n/**\n * Prop types for {@link Card} and its compound parts.\n */\nexport namespace Card {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` border,\n\t * background, and foreground variables.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Every native `<section>` attribute, unchanged, plus the `color` role that\n\t * tints the panel.\n\t */\n\texport interface Props extends TagProps<\"section\"> {\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t}\n\n\t/** Every native `<header>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface HeaderProps extends TagProps<\"header\"> {}\n\n\t/**\n\t * Every native heading-element attribute, unchanged: the rendered tag\n\t * follows the nearest ambient heading level, falling back to `<h1>` where\n\t * nothing supplies one.\n\t */\n\texport interface TitleProps extends TagProps<\"h1\"> {}\n\n\t/** Every native `<p>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface DescriptionProps extends TagProps<\"p\"> {}\n\n\t/** Every native `<div>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface ContentProps extends TagProps<\"div\"> {}\n\n\t/** Every native `<footer>` attribute, unchanged, plus the `mix` passthrough. */\n\texport interface FooterProps extends TagProps<\"footer\"> {}\n}\n\n/**\n * The card panel: a rounded, softly lifted `<section>` tinted through the\n * `data-color` attribute contract. A neutral card draws its edge as a ring\n * shadow that takes on the tone behind it; a colored one keeps its tinted\n * border inside that ring. Compose {@link Card.Header},\n * {@link Card.Content}, and {@link Card.Footer} inside it.\n *\n * @param handle Runtime handle carrying the host `<section>`'s props.\n * @returns The render function producing the panel's markup.\n * @example\n * <Card>\n * \t<Card.Header>\n * \t\t<Card.Title>{t(\"plan.title\")}</Card.Title>\n * \t\t<Card.Description>{t(\"plan.description\")}</Card.Description>\n * \t</Card.Header>\n * \t<Card.Content>{t(\"plan.body\")}</Card.Content>\n * \t<Card.Footer>\n * \t\t<Button>{t(\"plan.upgrade\")}</Button>\n * \t</Card.Footer>\n * </Card>\n * @example\n * <Card color=\"danger\">\n * \t<Card.Header>\n * \t\t<Card.Title>{t(\"errors.billing.title\")}</Card.Title>\n * \t</Card.Header>\n * </Card>\n */\nexport function Card(handle: Handle<Card.Props>) {\n\treturn () => {\n\t\tlet { color, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\n\t\treturn (\n\t\t\t<section\n\t\t\t\tdata-color={resolvedColor}\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\tsemanticColorPanel(),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tborder({ width: 1 }),\n\t\t\t\t\twhen('&[data-color=\"neutral\"]', border(\"transparent\")),\n\t\t\t\t\tshadow(\"sm\"),\n\t\t\t\t\tvars({ \"ui-box-shadow-ring\": SHADOW_RING }),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Renders the card's header slot: a `<header>` stacking its children in a\n * column with a small gap, padded on every side. Nest {@link Card.Title} and\n * {@link Card.Description} inside it.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the header slot's markup.\n * @example\n * <Card.Header>\n * \t<Card.Title>{t(\"plan.title\")}</Card.Title>\n * </Card.Header>\n */\nCard.Header = function CardHeader(handle: Handle<Card.HeaderProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <header {...rest} mix={[flex(), flexCol(), p(6, 6), gap(\"0.375rem\"), mix]} />;\n\t};\n};\n\n/**\n * The card's heading, in the native heading element matching the nearest\n * ambient heading level — `<h1>` where nothing supplies one. Its text color\n * inherits from the card root's `color` value.\n *\n * @param handle Runtime handle carrying the host heading element's props.\n * @returns The render function producing the heading's markup.\n * @example\n * <Card.Title>{t(\"plan.title\")}</Card.Title>\n */\nCard.Title = function CardTitle(handle: Handle<Card.TitleProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\t\tlet resolved = resolveHeadingLevel(handle);\n\t\tlet Tag = TAG_BY_LEVEL[resolved];\n\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\t{...rest}\n\t\t\t\tdata-heading-level={resolved}\n\t\t\t\tmix={[fontSize(\"2xl\"), leading(1), weight(\"semibold\"), tracking(\"tight\"), balance(), mix]}\n\t\t\t>\n\t\t\t\t{rest.children}\n\t\t\t</Tag>\n\t\t);\n\t};\n};\n\n/**\n * Renders the card's supporting copy inside a native `<p>`, muted to\n * seventy percent opacity so it reads as secondary to {@link Card.Title}.\n *\n * @param handle Runtime handle carrying the host `<p>`'s props.\n * @returns The render function producing the description's markup.\n * @example\n * <Card.Description>{t(\"plan.description\")}</Card.Description>\n */\nCard.Description = function CardDescription(handle: Handle<Card.DescriptionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <p {...rest} mix={[fontSize(\"sm\"), opacity(70), pretty(), mix]} />;\n\t};\n};\n\n/**\n * The card's main body slot: a `<div>` padded on its inline and block-end\n * edges, leaving its block-start edge flush against {@link Card.Header}. Its\n * prose wraps with `text-wrap: pretty`, which every paragraph inside inherits.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the body slot's markup.\n * @example\n * <Card.Content>{t(\"plan.body\")}</Card.Content>\n */\nCard.Content = function CardContent(handle: Handle<Card.ContentProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tmix={[\n\t\t\t\t\t/**\n\t\t\t\t\t * The body leaves the gap above it to a header, and takes it back when it opens the card,\n\t\t\t\t\t * so a card of content alone still clears its own top edge.\n\t\t\t\t\t */\n\t\t\t\t\tpbs(0),\n\t\t\t\t\twhen(\"&:first-child\", pbs(6)),\n\t\t\t\t\tpbe(6),\n\t\t\t\t\tpi(6),\n\t\t\t\t\tpretty(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * The card's footer slot: a `<footer>` laying its children out in a\n * vertically centered row, padded on its inline and block-end edges so it\n * sits flush against the content above.\n *\n * @param handle Runtime handle carrying the host `<footer>`'s props.\n * @returns The render function producing the footer slot's markup.\n * @example\n * <Card.Footer>\n * \t<Button>{t(\"plan.upgrade\")}</Button>\n * </Card.Footer>\n */\nCard.Footer = function CardFooter(handle: Handle<Card.FooterProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <footer {...rest} mix={[flex(), items(\"center\"), pbs(0), pbe(6), pi(6), mix]} />;\n\t};\n};\n"
13
13
  },
14
14
  "test": {
15
15
  "path": "card.test.tsx",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carousel",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.10.29",
4
4
  "dependencies": [
5
5
  "button"
6
6
  ],
@@ -9,7 +9,7 @@
9
9
  ],
10
10
  "source": {
11
11
  "path": "carousel.tsx",
12
- "content": "/**\n * A horizontally scrolling collection of slides riding native CSS scroll snap,\n * so swiping or scrolling advances between slides with no script in the\n * baseline. {@link Carousel.Viewport} is the scrolling surface,\n * {@link Carousel.Track} rows up its {@link Carousel.Slide} children, and\n * {@link Carousel.Previous}/{@link Carousel.Next} are invoker buttons a paired\n * mixin wires into working controls.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { ChevronLeftIcon, ChevronRightIcon } from \"@sdxc/icons\";\nimport { outline } from \"@sdxc/u/color\";\nimport { raw, vars } from \"@sdxc/u/general\";\nimport { flex, flexCol, gap, grow, items, justify, shrink } from \"@sdxc/u/layout\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is, minIs, pi } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { Button } from \"@sdxc/ui/button\";\n\n/** Native ARIA role applied to {@link Carousel.Viewport} unless a consumer overrides it. */\nconst DEFAULT_VIEWPORT_ROLE = \"group\";\n\n/**\n * Native tab-stop index applied to {@link Carousel.Viewport} unless a consumer\n * overrides it, so the scrollable region is reachable by keyboard even before\n * any control is wired up.\n */\nconst DEFAULT_VIEWPORT_TAB_INDEX = 0;\n\n/** Native ARIA role applied to {@link Carousel.Slide} unless a consumer overrides it. */\nconst DEFAULT_SLIDE_ROLE = \"group\";\n\n/**\n * Visual weight {@link Carousel.Previous} and {@link Carousel.Next} fall back\n * to when `variant` is omitted.\n */\nconst DEFAULT_CONTROL_VARIANT: Button.Variant = \"ghost\";\n\n/**\n * Semantic color role {@link Carousel.Previous} and {@link Carousel.Next} fall\n * back to when `color` is omitted.\n */\nconst DEFAULT_CONTROL_COLOR: Button.Color = \"neutral\";\n\n/**\n * Size variant {@link Carousel.Previous} and {@link Carousel.Next} fall back to\n * when `size` is omitted.\n */\nconst DEFAULT_CONTROL_SIZE: Button.Size = \"sm\";\n\n/** Invoker Commands verb {@link Carousel.Previous} falls back to when `command` is omitted. */\nconst DEFAULT_PREVIOUS_COMMAND = \"--ui-prev\";\n\n/** Invoker Commands verb {@link Carousel.Next} falls back to when `command` is omitted. */\nconst DEFAULT_NEXT_COMMAND = \"--ui-next\";\n\n/**\n * Prop types for {@link Carousel} and its compound parts.\n */\nexport namespace Carousel {\n\t/**\n\t * Every native `<section>` attribute, unchanged, plus the `mix`\n\t * passthrough. Override `--ui-carousel-gap`, `--ui-carousel-slide-size`, or\n\t * `--ui-carousel-padding` per instance through the inherited `style` prop.\n\t */\n\texport interface Props extends TagProps<\"section\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * Give it an `id` for the controls' `commandfor` prop to target, and pair a\n\t * `carouselControls()` mixin on it to make those controls scroll it.\n\t */\n\texport interface ViewportProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface TrackProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface SlideProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ControlsProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every {@link Button.Props} field, with `commandfor` required and `command`\n\t * narrowed to the verb the paired mixin listens for.\n\t */\n\texport interface PreviousProps extends Omit<Button.Props, \"commandfor\" | \"command\"> {\n\t\t/** `id` of the {@link Carousel.Viewport} this control scrolls back through. */\n\t\tcommandfor: string;\n\t\t/** Invoker Commands verb a `carouselControls()` mixin listens for. Defaults to `\"--ui-prev\"`. */\n\t\tcommand?: \"--ui-prev\";\n\t}\n\n\t/**\n\t * Every {@link Button.Props} field, with `commandfor` required and `command`\n\t * narrowed to the verb the paired mixin listens for.\n\t */\n\texport interface NextProps extends Omit<Button.Props, \"commandfor\" | \"command\"> {\n\t\t/** `id` of the {@link Carousel.Viewport} this control scrolls forward through. */\n\t\tcommandfor: string;\n\t\t/** Invoker Commands verb a `carouselControls()` mixin listens for. Defaults to `\"--ui-next\"`. */\n\t\tcommand?: \"--ui-next\";\n\t}\n}\n\n/**\n * The carousel root: a `<section>` stacking {@link Carousel.Viewport} and\n * {@link Carousel.Controls} in a column, declaring the `--ui-carousel-*`\n * custom properties its descendants read with per-instance defaults.\n *\n * @param handle Runtime handle carrying the host `<section>`'s props.\n * @returns The render function producing the carousel's markup.\n * @example\n * <Carousel aria-label={t(\"gallery.label\")}>\n * \t<Carousel.Viewport id=\"gallery-viewport\">\n * \t\t<Carousel.Track>\n * \t\t\t<Carousel.Slide><img src={photo.src} alt={photo.alt} /></Carousel.Slide>\n * \t\t</Carousel.Track>\n * \t</Carousel.Viewport>\n * \t<Carousel.Controls>\n * \t\t<Carousel.Previous commandfor=\"gallery-viewport\" aria-label={t(\"gallery.previous\")} />\n * \t\t<Carousel.Next commandfor=\"gallery-viewport\" aria-label={t(\"gallery.next\")} />\n * \t</Carousel.Controls>\n * </Carousel>\n */\nexport function Carousel(handle: Handle<Carousel.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<section\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"carousel\"\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tgap(3),\n\t\t\t\t\tvars({\n\t\t\t\t\t\t\"ui-carousel-gap\": \"1rem\",\n\t\t\t\t\t\t\"ui-carousel-slide-size\": \"18rem\",\n\t\t\t\t\t\t\"ui-carousel-padding\": \"0px\",\n\t\t\t\t\t}),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * A `<div>` scrolling {@link Carousel.Track} along the inline axis via logical\n * properties for correct writing direction, with mandatory scroll-snap stops;\n * scroll padding reads `--ui-carousel-padding` to clear the track's own padding.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the viewport's markup.\n * @example\n * <Carousel.Viewport id=\"gallery-viewport\">\n * \t<Carousel.Track>{slides}</Carousel.Track>\n * </Carousel.Viewport>\n */\nCarousel.Viewport = function CarouselViewport(handle: Handle<Carousel.ViewportProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"viewport\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_VIEWPORT_ROLE, tabIndex: DEFAULT_VIEWPORT_TAB_INDEX }),\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\traw({\n\t\t\t\t\t\toverflowInline: \"auto\",\n\t\t\t\t\t\toverflowBlock: \"hidden\",\n\t\t\t\t\t\tscrollBehavior: \"smooth\",\n\t\t\t\t\t\tscrollSnapType: \"inline mandatory\",\n\t\t\t\t\t\tscrollPaddingInline: \"var(--ui-carousel-padding, 0px)\",\n\t\t\t\t\t\t\"-webkit-overflow-scrolling\": \"touch\",\n\t\t\t\t\t}),\n\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", raw({ scrollBehavior: \"auto\" })),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * The carousel's slide row: a `<div>` laying its {@link Carousel.Slide}\n * children out in one inline row, gapped by `--ui-carousel-gap` and padded by\n * `--ui-carousel-padding` so the first and last slide can still center.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the track's markup.\n * @example\n * <Carousel.Track>\n * \t<Carousel.Slide>{firstSlide}</Carousel.Slide>\n * \t<Carousel.Slide>{secondSlide}</Carousel.Slide>\n * </Carousel.Track>\n */\nCarousel.Track = function CarouselTrack(handle: Handle<Carousel.TrackProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"track\"\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tgap(\"var(--ui-carousel-gap, 1rem)\"),\n\t\t\t\t\tpi(\"var(--ui-carousel-padding, 0px)\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * A single slide: a `<div>` held at `--ui-carousel-slide-size` along the\n * inline axis, snapping to its inline-start edge so the viewport settles on a\n * slide boundary.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the slide's markup.\n * @example\n * <Carousel.Slide><img src={photo.src} alt={photo.alt} /></Carousel.Slide>\n */\nCarousel.Slide = function CarouselSlide(handle: Handle<Carousel.SlideProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"slide\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_SLIDE_ROLE }),\n\t\t\t\t\tgrow(0),\n\t\t\t\t\tshrink(0),\n\t\t\t\t\t/**\n\t\t\t\t\t * The slide snaps to the viewport's start edge and leaves the scroll free to pass it:\n\t\t\t\t\t * `scroll-snap-stop: always` clamps programmatic scrolls too, so every dot would move\n\t\t\t\t\t * one slide and none would reach the slide it names.\n\t\t\t\t\t */\n\t\t\t\t\traw({\n\t\t\t\t\t\tflexBasis: \"var(--ui-carousel-slide-size, 18rem)\",\n\t\t\t\t\t\tscrollSnapAlign: \"start\",\n\t\t\t\t\t}),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * The carousel's control row: a `<div>` laying {@link Carousel.Previous} and\n * {@link Carousel.Next} out as an end-aligned, vertically centered row.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the control row's markup.\n * @example\n * <Carousel.Controls>\n * \t<Carousel.Previous commandfor=\"gallery-viewport\" aria-label={t(\"gallery.previous\")} />\n * \t<Carousel.Next commandfor=\"gallery-viewport\" aria-label={t(\"gallery.next\")} />\n * </Carousel.Controls>\n */\nCarousel.Controls = function CarouselControls(handle: Handle<Carousel.ControlsProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"controls\"\n\t\t\t\tmix={[flex(), items(\"center\"), gap(2), justify(\"end\"), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * A static control scrolling {@link Carousel.Viewport} named by `commandfor` back\n * one slide when a hydrated `carouselControls()` mixin handles `\"--ui-prev\"`; custom\n * `children` replacing the chevron still need their own `aria-label`.\n *\n * @param handle Runtime handle carrying the host button's props.\n * @returns The render function producing the control's markup.\n * @example\n * <Carousel.Previous commandfor=\"gallery-viewport\" aria-label={t(\"gallery.previous\")} />\n */\nCarousel.Previous = function CarouselPrevious(handle: Handle<Carousel.PreviousProps>) {\n\treturn () => {\n\t\tlet { variant, color, size, command, children, mix, ...rest } = handle.props;\n\t\tlet resolvedVariant = variant ?? DEFAULT_CONTROL_VARIANT;\n\t\tlet resolvedColor = color ?? DEFAULT_CONTROL_COLOR;\n\t\tlet resolvedSize = size ?? DEFAULT_CONTROL_SIZE;\n\t\tlet resolvedCommand = command ?? DEFAULT_PREVIOUS_COMMAND;\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"button\"\n\t\t\t\tvariant={resolvedVariant}\n\t\t\t\tcolor={resolvedColor}\n\t\t\t\tsize={resolvedSize}\n\t\t\t\tcommand={resolvedCommand}\n\t\t\t\tdata-slot=\"previous\"\n\t\t\t\tmix={[minIs(0), when(\"& > svg\", [is(4), bs(4)]), mix]}\n\t\t\t>\n\t\t\t\t{children ?? <ChevronLeftIcon />}\n\t\t\t</Button>\n\t\t);\n\t};\n};\n\n/**\n * A static control scrolling {@link Carousel.Viewport} named by `commandfor` forward\n * one slide when a hydrated `carouselControls()` mixin handles `\"--ui-next\"`; custom\n * `children` replacing the chevron still need their own `aria-label`.\n *\n * @param handle Runtime handle carrying the host button's props.\n * @returns The render function producing the control's markup.\n * @example\n * <Carousel.Next commandfor=\"gallery-viewport\" aria-label={t(\"gallery.next\")} />\n */\nCarousel.Next = function CarouselNext(handle: Handle<Carousel.NextProps>) {\n\treturn () => {\n\t\tlet { variant, color, size, command, children, mix, ...rest } = handle.props;\n\t\tlet resolvedVariant = variant ?? DEFAULT_CONTROL_VARIANT;\n\t\tlet resolvedColor = color ?? DEFAULT_CONTROL_COLOR;\n\t\tlet resolvedSize = size ?? DEFAULT_CONTROL_SIZE;\n\t\tlet resolvedCommand = command ?? DEFAULT_NEXT_COMMAND;\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"button\"\n\t\t\t\tvariant={resolvedVariant}\n\t\t\t\tcolor={resolvedColor}\n\t\t\t\tsize={resolvedSize}\n\t\t\t\tcommand={resolvedCommand}\n\t\t\t\tdata-slot=\"next\"\n\t\t\t\tmix={[minIs(0), when(\"& > svg\", [is(4), bs(4)]), mix]}\n\t\t\t>\n\t\t\t\t{children ?? <ChevronRightIcon />}\n\t\t\t</Button>\n\t\t);\n\t};\n};\n"
12
+ "content": "/**\n * A horizontally scrolling collection of slides riding native CSS scroll snap,\n * so swiping or scrolling advances between slides with no script in the\n * baseline. {@link Carousel.Viewport} is the scrolling surface,\n * {@link Carousel.Track} rows up its {@link Carousel.Slide} children, and\n * {@link Carousel.Previous}/{@link Carousel.Next} are invoker buttons a paired\n * mixin wires into working controls.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { ChevronLeftIcon, ChevronRightIcon } from \"@sdxc/icons\";\nimport { outline } from \"@sdxc/u/color\";\nimport { raw, vars } from \"@sdxc/u/general\";\nimport { flex, flexCol, gap, grow, items, justify, shrink } from \"@sdxc/u/layout\";\nimport { media } from \"@sdxc/u/responsive\";\nimport { bs, is, minIs, pi } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { attrs } from \"remix/component\";\n\nimport { Button } from \"@sdxc/ui/button\";\n\n/** Native ARIA role applied to {@link Carousel.Viewport} unless a consumer overrides it. */\nconst DEFAULT_VIEWPORT_ROLE = \"group\";\n\n/**\n * Native tab-stop index applied to {@link Carousel.Viewport} unless a consumer\n * overrides it, so the scrollable region is reachable by keyboard even before\n * any control is wired up.\n */\nconst DEFAULT_VIEWPORT_TAB_INDEX = 0;\n\n/** Native ARIA role applied to {@link Carousel.Slide} unless a consumer overrides it. */\nconst DEFAULT_SLIDE_ROLE = \"group\";\n\n/**\n * Visual weight {@link Carousel.Previous} and {@link Carousel.Next} fall back\n * to when `variant` is omitted.\n */\nconst DEFAULT_CONTROL_VARIANT: Button.Variant = \"ghost\";\n\n/**\n * Semantic color role {@link Carousel.Previous} and {@link Carousel.Next} fall\n * back to when `color` is omitted.\n */\nconst DEFAULT_CONTROL_COLOR: Button.Color = \"neutral\";\n\n/**\n * Size variant {@link Carousel.Previous} and {@link Carousel.Next} fall back to\n * when `size` is omitted.\n */\nconst DEFAULT_CONTROL_SIZE: Button.Size = \"sm\";\n\n/** Invoker Commands verb {@link Carousel.Previous} falls back to when `command` is omitted. */\nconst DEFAULT_PREVIOUS_COMMAND = \"--ui-prev\";\n\n/** Invoker Commands verb {@link Carousel.Next} falls back to when `command` is omitted. */\nconst DEFAULT_NEXT_COMMAND = \"--ui-next\";\n\n/**\n * Prop types for {@link Carousel} and its compound parts.\n */\nexport namespace Carousel {\n\t/**\n\t * Every native `<section>` attribute, unchanged, plus the `mix`\n\t * passthrough. Override `--ui-carousel-gap`, `--ui-carousel-slide-size`, or\n\t * `--ui-carousel-padding` per instance through the inherited `style` prop.\n\t */\n\texport interface Props extends TagProps<\"section\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t * Give it an `id` for the controls' `commandfor` prop to target, and pair a\n\t * `carouselControls()` mixin on it to make those controls scroll it.\n\t */\n\texport interface ViewportProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface TrackProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface SlideProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every native `<div>` attribute, unchanged, plus the `mix` passthrough.\n\t */\n\texport interface ControlsProps extends TagProps<\"div\"> {}\n\n\t/**\n\t * Every {@link Button.Props} field, with `commandfor` required and `command`\n\t * narrowed to the verb the paired mixin listens for.\n\t */\n\texport interface PreviousProps extends Omit<Button.Props, \"commandfor\" | \"command\"> {\n\t\t/** `id` of the {@link Carousel.Viewport} this control scrolls back through. */\n\t\tcommandfor: string;\n\t\t/** Invoker Commands verb a `carouselControls()` mixin listens for. Defaults to `\"--ui-prev\"`. */\n\t\tcommand?: \"--ui-prev\";\n\t}\n\n\t/**\n\t * Every {@link Button.Props} field, with `commandfor` required and `command`\n\t * narrowed to the verb the paired mixin listens for.\n\t */\n\texport interface NextProps extends Omit<Button.Props, \"commandfor\" | \"command\"> {\n\t\t/** `id` of the {@link Carousel.Viewport} this control scrolls forward through. */\n\t\tcommandfor: string;\n\t\t/** Invoker Commands verb a `carouselControls()` mixin listens for. Defaults to `\"--ui-next\"`. */\n\t\tcommand?: \"--ui-next\";\n\t}\n}\n\n/**\n * The carousel root: a `<section>` stacking {@link Carousel.Viewport} and\n * {@link Carousel.Controls} in a column, declaring the `--ui-carousel-*`\n * custom properties its descendants read with per-instance defaults.\n *\n * @param handle Runtime handle carrying the host `<section>`'s props.\n * @returns The render function producing the carousel's markup.\n * @example\n * <Carousel aria-label={t(\"gallery.label\")}>\n * \t<Carousel.Viewport id=\"gallery-viewport\">\n * \t\t<Carousel.Track>\n * \t\t\t<Carousel.Slide><img src={photo.src} alt={photo.alt} /></Carousel.Slide>\n * \t\t</Carousel.Track>\n * \t</Carousel.Viewport>\n * \t<Carousel.Controls>\n * \t\t<Carousel.Previous commandfor=\"gallery-viewport\" aria-label={t(\"gallery.previous\")} />\n * \t\t<Carousel.Next commandfor=\"gallery-viewport\" aria-label={t(\"gallery.next\")} />\n * \t</Carousel.Controls>\n * </Carousel>\n * @example\n * // Marketing browser-flow strip: widen `--ui-carousel-slide-size` for product\n * // frames and keep Previous/Next on `size=\"sm\"` so controls stay quiet.\n * <Carousel\n * \taria-label={t(\"flows.label\")}\n * \tstyle={{ \"--ui-carousel-slide-size\": \"28rem\" }}\n * >\n * \t<Carousel.Viewport id=\"flows\" mix={[carouselControls()]}>\n * \t\t<Carousel.Track>{slides}</Carousel.Track>\n * \t</Carousel.Viewport>\n * \t<Carousel.Controls>\n * \t\t<Carousel.Previous commandfor=\"flows\" aria-label={t(\"flows.previous\")} />\n * \t\t<Carousel.Next commandfor=\"flows\" aria-label={t(\"flows.next\")} />\n * \t</Carousel.Controls>\n * </Carousel>\n */\nexport function Carousel(handle: Handle<Carousel.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<section\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"carousel\"\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tgap(3),\n\t\t\t\t\tvars({\n\t\t\t\t\t\t\"ui-carousel-gap\": \"1rem\",\n\t\t\t\t\t\t\"ui-carousel-slide-size\": \"18rem\",\n\t\t\t\t\t\t\"ui-carousel-padding\": \"0px\",\n\t\t\t\t\t}),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * A `<div>` scrolling {@link Carousel.Track} along the inline axis via logical\n * properties for correct writing direction, with mandatory scroll-snap stops;\n * scroll padding reads `--ui-carousel-padding` to clear the track's own padding.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the viewport's markup.\n * @example\n * <Carousel.Viewport id=\"gallery-viewport\">\n * \t<Carousel.Track>{slides}</Carousel.Track>\n * </Carousel.Viewport>\n */\nCarousel.Viewport = function CarouselViewport(handle: Handle<Carousel.ViewportProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"viewport\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_VIEWPORT_ROLE, tabIndex: DEFAULT_VIEWPORT_TAB_INDEX }),\n\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\traw({\n\t\t\t\t\t\toverflowInline: \"auto\",\n\t\t\t\t\t\toverflowBlock: \"hidden\",\n\t\t\t\t\t\tscrollBehavior: \"smooth\",\n\t\t\t\t\t\tscrollSnapType: \"inline mandatory\",\n\t\t\t\t\t\tscrollPaddingInline: \"var(--ui-carousel-padding, 0px)\",\n\t\t\t\t\t\t\"-webkit-overflow-scrolling\": \"touch\",\n\t\t\t\t\t}),\n\t\t\t\t\tmedia(\"(prefers-reduced-motion: reduce)\", raw({ scrollBehavior: \"auto\" })),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * The carousel's slide row: a `<div>` laying its {@link Carousel.Slide}\n * children out in one inline row, gapped by `--ui-carousel-gap` and padded by\n * `--ui-carousel-padding` so the first and last slide can still center.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the track's markup.\n * @example\n * <Carousel.Track>\n * \t<Carousel.Slide>{firstSlide}</Carousel.Slide>\n * \t<Carousel.Slide>{secondSlide}</Carousel.Slide>\n * </Carousel.Track>\n */\nCarousel.Track = function CarouselTrack(handle: Handle<Carousel.TrackProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"track\"\n\t\t\t\tmix={[\n\t\t\t\t\tflex(),\n\t\t\t\t\tgap(\"var(--ui-carousel-gap, 1rem)\"),\n\t\t\t\t\tpi(\"var(--ui-carousel-padding, 0px)\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * A single slide: a `<div>` held at `--ui-carousel-slide-size` along the\n * inline axis, snapping to its inline-start edge so the viewport settles on a\n * slide boundary.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the slide's markup.\n * @example\n * <Carousel.Slide><img src={photo.src} alt={photo.alt} /></Carousel.Slide>\n */\nCarousel.Slide = function CarouselSlide(handle: Handle<Carousel.SlideProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"slide\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ role: DEFAULT_SLIDE_ROLE }),\n\t\t\t\t\tgrow(0),\n\t\t\t\t\tshrink(0),\n\t\t\t\t\t/**\n\t\t\t\t\t * The slide snaps to the viewport's start edge and leaves the scroll free to pass it:\n\t\t\t\t\t * `scroll-snap-stop: always` clamps programmatic scrolls too, so every dot would move\n\t\t\t\t\t * one slide and none would reach the slide it names.\n\t\t\t\t\t */\n\t\t\t\t\traw({\n\t\t\t\t\t\tflexBasis: \"var(--ui-carousel-slide-size, 18rem)\",\n\t\t\t\t\t\tscrollSnapAlign: \"start\",\n\t\t\t\t\t}),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * The carousel's control row: a `<div>` laying {@link Carousel.Previous} and\n * {@link Carousel.Next} out as an end-aligned, vertically centered row.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the control row's markup.\n * @example\n * <Carousel.Controls>\n * \t<Carousel.Previous commandfor=\"gallery-viewport\" aria-label={t(\"gallery.previous\")} />\n * \t<Carousel.Next commandfor=\"gallery-viewport\" aria-label={t(\"gallery.next\")} />\n * </Carousel.Controls>\n */\nCarousel.Controls = function CarouselControls(handle: Handle<Carousel.ControlsProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"controls\"\n\t\t\t\tmix={[flex(), items(\"center\"), gap(2), justify(\"end\"), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * A static control scrolling {@link Carousel.Viewport} named by `commandfor` back\n * one slide when a hydrated `carouselControls()` mixin handles `\"--ui-prev\"`; custom\n * `children` replacing the chevron still need their own `aria-label`.\n *\n * @param handle Runtime handle carrying the host button's props.\n * @returns The render function producing the control's markup.\n * @example\n * <Carousel.Previous commandfor=\"gallery-viewport\" aria-label={t(\"gallery.previous\")} />\n */\nCarousel.Previous = function CarouselPrevious(handle: Handle<Carousel.PreviousProps>) {\n\treturn () => {\n\t\tlet { variant, color, size, command, children, mix, ...rest } = handle.props;\n\t\tlet resolvedVariant = variant ?? DEFAULT_CONTROL_VARIANT;\n\t\tlet resolvedColor = color ?? DEFAULT_CONTROL_COLOR;\n\t\tlet resolvedSize = size ?? DEFAULT_CONTROL_SIZE;\n\t\tlet resolvedCommand = command ?? DEFAULT_PREVIOUS_COMMAND;\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"button\"\n\t\t\t\tvariant={resolvedVariant}\n\t\t\t\tcolor={resolvedColor}\n\t\t\t\tsize={resolvedSize}\n\t\t\t\tcommand={resolvedCommand}\n\t\t\t\tdata-slot=\"previous\"\n\t\t\t\tmix={[minIs(0), when(\"& > svg\", [is(4), bs(4)]), mix]}\n\t\t\t>\n\t\t\t\t{children ?? <ChevronLeftIcon />}\n\t\t\t</Button>\n\t\t);\n\t};\n};\n\n/**\n * A static control scrolling {@link Carousel.Viewport} named by `commandfor` forward\n * one slide when a hydrated `carouselControls()` mixin handles `\"--ui-next\"`; custom\n * `children` replacing the chevron still need their own `aria-label`.\n *\n * @param handle Runtime handle carrying the host button's props.\n * @returns The render function producing the control's markup.\n * @example\n * <Carousel.Next commandfor=\"gallery-viewport\" aria-label={t(\"gallery.next\")} />\n */\nCarousel.Next = function CarouselNext(handle: Handle<Carousel.NextProps>) {\n\treturn () => {\n\t\tlet { variant, color, size, command, children, mix, ...rest } = handle.props;\n\t\tlet resolvedVariant = variant ?? DEFAULT_CONTROL_VARIANT;\n\t\tlet resolvedColor = color ?? DEFAULT_CONTROL_COLOR;\n\t\tlet resolvedSize = size ?? DEFAULT_CONTROL_SIZE;\n\t\tlet resolvedCommand = command ?? DEFAULT_NEXT_COMMAND;\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\t{...rest}\n\t\t\t\ttype=\"button\"\n\t\t\t\tvariant={resolvedVariant}\n\t\t\t\tcolor={resolvedColor}\n\t\t\t\tsize={resolvedSize}\n\t\t\t\tcommand={resolvedCommand}\n\t\t\t\tdata-slot=\"next\"\n\t\t\t\tmix={[minIs(0), when(\"& > svg\", [is(4), bs(4)]), mix]}\n\t\t\t>\n\t\t\t\t{children ?? <ChevronRightIcon />}\n\t\t\t</Button>\n\t\t);\n\t};\n};\n"
13
13
  },
14
14
  "test": null
15
15
  }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "cta-group",
3
+ "changedIn": "2026.10.29",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "CtaGroup"
7
+ ],
8
+ "source": {
9
+ "path": "cta-group.tsx",
10
+ "content": "/**\n * A horizontal cluster of primary and secondary marketing actions that wraps\n * onto a second row when the container is narrow. Children are the page's own\n * {@link Button} / {@link LinkButton} instances — pair nav rows at `size=\"sm\"`\n * (~32px) with hero rows at `size=\"lg\"` (~48px).\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { flexWrap, gap, inlineFlex, items } from \"@sdxc/u/layout\";\n\n/**\n * Prop types for {@link CtaGroup}.\n */\nexport namespace CtaGroup {\n\t/**\n\t * Props accepted by {@link CtaGroup}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Action controls — typically a solid primary {@link Button} or\n\t\t * {@link LinkButton} beside an outline secondary. The group does not\n\t\t * invent buttons of its own.\n\t\t */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Lays action children in a wrapping inline-flex row with a compact gap so a\n * primary and secondary CTA read as one cluster. Radius and size stay on the\n * buttons; override `--ui-marketing-cta-radius` per brand for pill vs soft-rect\n * corners when composing marketing CTAs.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the group's markup.\n * @example\n * <CtaGroup>\n * \t<Button size=\"lg\" color=\"brand\">{t(\"hero.cta\")}</Button>\n * \t<LinkButton href={docs} size=\"lg\" variant=\"outline\">{t(\"hero.docs\")}</LinkButton>\n * </CtaGroup>\n * @example\n * <CtaGroup>\n * \t<LinkButton href={signin} size=\"sm\">{t(\"nav.signin\")}</LinkButton>\n * </CtaGroup>\n */\nexport function CtaGroup(handle: Handle<CtaGroup.Props>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"cta-group\"\n\t\t\t\tmix={[inlineFlex(), items(\"center\"), flexWrap(), gap(3), mix]}\n\t\t\t/>\n\t\t);\n\t};\n}\n"
11
+ },
12
+ "test": {
13
+ "path": "cta-group.test.tsx",
14
+ "content": "/**\n * Covers {@link CtaGroup} laying action children in a wrapping flex row.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { Button } from \"@sdxc/ui/button\";\nimport { CtaGroup } from \"@sdxc/ui/cta-group\";\nimport { LinkButton } from \"@sdxc/ui/link-button\";\n\ndescribe(\"CtaGroup\", () => {\n\ttest(\"wraps primary and secondary actions in a flex cluster\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<CtaGroup>\n\t\t\t\t<Button size=\"lg\" color=\"brand\">\n\t\t\t\t\tStart\n\t\t\t\t</Button>\n\t\t\t\t<LinkButton href=\"/docs\" size=\"lg\" variant=\"outline\">\n\t\t\t\t\tDocs\n\t\t\t\t</LinkButton>\n\t\t\t</CtaGroup>,\n\t\t);\n\n\t\texpect(html).toContain('data-slot=\"cta-group\"');\n\t\texpect(html).toContain(\"Start\");\n\t\texpect(html).toContain(\"Docs\");\n\t\texpect(html).toContain('data-size=\"lg\"');\n\t\texpect(html).toContain(\"flex-wrap: wrap\");\n\t});\n});\n"
15
+ }
16
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "empty",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.10.29",
4
4
  "dependencies": [
5
5
  "heading-scope"
6
6
  ],
@@ -9,7 +9,7 @@
9
9
  ],
10
10
  "source": {
11
11
  "path": "empty.tsx",
12
- "content": "/**\n * A placeholder for a section that currently has nothing to show — a\n * dashed-bordered panel that composes an icon, a title, a description, and\n * an action into one empty-state layout. The compound parts let a consumer\n * include only the pieces a given empty state needs.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { bg, border, colorMix, fg } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { flex, flexCol, flexWrap, gap, items, justify } from \"@sdxc/u/layout\";\nimport { bs, is, mbs, p } from \"@sdxc/u/size\";\nimport {\n\tbalance,\n\tfontSize,\n\tleading,\n\tpretty,\n\ttextAlign,\n\ttracking,\n\tweight,\n} from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { semanticColorPanel } from \"@sdxc/ui/styles\";\nimport { DEFAULT_ICON_ARIA_HIDDEN } from \"@sdxc/ui/utils\";\n\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/**\n * Default {@link Empty.Props.color}, rendering the panel in the neutral\n * tone when a consumer names no semantic color.\n */\nconst DEFAULT_COLOR = \"neutral\";\n\n/**\n * Prop types for {@link Empty} and its compound parts.\n */\nexport namespace Empty {\n\t/**\n\t * Semantic tone driving the panel's border, tint, and foreground color\n\t * through the `--ui-*` variables for that color. Every part below the\n\t * root reads its own color from the inherited `currentcolor` this sets.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Props accepted by {@link Empty}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Semantic tone of the panel. Default: `\"neutral\"`. */\n\t\tcolor?: Color;\n\t\t/** The panel's compound parts: {@link Empty.Icon}, {@link Empty.Title}, {@link Empty.Description}, {@link Empty.Action}, or any other content. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Icon}.\n\t */\n\texport interface IconProps extends TagProps<\"div\"> {\n\t\t/** Icon graphic rendered inside the icon well. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Title}. The rendered tag depends on the\n\t * nearest ambient heading level, falling back to `<h1>` where nothing\n\t * supplies one; every native heading-element attribute still applies.\n\t */\n\texport interface TitleProps extends TagProps<\"h1\"> {\n\t\t/** Heading copy for the empty state. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Description}.\n\t */\n\texport interface DescriptionProps extends TagProps<\"p\"> {\n\t\t/** Supporting copy elaborating on the empty state. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Action}.\n\t */\n\texport interface ActionProps extends TagProps<\"div\"> {\n\t\t/** Call-to-action content, typically a button or link. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders the empty-state panel: a dashed-bordered column tinted to the\n * color role in {@link Empty.Props.color}. Its compound parts inherit that\n * color through `currentcolor`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the panel's markup.\n * @example\n * <Empty>\n * \t<Empty.Icon><InboxIcon /></Empty.Icon>\n * \t<Empty.Title>{t(\"inbox.empty.title\")}</Empty.Title>\n * \t<Empty.Description>{t(\"inbox.empty.description\")}</Empty.Description>\n * \t<Empty.Action>\n * \t\t<Button>{t(\"inbox.empty.action\")}</Button>\n * \t</Empty.Action>\n * </Empty>\n * @example\n * <Empty color=\"danger\">\n * \t<Empty.Title>{t(\"errors.notFound.title\")}</Empty.Title>\n * </Empty>\n */\nexport function Empty(handle: Handle<Empty.Props>) {\n\treturn () => {\n\t\tlet { color = DEFAULT_COLOR, children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-color={color}\n\t\t\t\tdata-slot=\"empty\"\n\t\t\t\tmix={[\n\t\t\t\t\tsemanticColorPanel(),\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tgap(3),\n\t\t\t\t\trounded(\"xl\"),\n\t\t\t\t\tborder({ width: \"1px\", style: \"dashed\" }),\n\t\t\t\t\tp(8),\n\t\t\t\t\ttextAlign(\"center\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Empty.IconProps.children} as the icon well: a fully\n * rounded, tinted badge framing an icon graphic hidden from assistive\n * technology, since {@link Empty.Title}'s text already names the state.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the icon well's markup.\n */\nEmpty.Icon = function EmptyIcon(handle: Handle<Empty.IconProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"icon\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ \"aria-hidden\": DEFAULT_ICON_ARIA_HIDDEN }),\n\t\t\t\t\tflex(),\n\t\t\t\t\tbs(\"3rem\"),\n\t\t\t\t\tis(\"3rem\"),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\tborder({ width: \"1px\", style: \"solid\" }),\n\t\t\t\t\tfg(\"currentcolor\"),\n\t\t\t\t\tborder(colorMix(\"oklab\", { color: \"currentcolor\", weight: 20 }, \"transparent\")),\n\t\t\t\t\tbg(colorMix(\"oklab\", { color: \"currentcolor\", weight: 10 }, \"transparent\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Empty.TitleProps.children} as the empty state's heading,\n * in the native heading element matching its ambient `HeadingScope` depth\n * (or `<h1>` unscoped), sized as the panel's primary text regardless of level.\n *\n * @param handle Runtime handle carrying the host heading element's props.\n * @returns The render function producing the heading's markup.\n */\nEmpty.Title = function EmptyTitle(handle: Handle<Empty.TitleProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\t\tlet level = resolveHeadingLevel(handle);\n\t\tlet Tag = TAG_BY_LEVEL[level];\n\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"title\"\n\t\t\t\tmix={[\n\t\t\t\t\tweight(\"semibold\"),\n\t\t\t\t\ttracking(\"tight\"),\n\t\t\t\t\tfontSize(\"base\"),\n\t\t\t\t\tleading(\"snug\"),\n\t\t\t\t\tbalance(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Tag>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Empty.DescriptionProps.children} as the empty state's\n * supporting copy, in a native `<p>` set to seventy percent of the panel's\n * current text color so it reads as secondary to {@link Empty.Title}.\n *\n * @param handle Runtime handle carrying the host `<p>`'s props.\n * @returns The render function producing the description's markup.\n */\nEmpty.Description = function EmptyDescription(handle: Handle<Empty.DescriptionProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<p\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"description\"\n\t\t\t\tmix={[\n\t\t\t\t\tfontSize(\"sm\"),\n\t\t\t\t\tleading(\"relaxed\"),\n\t\t\t\t\tpretty(),\n\t\t\t\t\tfg(colorMix(\"oklab\", { color: \"currentcolor\", weight: 70 }, \"transparent\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</p>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Empty.ActionProps.children} as the empty state's\n * call-to-action slot: a centered, wrapping row spaced a touch below the\n * text above it, so a state offering more than one action lays them out\n * rather than running them together.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the action slot's markup.\n */\nEmpty.Action = function EmptyAction(handle: Handle<Empty.ActionProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"action\"\n\t\t\t\tmix={[\n\t\t\t\t\t/**\n\t\t\t\t\t * The slot lays out however many actions the state offers as a centered row that\n\t\t\t\t\t * wraps, since two buttons side by side outgrow a narrow panel.\n\t\t\t\t\t */\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexWrap(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tgap(2),\n\t\t\t\t\tmbs(1),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n"
12
+ "content": "/**\n * A placeholder for a product section that currently has nothing to show — a\n * dashed-bordered panel that composes an icon, a title, a description, and\n * an action into one empty-state layout. Marketing claim cells belong on\n * {@link Feature} instead; {@link Empty} stays for in-app zero-data states.\n * The compound parts let a consumer include only the pieces a given empty\n * state needs.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { bg, border, colorMix, fg } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { flex, flexCol, flexWrap, gap, items, justify } from \"@sdxc/u/layout\";\nimport { bs, is, mbs, p } from \"@sdxc/u/size\";\nimport {\n\tbalance,\n\tfontSize,\n\tleading,\n\tpretty,\n\ttextAlign,\n\ttracking,\n\tweight,\n} from \"@sdxc/u/typography\";\nimport { attrs } from \"remix/component\";\n\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { semanticColorPanel } from \"@sdxc/ui/styles\";\nimport { DEFAULT_ICON_ARIA_HIDDEN } from \"@sdxc/ui/utils\";\n\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/**\n * Default {@link Empty.Props.color}, rendering the panel in the neutral\n * tone when a consumer names no semantic color.\n */\nconst DEFAULT_COLOR = \"neutral\";\n\n/**\n * Prop types for {@link Empty} and its compound parts.\n */\nexport namespace Empty {\n\t/**\n\t * Semantic tone driving the panel's border, tint, and foreground color\n\t * through the `--ui-*` variables for that color. Every part below the\n\t * root reads its own color from the inherited `currentcolor` this sets.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Props accepted by {@link Empty}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Semantic tone of the panel. Default: `\"neutral\"`. */\n\t\tcolor?: Color;\n\t\t/** The panel's compound parts: {@link Empty.Icon}, {@link Empty.Title}, {@link Empty.Description}, {@link Empty.Action}, or any other content. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Icon}.\n\t */\n\texport interface IconProps extends TagProps<\"div\"> {\n\t\t/** Icon graphic rendered inside the icon well. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Title}. The rendered tag depends on the\n\t * nearest ambient heading level, falling back to `<h1>` where nothing\n\t * supplies one; every native heading-element attribute still applies.\n\t */\n\texport interface TitleProps extends TagProps<\"h1\"> {\n\t\t/** Heading copy for the empty state. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Description}.\n\t */\n\texport interface DescriptionProps extends TagProps<\"p\"> {\n\t\t/** Supporting copy elaborating on the empty state. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Empty.Action}.\n\t */\n\texport interface ActionProps extends TagProps<\"div\"> {\n\t\t/** Call-to-action content, typically a button or link. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders the empty-state panel: a dashed-bordered column tinted to the\n * color role in {@link Empty.Props.color}. Its compound parts inherit that\n * color through `currentcolor`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the panel's markup.\n * @example\n * <Empty>\n * \t<Empty.Icon><InboxIcon /></Empty.Icon>\n * \t<Empty.Title>{t(\"inbox.empty.title\")}</Empty.Title>\n * \t<Empty.Description>{t(\"inbox.empty.description\")}</Empty.Description>\n * \t<Empty.Action>\n * \t\t<Button>{t(\"inbox.empty.action\")}</Button>\n * \t</Empty.Action>\n * </Empty>\n * @example\n * <Empty color=\"danger\">\n * \t<Empty.Title>{t(\"errors.notFound.title\")}</Empty.Title>\n * </Empty>\n */\nexport function Empty(handle: Handle<Empty.Props>) {\n\treturn () => {\n\t\tlet { color = DEFAULT_COLOR, children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-color={color}\n\t\t\t\tdata-slot=\"empty\"\n\t\t\t\tmix={[\n\t\t\t\t\tsemanticColorPanel(),\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexCol(),\n\t\t\t\t\tis(\"full\"),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tgap(3),\n\t\t\t\t\trounded(\"xl\"),\n\t\t\t\t\tborder({ width: \"1px\", style: \"dashed\" }),\n\t\t\t\t\tp(8),\n\t\t\t\t\ttextAlign(\"center\"),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n}\n\n/**\n * Renders {@link Empty.IconProps.children} as the icon well: a fully\n * rounded, tinted badge framing an icon graphic hidden from assistive\n * technology, since {@link Empty.Title}'s text already names the state.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the icon well's markup.\n */\nEmpty.Icon = function EmptyIcon(handle: Handle<Empty.IconProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"icon\"\n\t\t\t\tmix={[\n\t\t\t\t\tattrs({ \"aria-hidden\": DEFAULT_ICON_ARIA_HIDDEN }),\n\t\t\t\t\tflex(),\n\t\t\t\t\tbs(\"3rem\"),\n\t\t\t\t\tis(\"3rem\"),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\tborder({ width: \"1px\", style: \"solid\" }),\n\t\t\t\t\tfg(\"currentcolor\"),\n\t\t\t\t\tborder(colorMix(\"oklab\", { color: \"currentcolor\", weight: 20 }, \"transparent\")),\n\t\t\t\t\tbg(colorMix(\"oklab\", { color: \"currentcolor\", weight: 10 }, \"transparent\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Empty.TitleProps.children} as the empty state's heading,\n * in the native heading element matching its ambient `HeadingScope` depth\n * (or `<h1>` unscoped), sized as the panel's primary text regardless of level.\n *\n * @param handle Runtime handle carrying the host heading element's props.\n * @returns The render function producing the heading's markup.\n */\nEmpty.Title = function EmptyTitle(handle: Handle<Empty.TitleProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\t\tlet level = resolveHeadingLevel(handle);\n\t\tlet Tag = TAG_BY_LEVEL[level];\n\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"title\"\n\t\t\t\tmix={[\n\t\t\t\t\tweight(\"semibold\"),\n\t\t\t\t\ttracking(\"tight\"),\n\t\t\t\t\tfontSize(\"base\"),\n\t\t\t\t\tleading(\"snug\"),\n\t\t\t\t\tbalance(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Tag>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Empty.DescriptionProps.children} as the empty state's\n * supporting copy, in a native `<p>` set to seventy percent of the panel's\n * current text color so it reads as secondary to {@link Empty.Title}.\n *\n * @param handle Runtime handle carrying the host `<p>`'s props.\n * @returns The render function producing the description's markup.\n */\nEmpty.Description = function EmptyDescription(handle: Handle<Empty.DescriptionProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<p\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"description\"\n\t\t\t\tmix={[\n\t\t\t\t\tfontSize(\"sm\"),\n\t\t\t\t\tleading(\"relaxed\"),\n\t\t\t\t\tpretty(),\n\t\t\t\t\tfg(colorMix(\"oklab\", { color: \"currentcolor\", weight: 70 }, \"transparent\")),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</p>\n\t\t);\n\t};\n};\n\n/**\n * Renders {@link Empty.ActionProps.children} as the empty state's\n * call-to-action slot: a centered, wrapping row spaced a touch below the\n * text above it, so a state offering more than one action lays them out\n * rather than running them together.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the action slot's markup.\n */\nEmpty.Action = function EmptyAction(handle: Handle<Empty.ActionProps>) {\n\treturn () => {\n\t\tlet { children, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"action\"\n\t\t\t\tmix={[\n\t\t\t\t\t/**\n\t\t\t\t\t * The slot lays out however many actions the state offers as a centered row that\n\t\t\t\t\t * wraps, since two buttons side by side outgrow a narrow panel.\n\t\t\t\t\t */\n\t\t\t\t\tflex(),\n\t\t\t\t\tflexWrap(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tgap(2),\n\t\t\t\t\tmbs(1),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t};\n};\n"
13
13
  },
14
14
  "test": null
15
15
  }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "feature",
3
+ "changedIn": "2026.10.29",
4
+ "dependencies": [
5
+ "heading-scope"
6
+ ],
7
+ "exports": [
8
+ "Feature"
9
+ ],
10
+ "source": {
11
+ "path": "feature.tsx",
12
+ "content": "/**\n * One marketing claim cell — icon, title, description, optional link chrome —\n * and an optional {@link Feature.Grid} that lays cells as a hairline-ruled\n * track via container queries. Default chrome stays light; pass\n * `variant=\"panel\"` only when a filled panel is the right container for the\n * interaction.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { bg, border, fg } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { raw } from \"@sdxc/u/general\";\nimport {\n\tcenter,\n\tcontainer,\n\tgap,\n\tgrid,\n\tgridTemplate,\n\thstack,\n\tinlineFlex,\n\trepeat,\n\tvstack,\n} from \"@sdxc/u/layout\";\nimport { overflow } from \"@sdxc/u/overflow\";\nimport { at } from \"@sdxc/u/responsive\";\nimport { bs, is, m, mbs, p } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { leading, pretty, text, tracking, weight } from \"@sdxc/u/typography\";\n\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/** Cell chrome {@link Feature} applies when `variant` is omitted. */\nconst DEFAULT_VARIANT: Feature.Variant = \"plain\";\n\n/** How many cells a wide {@link Feature.Grid} puts on one row. */\nconst DEFAULT_COLUMNS: Feature.Columns = 2;\n\n/**\n * Prop types for {@link Feature} and its compound parts.\n */\nexport namespace Feature {\n\t/**\n\t * Cell chrome: a light claim with no fill, or a panel when the cell itself\n\t * is the interaction surface.\n\t */\n\texport type Variant = \"plain\" | \"panel\";\n\n\t/**\n\t * How many cells a wide {@link Feature.Grid} puts on one row.\n\t */\n\texport type Columns = 2 | 3;\n\n\t/**\n\t * Props accepted by {@link Feature}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Cell chrome. Defaults to {@link DEFAULT_VARIANT}. */\n\t\tvariant?: Variant;\n\t\t/**\n\t\t * Optional destination for the claim. When set with a trailing action\n\t\t * child, the cell can surface link chrome; the href itself is left for\n\t\t * the consumer's {@link LinkButton} or anchor.\n\t\t */\n\t\thref?: string;\n\t\t/**\n\t\t * Compound parts: {@link Feature.Icon}, {@link Feature.Title},\n\t\t * {@link Feature.Description}, {@link Feature.Action}, or other content.\n\t\t */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Feature.Icon}.\n\t */\n\texport interface IconProps extends TagProps<\"span\"> {\n\t\t/** Glyph rendered inside the tinted icon well. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Feature.Title}. The rendered tag follows the\n\t * nearest ambient heading level.\n\t */\n\texport interface TitleProps extends TagProps<\"h1\"> {\n\t\t/** Title copy for the claim. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Feature.Description}.\n\t */\n\texport interface DescriptionProps extends TagProps<\"div\"> {\n\t\t/** Supporting copy for the claim. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Feature.Action}.\n\t */\n\texport interface ActionProps extends TagProps<\"div\"> {\n\t\t/** Trailing link or button chrome for the claim. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Feature.Grid}.\n\t */\n\texport interface GridProps extends TagProps<\"div\"> {\n\t\t/** Columns above the stack breakpoint. Defaults to {@link DEFAULT_COLUMNS}. */\n\t\tcolumns?: Columns;\n\t\t/** {@link Feature} cells to lay out. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders one claim cell. Compose {@link Feature.Icon}, {@link Feature.Title},\n * {@link Feature.Description}, and {@link Feature.Action} inside it.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the cell's markup.\n * @example\n * <Feature>\n * \t<Feature.Icon><ZapIcon size={18} aria-hidden=\"true\" /></Feature.Icon>\n * \t<Feature.Title>{t(\"feature.title\")}</Feature.Title>\n * \t<Feature.Description>{t(\"feature.body\")}</Feature.Description>\n * </Feature>\n */\nexport function Feature(handle: Handle<Feature.Props>) {\n\treturn () => {\n\t\tlet { href, mix, variant, ...rest } = handle.props;\n\t\tlet resolvedVariant = variant ?? DEFAULT_VARIANT;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-variant={resolvedVariant}\n\t\t\t\tdata-href={href || undefined}\n\t\t\t\tdata-slot=\"feature\"\n\t\t\t\tmix={[\n\t\t\t\t\tvstack({ gap: 4, align: \"stretch\" }),\n\t\t\t\t\tbg(),\n\t\t\t\t\tp(8, 6),\n\t\t\t\t\tat(\"md\", p(10, 10)),\n\t\t\t\t\twhen('&[data-variant=\"panel\"]', [\n\t\t\t\t\t\tbg(\"neutral.tint\"),\n\t\t\t\t\t\tborder({ color: \"neutral\", width: 1, style: \"solid\" }),\n\t\t\t\t\t\trounded(\"xl\"),\n\t\t\t\t\t]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * Tinted rounded well that holds the claim's glyph.\n *\n * @param handle Runtime handle carrying the host `<span>`'s props.\n * @returns The render function producing the icon well.\n */\nFeature.Icon = function FeatureIcon(handle: Handle<Feature.IconProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<span\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"feature-icon\"\n\t\t\t\tmix={[\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\tcenter(),\n\t\t\t\t\tis(10),\n\t\t\t\t\tbs(10),\n\t\t\t\t\trounded(\"lg\"),\n\t\t\t\t\tbg(\"brand.tint\"),\n\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\tborder({ color: \"brand\", width: 1, style: \"solid\" }),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Claim title at the ambient heading depth, sized for a feature cell.\n *\n * @param handle Runtime handle carrying the host heading's props.\n * @returns The render function producing the title.\n */\nFeature.Title = function FeatureTitle(handle: Handle<Feature.TitleProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\t\tlet resolved = resolveHeadingLevel(handle);\n\t\tlet Tag = TAG_BY_LEVEL[resolved];\n\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"feature-title\"\n\t\t\t\tdata-heading-level={resolved}\n\t\t\t\tmix={[m(0), text(\"xl\"), weight(\"medium\"), tracking(\"tight\"), fg(\"neutral.emphasis\"), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Supporting copy under the claim title.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the description.\n */\nFeature.Description = function FeatureDescription(handle: Handle<Feature.DescriptionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"feature-description\"\n\t\t\t\tmix={[vstack({ gap: 2 }), text(\"base\"), leading(\"relaxed\"), pretty(), fg(\"neutral\"), mix]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * Trailing action slot for a link or button under the claim body.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the action slot.\n */\nFeature.Action = function FeatureAction(handle: Handle<Feature.ActionProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn <div {...rest} data-slot=\"feature-action\" mix={[mbs(2), hstack({ gap: 2 }), mix]} />;\n\t};\n};\n\n/**\n * Hairline-ruled grid of {@link Feature} cells. Collapses to one column below\n * `md` on its own named container; above it, `columns` caps the row width and\n * a lone trailing cell spans the remaining tracks.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the grid.\n * @example\n * <Feature.Grid columns={3}>\n * \t<Feature>...</Feature>\n * \t<Feature>...</Feature>\n * \t<Feature>...</Feature>\n * </Feature.Grid>\n */\nFeature.Grid = function FeatureGrid(handle: Handle<Feature.GridProps>) {\n\treturn () => {\n\t\tlet { columns, mix, ...rest } = handle.props;\n\t\tlet resolvedColumns = columns ?? DEFAULT_COLUMNS;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-columns={String(resolvedColumns)}\n\t\t\t\tdata-slot=\"feature-grid\"\n\t\t\t\tmix={[\n\t\t\t\t\tcontainer(\"ui-marketing-feature-grid\"),\n\t\t\t\t\tgrid(),\n\t\t\t\t\tgap(\"1px\"),\n\t\t\t\t\trounded(\"xl\"),\n\t\t\t\t\toverflow(\"hidden\"),\n\t\t\t\t\tborder({ color: \"neutral\", width: 1, style: \"solid\" }),\n\t\t\t\t\traw({\n\t\t\t\t\t\tbackgroundColor: \"var(--ui-neutral-border)\",\n\t\t\t\t\t\ttextAlign: \"start\",\n\t\t\t\t\t}),\n\t\t\t\t\tgridTemplate({ columns: \"minmax(0, 1fr)\" }),\n\t\t\t\t\tat(\"md\", \"ui-marketing-feature-grid\", [\n\t\t\t\t\t\tgridTemplate({\n\t\t\t\t\t\t\tcolumns: repeat(resolvedColumns, \"minmax(0, 1fr)\"),\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tresolvedColumns === 2\n\t\t\t\t\t\t\t? when(\"& > :last-child:nth-child(odd)\", raw({ gridColumn: \"1 / -1\" }))\n\t\t\t\t\t\t\t: [\n\t\t\t\t\t\t\t\t\twhen(\"& > :last-child:nth-child(3n + 1)\", raw({ gridColumn: \"1 / -1\" })),\n\t\t\t\t\t\t\t\t\twhen(\"& > :last-child:nth-child(3n + 2)\", raw({ gridColumn: \"span 2\" })),\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
13
+ },
14
+ "test": {
15
+ "path": "feature.test.tsx",
16
+ "content": "/**\n * Covers {@link Feature} compound parts and {@link Feature.Grid} column\n * tracks.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { Feature } from \"@sdxc/ui/feature\";\n\ndescribe(\"Feature\", () => {\n\ttest(\"composes icon, title, description, and action parts\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Feature>\n\t\t\t\t<Feature.Icon>★</Feature.Icon>\n\t\t\t\t<Feature.Title>Fast checks</Feature.Title>\n\t\t\t\t<Feature.Description>Probe from the edge.</Feature.Description>\n\t\t\t\t<Feature.Action>\n\t\t\t\t\t<a href=\"/docs\">Read more</a>\n\t\t\t\t</Feature.Action>\n\t\t\t</Feature>,\n\t\t);\n\n\t\texpect(html).toContain('data-slot=\"feature\"');\n\t\texpect(html).toContain('data-slot=\"feature-icon\"');\n\t\texpect(html).toContain(\"Fast checks\");\n\t\texpect(html).toContain(\"Probe from the edge.\");\n\t\texpect(html).toContain(\"Read more\");\n\t});\n\n\ttest(\"lays cells in a hairline grid with column spanning for a lone last cell\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Feature.Grid columns={3}>\n\t\t\t\t<Feature>\n\t\t\t\t\t<Feature.Title>One</Feature.Title>\n\t\t\t\t</Feature>\n\t\t\t\t<Feature>\n\t\t\t\t\t<Feature.Title>Two</Feature.Title>\n\t\t\t\t</Feature>\n\t\t\t\t<Feature>\n\t\t\t\t\t<Feature.Title>Three</Feature.Title>\n\t\t\t\t</Feature>\n\t\t\t</Feature.Grid>,\n\t\t);\n\n\t\texpect(html).toContain('data-columns=\"3\"');\n\t\texpect(html).toContain(\"container: ui-marketing-feature-grid / inline-size\");\n\t\texpect(html).toContain(\"repeat(3, minmax(0, 1fr))\");\n\t\texpect(html).toContain(\"var(--ui-neutral-border)\");\n\t});\n\n\ttest(\"adds panel chrome when variant is panel\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Feature variant=\"panel\">\n\t\t\t\t<Feature.Title>Panel claim</Feature.Title>\n\t\t\t</Feature>,\n\t\t);\n\n\t\texpect(html).toContain('data-variant=\"panel\"');\n\t});\n});\n"
17
+ }
18
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heading",
3
- "changedIn": "2026.10.13",
3
+ "changedIn": "2026.10.29",
4
4
  "dependencies": [
5
5
  "heading-scope"
6
6
  ],
@@ -9,7 +9,10 @@
9
9
  ],
10
10
  "source": {
11
11
  "path": "heading.tsx",
12
- "content": "/**\n * A section title rendered inside the native heading element matching its\n * semantic depth — `<h1>` through `<h6>` — styled at one fixed emphasis size\n * regardless of which level it renders. An explicit `level` prop fixes the\n * depth outright; otherwise, the nearest ancestor `HeadingScope` supplies\n * it, and a heading with no scope wrapping it at all renders as `<h1>`.\n * Choosing a level changes only the document outline the element contributes to\n * assistive technology; its rendered size stays fixed, so nesting sections\n * correctly never requires a visual trade-off.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { fg } from \"@sdxc/u/color\";\nimport { balance, fontSize, leading, tracking, weight } from \"@sdxc/u/typography\";\n\nimport type { HeadingLevel } from \"@sdxc/ui/heading-scope\";\n\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/**\n * Prop types for {@link Heading}.\n */\nexport namespace Heading {\n\t/**\n\t * Semantic depth, from `1` (`<h1>`) through `6` (`<h6>`), mapped to the\n\t * matching native heading element.\n\t */\n\texport type Level = HeadingLevel;\n\n\t/**\n\t * Every native heading-element attribute, unchanged, plus the `mix`\n\t * passthrough and a `level` prop choosing which native element the\n\t * heading renders as.\n\t */\n\texport interface Props extends TagProps<\"h1\"> {\n\t\t/**\n\t\t * Semantic depth. Defaults to the nearest ancestor `HeadingScope`'s\n\t\t * depth, or `1` where no scope wraps this heading at all.\n\t\t */\n\t\tlevel?: Level;\n\t}\n}\n\n/**\n * Renders its children inside the native heading element matching `level`,\n * styled at one fixed emphasis size — semibold, tight-tracked, and colored for\n * emphasis, with line height collapsed for compact wrapping.\n *\n * @param handle Runtime handle carrying the host heading element's props.\n * @returns The render function producing the heading's markup.\n * @example\n * <Heading level={1}>Page title</Heading>\n * @example\n * <Heading>Section title</Heading>\n */\nexport function Heading(handle: Handle<Heading.Props>) {\n\treturn () => {\n\t\tlet { level, mix, ...rest } = handle.props;\n\t\tlet resolved = resolveHeadingLevel(handle, level);\n\t\tlet Tag = TAG_BY_LEVEL[resolved];\n\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\t{...rest}\n\t\t\t\tdata-heading-level={resolved}\n\t\t\t\tmix={[\n\t\t\t\t\tweight(\"semibold\"),\n\t\t\t\t\ttracking(\"tight\"),\n\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\tfontSize(\"lg\"),\n\t\t\t\t\tleading(\"none\"),\n\t\t\t\t\tbalance(),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n"
12
+ "content": "/**\n * A section title rendered inside the native heading element matching its\n * semantic depth — `<h1>` through `<h6>` — styled at one fixed emphasis size\n * regardless of which level it renders. An explicit `level` prop fixes the\n * depth outright; otherwise, the nearest ancestor `HeadingScope` supplies\n * it, and a heading with no scope wrapping it at all renders as `<h1>`.\n * Choosing a level changes only the document outline the element contributes to\n * assistive technology; its rendered size stays fixed, so nesting sections\n * correctly never requires a visual trade-off. Pass `size=\"display\"` or\n * `size=\"chapter\"` for marketing headlines that read the `--ui-marketing-*`\n * display tokens (light weight, tight tracking, near-1.0 leading).\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { fg } from \"@sdxc/u/color\";\nimport { balance, fontSize, leading, tracking, weight } from \"@sdxc/u/typography\";\n\nimport { displayHeading } from \"@sdxc/ui/styles\";\n\nimport type { HeadingLevel } from \"@sdxc/ui/heading-scope\";\n\nimport { resolveHeadingLevel, TAG_BY_LEVEL } from \"@sdxc/ui/heading-scope\";\n\n/** Visual size {@link Heading} applies when `size` is omitted. */\nconst DEFAULT_SIZE: Heading.Size = \"default\";\n\n/**\n * Prop types for {@link Heading}.\n */\nexport namespace Heading {\n\t/**\n\t * Semantic depth, from `1` (`<h1>`) through `6` (`<h6>`), mapped to the\n\t * matching native heading element.\n\t */\n\texport type Level = HeadingLevel;\n\n\t/**\n\t * Visual size recipe: the catalog default, a page H1 display scale, or a\n\t * section chapter (~40–48px) from the marketing tokens.\n\t */\n\texport type Size = \"default\" | \"display\" | \"chapter\";\n\n\t/**\n\t * Every native heading-element attribute, unchanged, plus the `mix`\n\t * passthrough and a `level` prop choosing which native element the\n\t * heading renders as.\n\t */\n\texport interface Props extends TagProps<\"h1\"> {\n\t\t/**\n\t\t * Semantic depth. Defaults to the nearest ancestor `HeadingScope`'s\n\t\t * depth, or `1` where no scope wraps this heading at all.\n\t\t */\n\t\tlevel?: Level;\n\t\t/**\n\t\t * Visual size recipe. Defaults to {@link DEFAULT_SIZE}. Marketing\n\t\t * pages reach for `\"display\"` (H1) or `\"chapter\"` (section H2); app\n\t\t * chrome keeps `\"default\"`.\n\t\t */\n\t\tsize?: Size;\n\t}\n}\n\n/**\n * Renders its children inside the native heading element matching `level`.\n * The default size is semibold, tight-tracked emphasis at `lg`; `\"display\"`\n * and `\"chapter\"` swap in {@link displayHeading} so large marketing titles\n * stay light-weighted.\n *\n * @param handle Runtime handle carrying the host heading element's props.\n * @returns The render function producing the heading's markup.\n * @example\n * <Heading level={1}>Page title</Heading>\n * @example\n * <Heading>Section title</Heading>\n * @example\n * <Heading size=\"chapter\">{t(\"section.title\")}</Heading>\n */\nexport function Heading(handle: Handle<Heading.Props>) {\n\treturn () => {\n\t\tlet { level, mix, size, ...rest } = handle.props;\n\t\tlet resolved = resolveHeadingLevel(handle, level);\n\t\tlet resolvedSize = size ?? DEFAULT_SIZE;\n\t\tlet Tag = TAG_BY_LEVEL[resolved];\n\t\tlet isMarketing = resolvedSize === \"display\" || resolvedSize === \"chapter\";\n\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\t{...rest}\n\t\t\t\tdata-heading-level={resolved}\n\t\t\t\tdata-size={resolvedSize}\n\t\t\t\tmix={[\n\t\t\t\t\tresolvedSize === \"display\" ? displayHeading(1) : [],\n\t\t\t\t\tresolvedSize === \"chapter\" ? displayHeading(2) : [],\n\t\t\t\t\tisMarketing\n\t\t\t\t\t\t? []\n\t\t\t\t\t\t: [\n\t\t\t\t\t\t\t\tweight(\"semibold\"),\n\t\t\t\t\t\t\t\ttracking(\"tight\"),\n\t\t\t\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t\t\t\tfontSize(\"lg\"),\n\t\t\t\t\t\t\t\tleading(\"none\"),\n\t\t\t\t\t\t\t\tbalance(),\n\t\t\t\t\t\t\t],\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n"
13
13
  },
14
- "test": null
14
+ "test": {
15
+ "path": "heading.test.tsx",
16
+ "content": "/**\n * Covers {@link Heading} default and marketing display size recipes.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { Heading } from \"@sdxc/ui/heading\";\n\ndescribe(\"Heading\", () => {\n\ttest(\"keeps the default catalog size\", async () => {\n\t\tlet html = await renderToString(<Heading level={2}>Section</Heading>);\n\n\t\texpect(html).toContain(\"<h2\");\n\t\texpect(html).toContain('data-size=\"default\"');\n\t\texpect(html).toContain(\"font-weight: 600\");\n\t});\n\n\ttest(\"applies display and chapter marketing recipes\", async () => {\n\t\tlet display = await renderToString(<Heading size=\"display\">Hero</Heading>);\n\t\tlet chapter = await renderToString(\n\t\t\t<Heading size=\"chapter\" level={2}>\n\t\t\t\tChapter\n\t\t\t</Heading>,\n\t\t);\n\n\t\texpect(display).toContain('data-size=\"display\"');\n\t\texpect(display).toContain(\"var(--ui-marketing-display-weight\");\n\t\texpect(chapter).toContain('data-size=\"chapter\"');\n\t\texpect(chapter).toContain(\"var(--ui-marketing-chapter-size\");\n\t});\n});\n"
17
+ }
15
18
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "link-button",
3
- "changedIn": "2026.10.24",
3
+ "changedIn": "2026.10.29",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "LinkButton"
7
7
  ],
8
8
  "source": {
9
9
  "path": "link-button.tsx",
10
- "content": "/**\n * A navigation action styled to read as a button rather than inline text —\n * \"View project\", \"Download\", a dialog's \"Cancel\" that also navigates away.\n * Its host renders as a native `<a>`, sharing {@link Button}'s semantic\n * color role, visual weight variant, and size so a link and a button placed\n * side by side render pixel-identical.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, border, fg, outline } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, pointerEvents, userSelect } from \"@sdxc/u/general\";\nimport { gap, inlineFlex, items, justify, shrink } from \"@sdxc/u/layout\";\nimport { bs, is, minBs, pb, pi, pie, pis } from \"@sdxc/u/size\";\nimport { active, data, hover, when } from \"@sdxc/u/state\";\nimport { text, weight } from \"@sdxc/u/typography\";\n\nimport type { LinkPrefetch } from \"@sdxc/ui/utils\";\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { hitArea } from \"@sdxc/ui/styles\";\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { glyphEdges } from \"@sdxc/ui/utils\";\nimport { prefetchAttribute, rendersPrefetchHint } from \"@sdxc/ui/utils\";\n\n/** Semantic color role {@link LinkButton} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: LinkButton.Color = \"neutral\";\n\n/** Visual weight {@link LinkButton} falls back to when `variant` is omitted. */\nconst DEFAULT_VARIANT: LinkButton.Variant = \"solid\";\n\n/** Size variant {@link LinkButton} falls back to when `size` is omitted. */\nconst DEFAULT_SIZE: LinkButton.Size = \"md\";\n\n/** Prefetch mode {@link LinkButton} falls back to when `prefetch` is omitted. */\nconst DEFAULT_PREFETCH: LinkButton.Prefetch = \"none\";\n\n/**\n * Prop types for {@link LinkButton}.\n */\nexport namespace LinkButton {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` variables.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Visual weight the link renders with: a solid fill with an on-solid\n\t * foreground, a transparent fill with a strong colored border, or a fully\n\t * transparent fill with just a colored label.\n\t */\n\texport type Variant = \"solid\" | \"outline\" | \"ghost\";\n\n\t/**\n\t * Size variant controlling the link's padding and font size.\n\t */\n\texport type Size = \"sm\" | \"md\" | \"lg\";\n\n\t/**\n\t * When the destination starts loading: on intent, once in the viewport, on\n\t * render through a `<link rel=\"prefetch\">` that also serves full-document\n\t * navigations, or only on navigation (`\"none\"`).\n\t */\n\texport type Prefetch = LinkPrefetch;\n\n\t/**\n\t * Props accepted by {@link LinkButton}. A type alias rather than an\n\t * interface, since the native anchor props resolve to an intersection\n\t * type that TypeScript can't use in an `extends` clause.\n\t */\n\texport type Props = TagProps<\"a\"> & {\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** Visual weight. Defaults to {@link DEFAULT_VARIANT}. */\n\t\tvariant?: Variant;\n\t\t/** Size variant. Defaults to {@link DEFAULT_SIZE}. */\n\t\tsize?: Size;\n\t\t/**\n\t\t * Prefetch mode, for links whose GET is safe to repeat. `\"render\"` suits\n\t\t * multi-page navigations; a list keeps it to its first few items, since each\n\t\t * hint is a request on page load. Defaults to {@link DEFAULT_PREFETCH}.\n\t\t */\n\t\tprefetch?: Prefetch;\n\t};\n}\n\n/**\n * Renders a native `<a>` host, colored and shaped through the same color,\n * variant, and size data attributes as {@link Button}. `aria-disabled=\"true\"`\n * keeps it focusable while dimmed, so drop `href` too for full inertness.\n *\n * @param handle Runtime handle carrying the host `<a>`'s props.\n * @returns The render function producing the link's markup.\n * @example\n * <LinkButton href=\"/projects/new\" prefetch=\"intent\">{t(\"actions.createProject\")}</LinkButton>\n * @example\n * <LinkButton href=\"/projects\" color=\"neutral\" variant=\"outline\" size=\"sm\">{t(\"actions.cancel\")}</LinkButton>\n * @example\n * <LinkButton href=\"/export/report.csv\" download aria-disabled={!hasReport || undefined}>{t(\"actions.download\")}</LinkButton>\n */\nexport function LinkButton(handle: Handle<LinkButton.Props>) {\n\treturn () => {\n\t\tlet { color, variant, size, prefetch, children, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\t\tlet resolvedVariant = variant ?? DEFAULT_VARIANT;\n\t\tlet resolvedSize = size ?? DEFAULT_SIZE;\n\t\tlet resolvedPrefetch = prefetch ?? DEFAULT_PREFETCH;\n\t\tlet edges = glyphEdges(children);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<a\n\t\t\t\t\t{...rest}\n\t\t\t\t\tdata-color={resolvedColor}\n\t\t\t\t\tdata-variant={resolvedVariant}\n\t\t\t\t\tdata-size={resolvedSize}\n\t\t\t\t\tdata-rmx-prefetch={prefetchAttribute(resolvedPrefetch)}\n\t\t\t\t\tdata-glyph-start={edges.start || undefined}\n\t\t\t\t\tdata-glyph-end={edges.end || undefined}\n\t\t\t\t\tmix={[\n\t\t\t\t\t\twhen(\"&:focus-visible\", [\n\t\t\t\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\t\t\t\tdata(\"color\", \"neutral\", outline(\"neutral.ring\")),\n\t\t\t\t\t\t\tdata(\"color\", \"success\", outline(\"success.ring\")),\n\t\t\t\t\t\t\tdata(\"color\", \"warning\", outline(\"warning.ring\")),\n\t\t\t\t\t\t\tdata(\"color\", \"danger\", outline(\"danger.ring\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\t\tinlineFlex(),\n\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\t\tgap(2),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * A glyph inside a link button is measured and held at size by the same rules\n\t\t\t\t\t\t * `Button` states, for the same reasons: it is sized against the label beside\n\t\t\t\t\t\t * it so the row keeps the height its text and padding ask for, and it never\n\t\t\t\t\t\t * shrinks, since the default `flex-shrink: 1` would compress the glyph rather\n\t\t\t\t\t\t * than the words and a squashed icon reads as a rendering fault.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(\"& > svg\", [shrink(), is(4), bs(4)]),\n\t\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\t\tweight(\"medium\"),\n\t\t\t\t\t\t/** A small control reaches `--ui-target-size` however a consumer positions it. */\n\t\t\t\t\t\thitArea({ anchor: \"flex-center\" }),\n\t\t\t\t\t\tpi(4),\n\t\t\t\t\t\tpb(2),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Every variant carries the same border width, colored to match its\n\t\t\t\t\t\t * own fill (transparent for ghost), so solid, outline, and ghost\n\t\t\t\t\t\t * render at the same footprint.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tborder({ width: 1 }),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The row measure is stated, so the control lines up with a field of the same size when\n\t\t\t\t\t\t * a Group fuses the two, and still grows when a long label wraps.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tminBs(\"2.5rem\"),\n\n\t\t\t\t\t\tdata(\"size\", \"sm\", [pi(3), pb(1.5), minBs(\"2rem\"), when(\"& > svg\", [is(3), bs(3)])]),\n\t\t\t\t\t\tdata(\"size\", \"lg\", [\n\t\t\t\t\t\t\tpi(5),\n\t\t\t\t\t\t\tpb(2.5),\n\t\t\t\t\t\t\ttext(\"base\"),\n\t\t\t\t\t\t\tminBs(\"3rem\"),\n\t\t\t\t\t\t\twhen(\"& > svg\", [is(5), bs(5)]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * A glyph beside a label carries its own side bearing, so the padding on that\n\t\t\t\t\t\t * side drops one step and the glyph and the words read as evenly inset.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(\"&[data-glyph-start]:has(> svg:first-child)\", [\n\t\t\t\t\t\t\tpis(3),\n\t\t\t\t\t\t\tdata(\"size\", \"sm\", pis(2)),\n\t\t\t\t\t\t\tdata(\"size\", \"lg\", pis(4)),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen(\"&[data-glyph-end]:has(> svg:last-child)\", [\n\t\t\t\t\t\t\tpie(3),\n\t\t\t\t\t\t\tdata(\"size\", \"sm\", pie(2)),\n\t\t\t\t\t\t\tdata(\"size\", \"lg\", pie(4)),\n\t\t\t\t\t\t]),\n\n\t\t\t\t\t\tdata(\"variant\", \"solid\", [\n\t\t\t\t\t\t\tdata(\"color\", \"brand\", [\n\t\t\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\t\t\tborder(\"brand.solid\"),\n\t\t\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\t\t\thover([bg(\"brand.bg-solid-hover\"), border(\"brand.bg-solid-hover\")]),\n\t\t\t\t\t\t\t\tactive([bg(\"brand.bg-solid-pressed\"), border(\"brand.bg-solid-pressed\")]),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"neutral\", [\n\t\t\t\t\t\t\t\tbg(\"neutral.solid\"),\n\t\t\t\t\t\t\t\tborder(\"neutral.solid\"),\n\t\t\t\t\t\t\t\tfg(\"neutral.onSolid\"),\n\t\t\t\t\t\t\t\thover([bg(\"neutral.bg-solid-hover\"), border(\"neutral.bg-solid-hover\")]),\n\t\t\t\t\t\t\t\tactive([bg(\"neutral.bg-solid-pressed\"), border(\"neutral.bg-solid-pressed\")]),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"success\", [\n\t\t\t\t\t\t\t\tbg(\"success.solid\"),\n\t\t\t\t\t\t\t\tborder(\"success.solid\"),\n\t\t\t\t\t\t\t\tfg(\"success.onSolid\"),\n\t\t\t\t\t\t\t\thover([bg(\"success.bg-solid-hover\"), border(\"success.bg-solid-hover\")]),\n\t\t\t\t\t\t\t\tactive([bg(\"success.bg-solid-pressed\"), border(\"success.bg-solid-pressed\")]),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"warning\", [\n\t\t\t\t\t\t\t\tbg(\"warning.solid\"),\n\t\t\t\t\t\t\t\tborder(\"warning.solid\"),\n\t\t\t\t\t\t\t\tfg(\"warning.onSolid\"),\n\t\t\t\t\t\t\t\thover([bg(\"warning.bg-solid-hover\"), border(\"warning.bg-solid-hover\")]),\n\t\t\t\t\t\t\t\tactive([bg(\"warning.bg-solid-pressed\"), border(\"warning.bg-solid-pressed\")]),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"danger\", [\n\t\t\t\t\t\t\t\tbg(\"danger.solid\"),\n\t\t\t\t\t\t\t\tborder(\"danger.solid\"),\n\t\t\t\t\t\t\t\tfg(\"danger.onSolid\"),\n\t\t\t\t\t\t\t\thover([bg(\"danger.bg-solid-hover\"), border(\"danger.bg-solid-hover\")]),\n\t\t\t\t\t\t\t\tactive([bg(\"danger.bg-solid-pressed\"), border(\"danger.bg-solid-pressed\")]),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\n\t\t\t\t\t\tdata(\"variant\", \"outline\", [\n\t\t\t\t\t\t\tdata(\"color\", \"brand\", [\n\t\t\t\t\t\t\t\tborder(\"brand\"),\n\t\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\t\thover([bg(\"brand.tint\"), border(\"brand.border-hover\")]),\n\t\t\t\t\t\t\t\tactive(bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"neutral\", [\n\t\t\t\t\t\t\t\tborder(\"neutral\"),\n\t\t\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\t\t\thover([bg(\"neutral.tint\"), border(\"neutral.border-hover\")]),\n\t\t\t\t\t\t\t\tactive(bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"success\", [\n\t\t\t\t\t\t\t\tborder(\"success\"),\n\t\t\t\t\t\t\t\tfg(\"success\"),\n\t\t\t\t\t\t\t\thover([bg(\"success.tint\"), border(\"success.border-hover\")]),\n\t\t\t\t\t\t\t\tactive(bg(\"success.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"warning\", [\n\t\t\t\t\t\t\t\tborder(\"warning\"),\n\t\t\t\t\t\t\t\tfg(\"warning\"),\n\t\t\t\t\t\t\t\thover([bg(\"warning.tint\"), border(\"warning.border-hover\")]),\n\t\t\t\t\t\t\t\tactive(bg(\"warning.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"danger\", [\n\t\t\t\t\t\t\t\tborder(\"danger\"),\n\t\t\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\t\t\thover([bg(\"danger.tint\"), border(\"danger.border-hover\")]),\n\t\t\t\t\t\t\t\tactive(bg(\"danger.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"variant\", \"outline\", bg(\"transparent\")),\n\n\t\t\t\t\t\tdata(\"variant\", \"ghost\", [\n\t\t\t\t\t\t\tdata(\"color\", \"brand\", [\n\t\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\t\thover(bg(\"brand.tint\")),\n\t\t\t\t\t\t\t\tactive(bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"neutral\", [\n\t\t\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\t\t\thover(bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\t\t\tactive(bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"success\", [\n\t\t\t\t\t\t\t\tfg(\"success\"),\n\t\t\t\t\t\t\t\thover(bg(\"success.tint\")),\n\t\t\t\t\t\t\t\tactive(bg(\"success.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"warning\", [\n\t\t\t\t\t\t\t\tfg(\"warning\"),\n\t\t\t\t\t\t\t\thover(bg(\"warning.tint\")),\n\t\t\t\t\t\t\t\tactive(bg(\"warning.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"danger\", [\n\t\t\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\t\t\thover(bg(\"danger.tint\")),\n\t\t\t\t\t\t\t\tactive(bg(\"danger.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"variant\", \"ghost\", [bg(\"transparent\"), border(\"transparent\")]),\n\n\t\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(50)),\n\t\t\t\t\t\twhen('&[aria-disabled=\"true\"]', [cursor(\"not-allowed\"), pointerEvents()]),\n\n\t\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\t\tuserSelect(),\n\n\t\t\t\t\t\ttext(\"sm\"),\n\n\t\t\t\t\t\tdata(\"size\", \"sm\", text(\"xs\")),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</a>\n\t\t\t\t{rendersPrefetchHint(resolvedPrefetch, rest.href) && (\n\t\t\t\t\t<link rel=\"prefetch\" href={rest.href} />\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t};\n}\n"
10
+ "content": "/**\n * A navigation action styled to read as a button rather than inline text —\n * \"View project\", \"Download\", a dialog's \"Cancel\" that also navigates away.\n * Its host renders as a native `<a>`, sharing {@link Button}'s semantic\n * color role, visual weight variant, and size so a link and a button placed\n * side by side render pixel-identical.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { bg, border, fg, outline } from \"@sdxc/u/color\";\nimport { opacity, rounded } from \"@sdxc/u/effects\";\nimport { cursor, pointerEvents, userSelect } from \"@sdxc/u/general\";\nimport { gap, inlineFlex, items, justify, shrink } from \"@sdxc/u/layout\";\nimport { bs, is, minBs, pb, pi, pie, pis } from \"@sdxc/u/size\";\nimport { active, data, hover, when } from \"@sdxc/u/state\";\nimport { text, weight } from \"@sdxc/u/typography\";\n\nimport type { LinkPrefetch } from \"@sdxc/ui/utils\";\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { hitArea } from \"@sdxc/ui/styles\";\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { glyphEdges } from \"@sdxc/ui/utils\";\nimport { prefetchAttribute, rendersPrefetchHint } from \"@sdxc/ui/utils\";\n\n/** Semantic color role {@link LinkButton} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: LinkButton.Color = \"neutral\";\n\n/** Visual weight {@link LinkButton} falls back to when `variant` is omitted. */\nconst DEFAULT_VARIANT: LinkButton.Variant = \"solid\";\n\n/** Size variant {@link LinkButton} falls back to when `size` is omitted. */\nconst DEFAULT_SIZE: LinkButton.Size = \"md\";\n\n/** Prefetch mode {@link LinkButton} falls back to when `prefetch` is omitted. */\nconst DEFAULT_PREFETCH: LinkButton.Prefetch = \"none\";\n\n/**\n * Prop types for {@link LinkButton}.\n */\nexport namespace LinkButton {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` variables.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * Visual weight the link renders with: a solid fill with an on-solid\n\t * foreground, a transparent fill with a strong colored border, or a fully\n\t * transparent fill with just a colored label.\n\t */\n\texport type Variant = \"solid\" | \"outline\" | \"ghost\";\n\n\t/**\n\t * Size variant controlling the link's padding and font size.\n\t * Marketing pairing: `\"sm\"` is ~32px for nav rows, `\"lg\"` is ~48px for\n\t * hero {@link CtaGroup} actions — keep those slots on different sizes.\n\t */\n\texport type Size = \"sm\" | \"md\" | \"lg\";\n\n\t/**\n\t * When the destination starts loading: on intent, once in the viewport, on\n\t * render through a `<link rel=\"prefetch\">` that also serves full-document\n\t * navigations, or only on navigation (`\"none\"`).\n\t */\n\texport type Prefetch = LinkPrefetch;\n\n\t/**\n\t * Props accepted by {@link LinkButton}. A type alias rather than an\n\t * interface, since the native anchor props resolve to an intersection\n\t * type that TypeScript can't use in an `extends` clause.\n\t */\n\texport type Props = TagProps<\"a\"> & {\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/** Visual weight. Defaults to {@link DEFAULT_VARIANT}. */\n\t\tvariant?: Variant;\n\t\t/** Size variant. Defaults to {@link DEFAULT_SIZE}. */\n\t\tsize?: Size;\n\t\t/**\n\t\t * Prefetch mode, for links whose GET is safe to repeat. `\"render\"` suits\n\t\t * multi-page navigations; a list keeps it to its first few items, since each\n\t\t * hint is a request on page load. Defaults to {@link DEFAULT_PREFETCH}.\n\t\t */\n\t\tprefetch?: Prefetch;\n\t};\n}\n\n/**\n * Renders a native `<a>` host, colored and shaped through the same color,\n * variant, and size data attributes as {@link Button}. `aria-disabled=\"true\"`\n * keeps it focusable while dimmed, so drop `href` too for full inertness.\n *\n * @param handle Runtime handle carrying the host `<a>`'s props.\n * @returns The render function producing the link's markup.\n * @example\n * <LinkButton href=\"/projects/new\" prefetch=\"intent\">{t(\"actions.createProject\")}</LinkButton>\n * @example\n * <LinkButton href=\"/projects\" color=\"neutral\" variant=\"outline\" size=\"sm\">{t(\"actions.cancel\")}</LinkButton>\n * @example\n * <LinkButton href=\"/export/report.csv\" download aria-disabled={!hasReport || undefined}>{t(\"actions.download\")}</LinkButton>\n */\nexport function LinkButton(handle: Handle<LinkButton.Props>) {\n\treturn () => {\n\t\tlet { color, variant, size, prefetch, children, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\t\tlet resolvedVariant = variant ?? DEFAULT_VARIANT;\n\t\tlet resolvedSize = size ?? DEFAULT_SIZE;\n\t\tlet resolvedPrefetch = prefetch ?? DEFAULT_PREFETCH;\n\t\tlet edges = glyphEdges(children);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<a\n\t\t\t\t\t{...rest}\n\t\t\t\t\tdata-color={resolvedColor}\n\t\t\t\t\tdata-variant={resolvedVariant}\n\t\t\t\t\tdata-size={resolvedSize}\n\t\t\t\t\tdata-rmx-prefetch={prefetchAttribute(resolvedPrefetch)}\n\t\t\t\t\tdata-glyph-start={edges.start || undefined}\n\t\t\t\t\tdata-glyph-end={edges.end || undefined}\n\t\t\t\t\tmix={[\n\t\t\t\t\t\twhen(\"&:focus-visible\", [\n\t\t\t\t\t\t\toutline({ color: \"brand.ring\", offset: 2 }),\n\t\t\t\t\t\t\tdata(\"color\", \"neutral\", outline(\"neutral.ring\")),\n\t\t\t\t\t\t\tdata(\"color\", \"success\", outline(\"success.ring\")),\n\t\t\t\t\t\t\tdata(\"color\", \"warning\", outline(\"warning.ring\")),\n\t\t\t\t\t\t\tdata(\"color\", \"danger\", outline(\"danger.ring\")),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\t\tinlineFlex(),\n\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\t\tgap(2),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * A glyph inside a link button is measured and held at size by the same rules\n\t\t\t\t\t\t * `Button` states, for the same reasons: it is sized against the label beside\n\t\t\t\t\t\t * it so the row keeps the height its text and padding ask for, and it never\n\t\t\t\t\t\t * shrinks, since the default `flex-shrink: 1` would compress the glyph rather\n\t\t\t\t\t\t * than the words and a squashed icon reads as a rendering fault.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(\"& > svg\", [shrink(), is(4), bs(4)]),\n\t\t\t\t\t\trounded(\"md\"),\n\t\t\t\t\t\tweight(\"medium\"),\n\t\t\t\t\t\t/** A small control reaches `--ui-target-size` however a consumer positions it. */\n\t\t\t\t\t\thitArea({ anchor: \"flex-center\" }),\n\t\t\t\t\t\tpi(4),\n\t\t\t\t\t\tpb(2),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Every variant carries the same border width, colored to match its\n\t\t\t\t\t\t * own fill (transparent for ghost), so solid, outline, and ghost\n\t\t\t\t\t\t * render at the same footprint.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tborder({ width: 1 }),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * The row measure is stated, so the control lines up with a field of the same size when\n\t\t\t\t\t\t * a Group fuses the two, and still grows when a long label wraps.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tminBs(\"2.5rem\"),\n\n\t\t\t\t\t\tdata(\"size\", \"sm\", [pi(3), pb(1.5), minBs(\"2rem\"), when(\"& > svg\", [is(3), bs(3)])]),\n\t\t\t\t\t\tdata(\"size\", \"lg\", [\n\t\t\t\t\t\t\tpi(5),\n\t\t\t\t\t\t\tpb(2.5),\n\t\t\t\t\t\t\ttext(\"base\"),\n\t\t\t\t\t\t\tminBs(\"3rem\"),\n\t\t\t\t\t\t\twhen(\"& > svg\", [is(5), bs(5)]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * A glyph beside a label carries its own side bearing, so the padding on that\n\t\t\t\t\t\t * side drops one step and the glyph and the words read as evenly inset.\n\t\t\t\t\t\t */\n\t\t\t\t\t\twhen(\"&[data-glyph-start]:has(> svg:first-child)\", [\n\t\t\t\t\t\t\tpis(3),\n\t\t\t\t\t\t\tdata(\"size\", \"sm\", pis(2)),\n\t\t\t\t\t\t\tdata(\"size\", \"lg\", pis(4)),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen(\"&[data-glyph-end]:has(> svg:last-child)\", [\n\t\t\t\t\t\t\tpie(3),\n\t\t\t\t\t\t\tdata(\"size\", \"sm\", pie(2)),\n\t\t\t\t\t\t\tdata(\"size\", \"lg\", pie(4)),\n\t\t\t\t\t\t]),\n\n\t\t\t\t\t\tdata(\"variant\", \"solid\", [\n\t\t\t\t\t\t\tdata(\"color\", \"brand\", [\n\t\t\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\t\t\tborder(\"brand.solid\"),\n\t\t\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\t\t\thover([bg(\"brand.bg-solid-hover\"), border(\"brand.bg-solid-hover\")]),\n\t\t\t\t\t\t\t\tactive([bg(\"brand.bg-solid-pressed\"), border(\"brand.bg-solid-pressed\")]),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"neutral\", [\n\t\t\t\t\t\t\t\tbg(\"neutral.solid\"),\n\t\t\t\t\t\t\t\tborder(\"neutral.solid\"),\n\t\t\t\t\t\t\t\tfg(\"neutral.onSolid\"),\n\t\t\t\t\t\t\t\thover([bg(\"neutral.bg-solid-hover\"), border(\"neutral.bg-solid-hover\")]),\n\t\t\t\t\t\t\t\tactive([bg(\"neutral.bg-solid-pressed\"), border(\"neutral.bg-solid-pressed\")]),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"success\", [\n\t\t\t\t\t\t\t\tbg(\"success.solid\"),\n\t\t\t\t\t\t\t\tborder(\"success.solid\"),\n\t\t\t\t\t\t\t\tfg(\"success.onSolid\"),\n\t\t\t\t\t\t\t\thover([bg(\"success.bg-solid-hover\"), border(\"success.bg-solid-hover\")]),\n\t\t\t\t\t\t\t\tactive([bg(\"success.bg-solid-pressed\"), border(\"success.bg-solid-pressed\")]),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"warning\", [\n\t\t\t\t\t\t\t\tbg(\"warning.solid\"),\n\t\t\t\t\t\t\t\tborder(\"warning.solid\"),\n\t\t\t\t\t\t\t\tfg(\"warning.onSolid\"),\n\t\t\t\t\t\t\t\thover([bg(\"warning.bg-solid-hover\"), border(\"warning.bg-solid-hover\")]),\n\t\t\t\t\t\t\t\tactive([bg(\"warning.bg-solid-pressed\"), border(\"warning.bg-solid-pressed\")]),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"danger\", [\n\t\t\t\t\t\t\t\tbg(\"danger.solid\"),\n\t\t\t\t\t\t\t\tborder(\"danger.solid\"),\n\t\t\t\t\t\t\t\tfg(\"danger.onSolid\"),\n\t\t\t\t\t\t\t\thover([bg(\"danger.bg-solid-hover\"), border(\"danger.bg-solid-hover\")]),\n\t\t\t\t\t\t\t\tactive([bg(\"danger.bg-solid-pressed\"), border(\"danger.bg-solid-pressed\")]),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\n\t\t\t\t\t\tdata(\"variant\", \"outline\", [\n\t\t\t\t\t\t\tdata(\"color\", \"brand\", [\n\t\t\t\t\t\t\t\tborder(\"brand\"),\n\t\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\t\thover([bg(\"brand.tint\"), border(\"brand.border-hover\")]),\n\t\t\t\t\t\t\t\tactive(bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"neutral\", [\n\t\t\t\t\t\t\t\tborder(\"neutral\"),\n\t\t\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\t\t\thover([bg(\"neutral.tint\"), border(\"neutral.border-hover\")]),\n\t\t\t\t\t\t\t\tactive(bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"success\", [\n\t\t\t\t\t\t\t\tborder(\"success\"),\n\t\t\t\t\t\t\t\tfg(\"success\"),\n\t\t\t\t\t\t\t\thover([bg(\"success.tint\"), border(\"success.border-hover\")]),\n\t\t\t\t\t\t\t\tactive(bg(\"success.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"warning\", [\n\t\t\t\t\t\t\t\tborder(\"warning\"),\n\t\t\t\t\t\t\t\tfg(\"warning\"),\n\t\t\t\t\t\t\t\thover([bg(\"warning.tint\"), border(\"warning.border-hover\")]),\n\t\t\t\t\t\t\t\tactive(bg(\"warning.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"danger\", [\n\t\t\t\t\t\t\t\tborder(\"danger\"),\n\t\t\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\t\t\thover([bg(\"danger.tint\"), border(\"danger.border-hover\")]),\n\t\t\t\t\t\t\t\tactive(bg(\"danger.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"variant\", \"outline\", bg(\"transparent\")),\n\n\t\t\t\t\t\tdata(\"variant\", \"ghost\", [\n\t\t\t\t\t\t\tdata(\"color\", \"brand\", [\n\t\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\t\thover(bg(\"brand.tint\")),\n\t\t\t\t\t\t\t\tactive(bg(\"brand.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"neutral\", [\n\t\t\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\t\t\thover(bg(\"neutral.bg-tint-hover\")),\n\t\t\t\t\t\t\t\tactive(bg(\"neutral.bg-tint-pressed\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"success\", [\n\t\t\t\t\t\t\t\tfg(\"success\"),\n\t\t\t\t\t\t\t\thover(bg(\"success.tint\")),\n\t\t\t\t\t\t\t\tactive(bg(\"success.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"warning\", [\n\t\t\t\t\t\t\t\tfg(\"warning\"),\n\t\t\t\t\t\t\t\thover(bg(\"warning.tint\")),\n\t\t\t\t\t\t\t\tactive(bg(\"warning.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tdata(\"color\", \"danger\", [\n\t\t\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\t\t\thover(bg(\"danger.tint\")),\n\t\t\t\t\t\t\t\tactive(bg(\"danger.bg-tint-hover\")),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"variant\", \"ghost\", [bg(\"transparent\"), border(\"transparent\")]),\n\n\t\t\t\t\t\twhen('&[aria-disabled=\"true\"]', opacity(50)),\n\t\t\t\t\t\twhen('&[aria-disabled=\"true\"]', [cursor(\"not-allowed\"), pointerEvents()]),\n\n\t\t\t\t\t\tcursor(\"default\"),\n\t\t\t\t\t\tuserSelect(),\n\n\t\t\t\t\t\ttext(\"sm\"),\n\n\t\t\t\t\t\tdata(\"size\", \"sm\", text(\"xs\")),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</a>\n\t\t\t\t{rendersPrefetchHint(resolvedPrefetch, rest.href) && (\n\t\t\t\t\t<link rel=\"prefetch\" href={rest.href} />\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t};\n}\n"
11
11
  },
12
12
  "test": {
13
13
  "path": "link-button.test.tsx",
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "logo-cloud",
3
+ "changedIn": "2026.10.29",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "LogoCloud"
7
+ ],
8
+ "source": {
9
+ "path": "logo-cloud.tsx",
10
+ "content": "/**\n * A wrapping row of adopter marks for marketing proof strips. Each child is\n * forced to the marketing logo height with muted currentColor treatment so\n * the row reads as one quiet band.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { fg } from \"@sdxc/u/color\";\nimport { opacity } from \"@sdxc/u/effects\";\nimport { raw, var as varUtility } from \"@sdxc/u/general\";\nimport { flexWrap, gap, inlineFlex, items, justify } from \"@sdxc/u/layout\";\nimport { bs, is } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\n\n/** Forced height each direct child mark settles at. */\nconst LOGO_HEIGHT = varUtility(\"ui-marketing-logo-height\", \"1rem\");\n\n/**\n * Prop types for {@link LogoCloud}.\n */\nexport namespace LogoCloud {\n\t/**\n\t * Props accepted by {@link LogoCloud}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Softens the whole row further through the muted foreground token.\n\t\t * Individual marks already carry `logoCloudMark()` opacity.\n\t\t */\n\t\tmuted?: boolean;\n\t\t/**\n\t\t * Consumer-supplied marks — {@link Logo}, `<img>`, or inline SVG\n\t\t * children. The cloud applies mark sizing to each direct child.\n\t\t */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Lays logo children in a wrapping, centered row and forces each direct child\n * to the marketing logo height with muted currentColor treatment.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the cloud's markup.\n * @example\n * <LogoCloud muted>\n * \t<img src={acme} alt=\"\" />\n * \t<img src={globex} alt=\"\" />\n * </LogoCloud>\n */\nexport function LogoCloud(handle: Handle<LogoCloud.Props>) {\n\treturn () => {\n\t\tlet { mix, muted, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-muted={muted ? \"true\" : undefined}\n\t\t\t\tdata-slot=\"logo-cloud\"\n\t\t\t\tmix={[\n\t\t\t\t\tinlineFlex(),\n\t\t\t\t\tflexWrap(),\n\t\t\t\t\titems(\"center\"),\n\t\t\t\t\tjustify(\"center\"),\n\t\t\t\t\tgap(6),\n\t\t\t\t\tmuted ? fg(\"neutral.muted\") : fg(\"neutral\"),\n\t\t\t\t\twhen(\"& > *\", [\n\t\t\t\t\t\tbs(LOGO_HEIGHT),\n\t\t\t\t\t\tis(\"auto\"),\n\t\t\t\t\t\topacity(65),\n\t\t\t\t\t\traw({ objectFit: \"contain\", color: \"currentColor\" }),\n\t\t\t\t\t]),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n"
11
+ },
12
+ "test": {
13
+ "path": "logo-cloud.test.tsx",
14
+ "content": "/**\n * Covers {@link LogoCloud} applying mark sizing to direct children.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { LogoCloud } from \"@sdxc/ui/logo-cloud\";\n\ndescribe(\"LogoCloud\", () => {\n\ttest(\"sizes direct children with the logo-cloud mark recipe\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<LogoCloud muted>\n\t\t\t\t<img src=\"/acme.svg\" alt=\"\" />\n\t\t\t\t<img src=\"/globex.svg\" alt=\"\" />\n\t\t\t</LogoCloud>,\n\t\t);\n\n\t\texpect(html).toContain('data-slot=\"logo-cloud\"');\n\t\texpect(html).toContain('data-muted=\"true\"');\n\t\texpect(html).toContain(\"var(--ui-marketing-logo-height\");\n\t\texpect(html).toContain('src=\"/acme.svg\"');\n\t});\n});\n"
15
+ }
16
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "marketing-header",
3
+ "changedIn": "2026.10.29",
4
+ "dependencies": [
5
+ "heading"
6
+ ],
7
+ "exports": [
8
+ "MarketingHeader"
9
+ ],
10
+ "source": {
11
+ "path": "marketing-header.tsx",
12
+ "content": "/**\n * Eyebrow, chapter title, and lead copy that open a marketing band. The title\n * uses display chapter typography; the lead stays on the marketing lead measure\n * so the claim reads first and the support follows.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { bg, border, fg } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { inlineFlex, items, vstack } from \"@sdxc/u/layout\";\nimport { m, mbe, mi, pb, pi } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport {\n\tfont,\n\tleading,\n\ttext,\n\ttextAlign,\n\ttextTransform,\n\ttracking,\n\tweight,\n} from \"@sdxc/u/typography\";\n\nimport { marketingLead } from \"@sdxc/ui/styles\";\n\nimport { Heading } from \"@sdxc/ui/heading\";\n\n/** Content alignment {@link MarketingHeader} applies when `align` is omitted. */\nconst DEFAULT_ALIGN: MarketingHeader.Align = \"start\";\n\n/** Eyebrow chrome {@link MarketingHeader} applies when `eyebrowVariant` is omitted. */\nconst DEFAULT_EYEBROW_VARIANT: MarketingHeader.EyebrowVariant = \"pill\";\n\n/**\n * Prop types for {@link MarketingHeader}.\n */\nexport namespace MarketingHeader {\n\t/**\n\t * Whether the stack stretches start-aligned or centers as one statement.\n\t */\n\texport type Align = \"start\" | \"center\";\n\n\t/**\n\t * How the optional eyebrow reads: a filled pill, a mono label, or a chip\n\t * with stronger tracking for short announcements.\n\t */\n\texport type EyebrowVariant = \"pill\" | \"mono\" | \"chip\";\n\n\t/**\n\t * Per-part styling for the elements the header renders besides its host.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the optional eyebrow label. */\n\t\teyebrow?: TagProps<\"span\">[\"mix\"];\n\t\t/** Styling for the title {@link Heading}. */\n\t\ttitle?: TagProps<\"h1\">[\"mix\"];\n\t\t/** Styling for the optional lead paragraph. */\n\t\tdescription?: TagProps<\"p\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link MarketingHeader}.\n\t */\n\texport interface Props extends TagProps<\"header\"> {\n\t\t/** Short label above the title. */\n\t\teyebrow?: RemixNode;\n\t\t/**\n\t\t * Eyebrow chrome. Defaults to {@link DEFAULT_EYEBROW_VARIANT} when an\n\t\t * eyebrow is present.\n\t\t */\n\t\teyebrowVariant?: EyebrowVariant;\n\t\t/** Supporting copy under the title. */\n\t\tdescription?: RemixNode;\n\t\t/** Stack alignment. Defaults to {@link DEFAULT_ALIGN}. */\n\t\talign?: Align;\n\t\t/** Per-part styling for eyebrow, title, and description. */\n\t\tparts?: PartsProps;\n\t\t/** Title copy — rendered through {@link Heading} at chapter display size. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders an optional eyebrow, a chapter-sized {@link Heading} from `children`,\n * and an optional lead paragraph. Nest inside a {@link HeadingScope} so the\n * title picks up the band's outline depth.\n *\n * @param handle Runtime handle carrying the host `<header>`'s props.\n * @returns The render function producing the header's markup.\n * @example\n * <MarketingHeader eyebrow={t(\"badge\")} description={t(\"lead\")} align=\"center\">\n * \t{t(\"title\")}\n * </MarketingHeader>\n * @example\n * <MarketingHeader eyebrow={t(\"new\")} eyebrowVariant=\"chip\" description={t(\"lead\")}>\n * \t{t(\"title\")}\n * </MarketingHeader>\n */\nexport function MarketingHeader(handle: Handle<MarketingHeader.Props>) {\n\treturn () => {\n\t\tlet { align, children, description, eyebrow, eyebrowVariant, mix, parts, ...rest } =\n\t\t\thandle.props;\n\t\tlet resolvedAlign = align ?? DEFAULT_ALIGN;\n\t\tlet resolvedEyebrowVariant = eyebrowVariant ?? DEFAULT_EYEBROW_VARIANT;\n\t\tlet isCenter = resolvedAlign === \"center\";\n\n\t\treturn (\n\t\t\t<header\n\t\t\t\t{...rest}\n\t\t\t\tdata-align={resolvedAlign}\n\t\t\t\tmix={[\n\t\t\t\t\tvstack({\n\t\t\t\t\t\talign: isCenter ? \"center\" : \"stretch\",\n\t\t\t\t\t\tgap: 2,\n\t\t\t\t\t}),\n\t\t\t\t\tisCenter ? [textAlign(\"center\"), mi(\"auto\")] : [],\n\t\t\t\t\tmbe(10),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t{eyebrow ? (\n\t\t\t\t\t<span\n\t\t\t\t\t\tdata-variant={resolvedEyebrowVariant}\n\t\t\t\t\t\tmix={[\n\t\t\t\t\t\t\tinlineFlex(),\n\t\t\t\t\t\t\titems(\"center\"),\n\t\t\t\t\t\t\ttext(\"xs\"),\n\t\t\t\t\t\t\tweight(\"semibold\"),\n\t\t\t\t\t\t\twhen('&[data-variant=\"pill\"]', [\n\t\t\t\t\t\t\t\tpb(0.5),\n\t\t\t\t\t\t\t\tpi(2.5),\n\t\t\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\t\t\tborder({ color: \"brand\", width: 1, style: \"solid\" }),\n\t\t\t\t\t\t\t\tbg(\"brand.tint\"),\n\t\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\twhen('&[data-variant=\"mono\"]', [\n\t\t\t\t\t\t\t\tfont(\"mono\"),\n\t\t\t\t\t\t\t\ttracking(\"wide\"),\n\t\t\t\t\t\t\t\ttextTransform(\"uppercase\"),\n\t\t\t\t\t\t\t\tfg(\"neutral.muted\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\twhen('&[data-variant=\"chip\"]', [\n\t\t\t\t\t\t\t\tpb(0.5),\n\t\t\t\t\t\t\t\tpi(2.5),\n\t\t\t\t\t\t\t\trounded(\"full\"),\n\t\t\t\t\t\t\t\tborder({ color: \"brand\", width: 1, style: \"solid\" }),\n\t\t\t\t\t\t\t\tbg(\"brand.solid\"),\n\t\t\t\t\t\t\t\tfg(\"brand.onSolid\"),\n\t\t\t\t\t\t\t\ttracking(\"wider\"),\n\t\t\t\t\t\t\t\ttextTransform(\"uppercase\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\tparts?.eyebrow,\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{eyebrow}\n\t\t\t\t\t</span>\n\t\t\t\t) : null}\n\n\t\t\t\t<Heading size=\"chapter\" mix={[m(0), description ? mbe(2) : [], parts?.title]}>\n\t\t\t\t\t{children}\n\t\t\t\t</Heading>\n\n\t\t\t\t{description ? (\n\t\t\t\t\t<p\n\t\t\t\t\t\tmix={[\n\t\t\t\t\t\t\tmarketingLead(),\n\t\t\t\t\t\t\tleading(\"relaxed\"),\n\t\t\t\t\t\t\tisCenter ? mi(\"auto\") : [],\n\t\t\t\t\t\t\tparts?.description,\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t{description}\n\t\t\t\t\t</p>\n\t\t\t\t) : null}\n\t\t\t</header>\n\t\t);\n\t};\n}\n"
13
+ },
14
+ "test": {
15
+ "path": "marketing-header.test.tsx",
16
+ "content": "/**\n * Covers {@link MarketingHeader} eyebrow variants, chapter title sizing, and\n * centered alignment so section openers keep the marketing type contract.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { MarketingHeader } from \"@sdxc/ui/marketing-header\";\n\ndescribe(\"MarketingHeader\", () => {\n\ttest(\"renders a chapter title and optional lead\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<MarketingHeader description=\"Support copy for the claim.\">\n\t\t\t\tShip with shared measure\n\t\t\t</MarketingHeader>,\n\t\t);\n\n\t\texpect(html).toContain(\"Ship with shared measure\");\n\t\texpect(html).toContain(\"Support copy for the claim.\");\n\t\texpect(html).toContain('data-size=\"chapter\"');\n\t\texpect(html).toContain(\"var(--ui-marketing-chapter-size\");\n\t\texpect(html).toContain(\"var(--ui-marketing-lead-size\");\n\t});\n\n\ttest(\"applies eyebrow variants through data-variant\", async () => {\n\t\tlet pill = await renderToString(\n\t\t\t<MarketingHeader eyebrow=\"New\" eyebrowVariant=\"pill\">\n\t\t\t\tTitle\n\t\t\t</MarketingHeader>,\n\t\t);\n\t\tlet mono = await renderToString(\n\t\t\t<MarketingHeader eyebrow=\"Section\" eyebrowVariant=\"mono\">\n\t\t\t\tTitle\n\t\t\t</MarketingHeader>,\n\t\t);\n\t\tlet chip = await renderToString(\n\t\t\t<MarketingHeader eyebrow=\"Beta\" eyebrowVariant=\"chip\">\n\t\t\t\tTitle\n\t\t\t</MarketingHeader>,\n\t\t);\n\n\t\texpect(pill).toContain('data-variant=\"pill\"');\n\t\texpect(mono).toContain('data-variant=\"mono\"');\n\t\texpect(chip).toContain('data-variant=\"chip\"');\n\t\texpect(chip).toContain(\"text-transform: uppercase\");\n\t});\n\n\ttest(\"centers the stack when align is center\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<MarketingHeader align=\"center\" description=\"Lead\">\n\t\t\t\tCentered\n\t\t\t</MarketingHeader>,\n\t\t);\n\n\t\texpect(html).toContain('data-align=\"center\"');\n\t\texpect(html).toContain(\"text-align: center\");\n\t});\n});\n"
17
+ }
18
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "marketing-section",
3
+ "changedIn": "2026.10.29",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "MarketingSection"
7
+ ],
8
+ "source": {
9
+ "path": "marketing-section.tsx",
10
+ "content": "/**\n * A landing-page band: a `<section>` host that applies marketing tone, spacing,\n * and content measure so pages share one rhythm. Distinct from the listbox\n * {@link Section}, which groups menu items.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { borderEdge } from \"@sdxc/u/color\";\nimport { raw } from \"@sdxc/u/general\";\nimport { container, relative, vstack } from \"@sdxc/u/layout\";\nimport { at } from \"@sdxc/u/responsive\";\nimport { is } from \"@sdxc/u/size\";\nimport { after, before } from \"@sdxc/u/state\";\nimport { textAlign } from \"@sdxc/u/typography\";\n\nimport type { MarketingBandTone, MarketingSectionSpacing } from \"@sdxc/ui/styles\";\n\nimport {\n\tmarketingBandTone,\n\tmarketingContainer,\n\tmarketingHairline,\n\tmarketingSectionSpace,\n} from \"@sdxc/ui/styles\";\n\n/** Band fill {@link MarketingSection} applies when `tone` is omitted. */\nconst DEFAULT_TONE: MarketingSection.Tone = \"plain\";\n\n/** Block padding {@link MarketingSection} applies when `spacing` is omitted. */\nconst DEFAULT_SPACING: MarketingSection.Spacing = \"normal\";\n\n/** Content alignment {@link MarketingSection} applies when `align` is omitted. */\nconst DEFAULT_ALIGN: MarketingSection.Align = \"start\";\n\n/** Chrome {@link MarketingSection} applies when `variant` is omitted. */\nconst DEFAULT_VARIANT: MarketingSection.Variant = \"default\";\n\n/**\n * Prop types for {@link MarketingSection}.\n */\nexport namespace MarketingSection {\n\t/**\n\t * What sits behind the band: nothing, a quiet tint, a faded grid, or an\n\t * inverted solid for a closing call-to-action.\n\t */\n\texport type Tone = MarketingBandTone;\n\n\t/**\n\t * How much block padding the band leaves around its content.\n\t */\n\texport type Spacing = MarketingSectionSpacing;\n\n\t/**\n\t * Whether the inner column stretches start-aligned or centers as one\n\t * statement.\n\t */\n\texport type Align = \"start\" | \"center\";\n\n\t/**\n\t * Outer chrome: a plain band, or a framed column with dashed rails and\n\t * corner markers where a top rule meets them.\n\t */\n\texport type Variant = \"default\" | \"frame\";\n\n\t/**\n\t * Per-part styling for the elements the band renders besides its host.\n\t */\n\texport interface PartsProps {\n\t\t/** Styling for the measured content column inside the band. */\n\t\tcontainer?: TagProps<\"div\">[\"mix\"];\n\t}\n\n\t/**\n\t * Props accepted by {@link MarketingSection}.\n\t */\n\texport interface Props extends TagProps<\"section\"> {\n\t\t/** Band fill. Defaults to {@link DEFAULT_TONE}. */\n\t\ttone?: Tone;\n\t\t/** Block padding step. Defaults to {@link DEFAULT_SPACING}. */\n\t\tspacing?: Spacing;\n\t\t/** Content alignment. Defaults to {@link DEFAULT_ALIGN}. */\n\t\talign?: Align;\n\t\t/**\n\t\t * Draws a low-contrast 1px rule along the block-start edge so stacked\n\t\t * bands separate cleanly.\n\t\t */\n\t\truled?: boolean;\n\t\t/** Outer chrome. Defaults to {@link DEFAULT_VARIANT}. */\n\t\tvariant?: Variant;\n\t\t/** Per-part styling for the measured inner column. */\n\t\tparts?: PartsProps;\n\t\t/** Band content — headers, splits, feature grids, and so on. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Renders a marketing band: tone and spacing on the `<section>`, a named\n * container for descendant queries, and a measured inner column from the\n * marketing gutters. Pair the host with `viewReveal()` from the animations\n * entry when the band should enter on scroll.\n *\n * @param handle Runtime handle carrying the host `<section>`'s props.\n * @returns The render function producing the band's markup.\n * @example\n * <MarketingSection tone=\"tinted\" spacing=\"normal\" ruled>\n * \t{children}\n * </MarketingSection>\n * @example\n * <MarketingSection tone=\"grid\" spacing=\"hero\" align=\"center\" variant=\"frame\">\n * \t{children}\n * </MarketingSection>\n */\nexport function MarketingSection(handle: Handle<MarketingSection.Props>) {\n\treturn () => {\n\t\tlet { align, children, mix, parts, ruled, spacing, tone, variant, ...rest } = handle.props;\n\t\tlet resolvedTone = tone ?? DEFAULT_TONE;\n\t\tlet resolvedSpacing = spacing ?? DEFAULT_SPACING;\n\t\tlet resolvedAlign = align ?? DEFAULT_ALIGN;\n\t\tlet resolvedVariant = variant ?? DEFAULT_VARIANT;\n\t\tlet isCenter = resolvedAlign === \"center\";\n\t\tlet isFrame = resolvedVariant === \"frame\";\n\n\t\treturn (\n\t\t\t<section\n\t\t\t\t{...rest}\n\t\t\t\tdata-tone={resolvedTone}\n\t\t\t\tdata-spacing={resolvedSpacing}\n\t\t\t\tdata-align={resolvedAlign}\n\t\t\t\tdata-variant={resolvedVariant}\n\t\t\t\tmix={[\n\t\t\t\t\tcontainer(\"ui-marketing-section\"),\n\t\t\t\t\trelative(),\n\t\t\t\t\tvstack({ align: \"center\" }),\n\t\t\t\t\tis(\"100%\"),\n\t\t\t\t\traw({ isolation: \"isolate\" }),\n\t\t\t\t\tmarketingBandTone(resolvedTone),\n\t\t\t\t\tmarketingSectionSpace(resolvedSpacing),\n\t\t\t\t\truled ? marketingHairline() : [],\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tmix={[\n\t\t\t\t\t\tmarketingContainer(),\n\t\t\t\t\t\tvstack({\n\t\t\t\t\t\t\talign: isCenter ? \"center\" : \"stretch\",\n\t\t\t\t\t\t\tgap: 0,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trelative(),\n\t\t\t\t\t\tis(\"100%\"),\n\t\t\t\t\t\tisCenter ? textAlign(\"center\") : [],\n\t\t\t\t\t\tisFrame\n\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\tat(\"md\", \"ui-marketing-section\", [\n\t\t\t\t\t\t\t\t\t\tborderEdge(\"inline-start\", {\n\t\t\t\t\t\t\t\t\t\t\tcolor: \"neutral\",\n\t\t\t\t\t\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\t\t\t\t\t\tstyle: \"dashed\",\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\tborderEdge(\"inline-end\", {\n\t\t\t\t\t\t\t\t\t\t\tcolor: \"neutral\",\n\t\t\t\t\t\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\t\t\t\t\t\tstyle: \"dashed\",\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\truled\n\t\t\t\t\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t\t\t\t\tbefore(frameMarker({ insetInlineStart: \"-4px\" })),\n\t\t\t\t\t\t\t\t\t\t\t\t\tafter(frameMarker({ insetInlineEnd: \"-4px\" })),\n\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t: [],\n\t\t\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t: [],\n\t\t\t\t\t\tparts?.container,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t</section>\n\t\t);\n\t};\n}\n\n/**\n * The square drawn where a framed band's top rule crosses a rail, so the rails\n * read as a frame the rule is fixed to.\n */\nfunction frameMarker(edge: { insetInlineStart: string } | { insetInlineEnd: string }) {\n\treturn raw({\n\t\tcontent: '\"\"',\n\t\tposition: \"absolute\",\n\t\tinsetBlockStart: \"-4px\",\n\t\t...edge,\n\t\tinlineSize: \"7px\",\n\t\tblockSize: \"7px\",\n\t\tbackgroundColor: \"var(--ui-brand-bg-solid)\",\n\t});\n}\n"
11
+ },
12
+ "test": {
13
+ "path": "marketing-section.test.tsx",
14
+ "content": "/**\n * Covers {@link MarketingSection} tone, spacing, ruled hairline, and frame\n * chrome so the band host keeps the marketing factory contract.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { MarketingSection } from \"@sdxc/ui/marketing-section\";\n\ndescribe(\"MarketingSection\", () => {\n\ttest(\"marks tone, spacing, and the named marketing container\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<MarketingSection tone=\"tinted\" spacing=\"hero\" id=\"proof\">\n\t\t\t\tContent\n\t\t\t</MarketingSection>,\n\t\t);\n\n\t\texpect(html).toContain('id=\"proof\"');\n\t\texpect(html).toContain('data-tone=\"tinted\"');\n\t\texpect(html).toContain('data-spacing=\"hero\"');\n\t\texpect(html).toContain(\"container: ui-marketing-section / inline-size\");\n\t\texpect(html).toContain(\"var(--ui-marketing-section-space-hero\");\n\t});\n\n\ttest(\"draws a hairline when ruled and frame rails when variant is frame\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<MarketingSection ruled variant=\"frame\">\n\t\t\t\tFramed\n\t\t\t</MarketingSection>,\n\t\t);\n\n\t\texpect(html).toContain('data-variant=\"frame\"');\n\t\texpect(html).toContain(\"border-block-start\");\n\t\texpect(html).toContain(\"border-inline-start\");\n\t});\n});\n"
15
+ }
16
+ }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "nav-link",
3
- "changedIn": "2026.10.24",
3
+ "changedIn": "2026.10.29",
4
4
  "dependencies": [],
5
5
  "exports": [
6
6
  "NavLink"
7
7
  ],
8
8
  "source": {
9
9
  "path": "nav-link.tsx",
10
- "content": "/**\n * An inline text link for site navigation, colored through a semantic color\n * role and underlined to read as a link among surrounding prose. Its\n * current-page state comes straight from `aria-current` set on the host\n * server-side, rendering the emphasized, non-underlined treatment directly\n * from that attribute.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { colorMix, fg, outline } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { cursor, raw } from \"@sdxc/u/general\";\nimport { data, hover, when } from \"@sdxc/u/state\";\nimport { textDecoration, weight } from \"@sdxc/u/typography\";\n\nimport type { LinkPrefetch } from \"@sdxc/ui/utils\";\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { prefetchAttribute, rendersPrefetchHint } from \"@sdxc/ui/utils\";\n\n/** Semantic color role {@link NavLink} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: NavLink.Color = \"neutral\";\n\n/** Prefetch mode {@link NavLink} falls back to when `prefetch` is omitted. */\nconst DEFAULT_PREFETCH: NavLink.Prefetch = \"none\";\n\n/**\n * Prop types for {@link NavLink}.\n */\nexport namespace NavLink {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` variables.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * When the destination starts loading: on intent, once in the viewport, on\n\t * render through a `<link rel=\"prefetch\">` that also serves full-document\n\t * navigations, or only on navigation (`\"none\"`).\n\t */\n\texport type Prefetch = LinkPrefetch;\n\n\t/**\n\t * Props accepted by {@link NavLink}, built as an intersection: the\n\t * underlying anchor prop type is a union keyed on `href`, since the\n\t * accessible-anchor contract restricts `role` once `href` is present.\n\t */\n\texport type Props = TagProps<\"a\"> & {\n\t\t/** Destination the link navigates to. */\n\t\thref: string;\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/**\n\t\t * Marks the link as sitting over its own colored background: drops the\n\t\t * underline entirely, since the background fill already sets it apart\n\t\t * from surrounding text.\n\t\t */\n\t\thasBackground?: boolean;\n\t\t/**\n\t\t * Prefetch mode, for links whose GET is safe to repeat. `\"render\"` suits\n\t\t * multi-page navigations; a menu keeps it to its first few items, since each\n\t\t * hint is a request on page load. Defaults to {@link DEFAULT_PREFETCH}.\n\t\t */\n\t\tprefetch?: Prefetch;\n\t};\n}\n\n/**\n * Renders a native `<a>`, colored via `data-color` and underlined with a\n * translucent decoration that solidifies on hover. Setting `aria-current`\n * server-side renders the current-page treatment; the focus-visible ring always reads in the primary color.\n *\n * @param handle Runtime handle carrying the host `<a>`'s props.\n * @returns The render function producing the link's markup.\n * @example\n * <NavLink href=\"/dashboard\" color=\"brand\" prefetch=\"render\">{t(\"nav.dashboard\")}</NavLink>\n * @example\n * <NavLink href=\"/settings\" aria-current={pathname === \"/settings\" ? \"page\" : undefined}>{t(\"nav.settings\")}</NavLink>\n * @example\n * <NavLink href=\"/settings\" hasBackground mix={css({ paddingInline: \"0.75rem\", paddingBlock: \"0.5rem\" })}>{t(\"nav.settings\")}</NavLink>\n */\nexport function NavLink(handle: Handle<NavLink.Props>) {\n\treturn () => {\n\t\tlet { color, hasBackground, prefetch, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\t\tlet resolvedPrefetch = prefetch ?? DEFAULT_PREFETCH;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<a\n\t\t\t\t\t{...rest}\n\t\t\t\t\tdata-color={resolvedColor}\n\t\t\t\t\tdata-has-background={hasBackground || undefined}\n\t\t\t\t\tdata-rmx-prefetch={prefetchAttribute(resolvedPrefetch)}\n\t\t\t\t\tmix={[\n\t\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\t\trounded(\"sm\"),\n\t\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\t\ttextDecoration(\"underline\"),\n\t\t\t\t\t\traw({\n\t\t\t\t\t\t\ttextDecorationColor: colorMix(\n\t\t\t\t\t\t\t\t\"oklab\",\n\t\t\t\t\t\t\t\t{ color: \"currentcolor\", weight: 60 },\n\t\t\t\t\t\t\t\t\"transparent\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\ttextUnderlineOffset: \"4px\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t\thover(raw({ textDecorationColor: \"currentcolor\" })),\n\t\t\t\t\t\tdata(\"color\", \"brand\", [\n\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\t\tweight(500),\n\t\t\t\t\t\t\t\tfg(\"brand.emphasis\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"neutral\", [\n\t\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\t\tweight(500),\n\t\t\t\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"success\", [\n\t\t\t\t\t\t\tfg(\"success\"),\n\t\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\t\tweight(500),\n\t\t\t\t\t\t\t\tfg(\"success.emphasis\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"warning\", [\n\t\t\t\t\t\t\tfg(\"warning\"),\n\t\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\t\tweight(500),\n\t\t\t\t\t\t\t\tfg(\"warning.emphasis\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"danger\", [\n\t\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\t\tweight(500),\n\t\t\t\t\t\t\t\tfg(\"danger.emphasis\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\tweight(500),\n\t\t\t\t\t\t\traw({ textDecorationThickness: \"2px\", textDecorationColor: \"currentcolor\" }),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"has-background\", textDecoration(\"none\")),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t'&[data-has-background]:hover, &[data-has-background][aria-current]:not([aria-current=\"false\"])',\n\t\t\t\t\t\t\ttextDecoration(\"none\"),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t]}\n\t\t\t\t/>\n\t\t\t\t{rendersPrefetchHint(resolvedPrefetch, rest.href) && (\n\t\t\t\t\t<link rel=\"prefetch\" href={rest.href} />\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t};\n}\n"
10
+ "content": "/**\n * An inline text link for site navigation, colored through a semantic color\n * role and underlined to read as a link among surrounding prose. Its\n * current-page state comes straight from `aria-current` set on the host\n * server-side, rendering the emphasized, non-underlined treatment directly\n * from that attribute. Marketing sticky headers usually mix `text(\"sm\")`\n * (~13–15px) and a quiet hover so the bar stays dense beside the brand.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps } from \"remix/component\";\n\nimport { colorMix, fg, outline } from \"@sdxc/u/color\";\nimport { rounded } from \"@sdxc/u/effects\";\nimport { cursor, raw } from \"@sdxc/u/general\";\nimport { data, hover, when } from \"@sdxc/u/state\";\nimport { textDecoration, weight } from \"@sdxc/u/typography\";\n\nimport type { LinkPrefetch } from \"@sdxc/ui/utils\";\nimport type { SemanticColor } from \"@sdxc/ui/utils\";\n\nimport { interactiveTransition } from \"@sdxc/ui/styles\";\nimport { prefetchAttribute, rendersPrefetchHint } from \"@sdxc/ui/utils\";\n\n/** Semantic color role {@link NavLink} falls back to when `color` is omitted. */\nconst DEFAULT_COLOR: NavLink.Color = \"neutral\";\n\n/** Prefetch mode {@link NavLink} falls back to when `prefetch` is omitted. */\nconst DEFAULT_PREFETCH: NavLink.Prefetch = \"none\";\n\n/**\n * Prop types for {@link NavLink}.\n */\nexport namespace NavLink {\n\t/**\n\t * Semantic color role, each mapped to its matching `--ui-*` variables.\n\t */\n\texport type Color = SemanticColor;\n\n\t/**\n\t * When the destination starts loading: on intent, once in the viewport, on\n\t * render through a `<link rel=\"prefetch\">` that also serves full-document\n\t * navigations, or only on navigation (`\"none\"`).\n\t */\n\texport type Prefetch = LinkPrefetch;\n\n\t/**\n\t * Props accepted by {@link NavLink}, built as an intersection: the\n\t * underlying anchor prop type is a union keyed on `href`, since the\n\t * accessible-anchor contract restricts `role` once `href` is present.\n\t */\n\texport type Props = TagProps<\"a\"> & {\n\t\t/** Destination the link navigates to. */\n\t\thref: string;\n\t\t/** Semantic color role. Defaults to {@link DEFAULT_COLOR}. */\n\t\tcolor?: Color;\n\t\t/**\n\t\t * Marks the link as sitting over its own colored background: drops the\n\t\t * underline entirely, since the background fill already sets it apart\n\t\t * from surrounding text.\n\t\t */\n\t\thasBackground?: boolean;\n\t\t/**\n\t\t * Prefetch mode, for links whose GET is safe to repeat. `\"render\"` suits\n\t\t * multi-page navigations; a menu keeps it to its first few items, since each\n\t\t * hint is a request on page load. Defaults to {@link DEFAULT_PREFETCH}.\n\t\t */\n\t\tprefetch?: Prefetch;\n\t};\n}\n\n/**\n * Renders a native `<a>`, colored via `data-color` and underlined with a\n * translucent decoration that solidifies on hover. Setting `aria-current`\n * server-side renders the current-page treatment; the focus-visible ring always reads in the primary color.\n *\n * @param handle Runtime handle carrying the host `<a>`'s props.\n * @returns The render function producing the link's markup.\n * @example\n * <NavLink href=\"/dashboard\" color=\"brand\" prefetch=\"render\">{t(\"nav.dashboard\")}</NavLink>\n * @example\n * <NavLink href=\"/settings\" aria-current={pathname === \"/settings\" ? \"page\" : undefined}>{t(\"nav.settings\")}</NavLink>\n * @example\n * <NavLink href=\"/settings\" hasBackground mix={css({ paddingInline: \"0.75rem\", paddingBlock: \"0.5rem\" })}>{t(\"nav.settings\")}</NavLink>\n */\nexport function NavLink(handle: Handle<NavLink.Props>) {\n\treturn () => {\n\t\tlet { color, hasBackground, prefetch, mix, ...rest } = handle.props;\n\t\tlet resolvedColor = color ?? DEFAULT_COLOR;\n\t\tlet resolvedPrefetch = prefetch ?? DEFAULT_PREFETCH;\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<a\n\t\t\t\t\t{...rest}\n\t\t\t\t\tdata-color={resolvedColor}\n\t\t\t\t\tdata-has-background={hasBackground || undefined}\n\t\t\t\t\tdata-rmx-prefetch={prefetchAttribute(resolvedPrefetch)}\n\t\t\t\t\tmix={[\n\t\t\t\t\t\tinteractiveTransition(),\n\t\t\t\t\t\trounded(\"sm\"),\n\t\t\t\t\t\twhen(\"&:focus-visible\", outline({ color: \"brand.ring\", offset: 2 })),\n\t\t\t\t\t\tcursor(\"pointer\"),\n\t\t\t\t\t\ttextDecoration(\"underline\"),\n\t\t\t\t\t\traw({\n\t\t\t\t\t\t\ttextDecorationColor: colorMix(\n\t\t\t\t\t\t\t\t\"oklab\",\n\t\t\t\t\t\t\t\t{ color: \"currentcolor\", weight: 60 },\n\t\t\t\t\t\t\t\t\"transparent\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\ttextUnderlineOffset: \"4px\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t\thover(raw({ textDecorationColor: \"currentcolor\" })),\n\t\t\t\t\t\tdata(\"color\", \"brand\", [\n\t\t\t\t\t\t\tfg(\"brand\"),\n\t\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\t\tweight(500),\n\t\t\t\t\t\t\t\tfg(\"brand.emphasis\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"neutral\", [\n\t\t\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\t\tweight(500),\n\t\t\t\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"success\", [\n\t\t\t\t\t\t\tfg(\"success\"),\n\t\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\t\tweight(500),\n\t\t\t\t\t\t\t\tfg(\"success.emphasis\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"warning\", [\n\t\t\t\t\t\t\tfg(\"warning\"),\n\t\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\t\tweight(500),\n\t\t\t\t\t\t\t\tfg(\"warning.emphasis\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"color\", \"danger\", [\n\t\t\t\t\t\t\tfg(\"danger\"),\n\t\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\t\tweight(500),\n\t\t\t\t\t\t\t\tfg(\"danger.emphasis\"),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\twhen('&[aria-current]:not([aria-current=\"false\"])', [\n\t\t\t\t\t\t\tweight(500),\n\t\t\t\t\t\t\traw({ textDecorationThickness: \"2px\", textDecorationColor: \"currentcolor\" }),\n\t\t\t\t\t\t]),\n\t\t\t\t\t\tdata(\"has-background\", textDecoration(\"none\")),\n\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t'&[data-has-background]:hover, &[data-has-background][aria-current]:not([aria-current=\"false\"])',\n\t\t\t\t\t\t\ttextDecoration(\"none\"),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t]}\n\t\t\t\t/>\n\t\t\t\t{rendersPrefetchHint(resolvedPrefetch, rest.href) && (\n\t\t\t\t\t<link rel=\"prefetch\" href={rest.href} />\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t};\n}\n"
11
11
  },
12
12
  "test": {
13
13
  "path": "nav-link.test.tsx",
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "split",
3
+ "changedIn": "2026.10.29",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "Split"
7
+ ],
8
+ "source": {
9
+ "path": "split.tsx",
10
+ "content": "/**\n * Two-column marketing band content: prose on one side and the media it\n * describes on the other. Stacks to a single column under the nearest\n * container; `lean` hands the wider track to copy or media.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { fg } from \"@sdxc/u/color\";\nimport { raw } from \"@sdxc/u/general\";\nimport { container, gap, grid, gridTemplate, items, vstack } from \"@sdxc/u/layout\";\nimport { at } from \"@sdxc/u/responsive\";\nimport { minIs } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { leading, text } from \"@sdxc/u/typography\";\n\n/** Which column gets the wider track when `lean` is omitted. */\nconst DEFAULT_LEAN: Split.Lean = \"media\";\n\n/** The check each claim list item is marked with, drawn as a brand-filled mask. */\nconst CHECK_MASK = `url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E\") center / contain no-repeat`;\n\n/**\n * Prop types for {@link Split} and its compound parts.\n */\nexport namespace Split {\n\t/**\n\t * Which column receives the wider track above the stack breakpoint.\n\t */\n\texport type Lean = \"copy\" | \"media\";\n\n\t/**\n\t * Props accepted by {@link Split}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/**\n\t\t * Which column is wider. Defaults to {@link DEFAULT_LEAN} so media\n\t\t * usually leads the layout.\n\t\t */\n\t\tlean?: Lean;\n\t\t/** {@link Split.Copy} and {@link Split.Media} columns. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Split.Copy}.\n\t */\n\texport interface CopyProps extends TagProps<\"div\"> {\n\t\t/**\n\t\t * When set, unordered lists inside the copy render as checked claims\n\t\t * rather than bullets.\n\t\t */\n\t\tchecks?: boolean;\n\t\t/** Prose, claims, and supporting copy for the column. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link Split.Media}.\n\t */\n\texport interface MediaProps extends TagProps<\"div\"> {\n\t\t/** Media, samples, or staged UI for the column. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Lays {@link Split.Copy} and {@link Split.Media} as a two-track grid that\n * collapses to one column below `lg` on its own named container.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the split's markup.\n * @example\n * <Split lean=\"copy\">\n * \t<Split.Copy checks>{claims}</Split.Copy>\n * \t<Split.Media>{shot}</Split.Media>\n * </Split>\n */\nexport function Split(handle: Handle<Split.Props>) {\n\treturn () => {\n\t\tlet { lean, mix, ...rest } = handle.props;\n\t\tlet resolvedLean = lean ?? DEFAULT_LEAN;\n\t\tlet columns =\n\t\t\tresolvedLean === \"copy\"\n\t\t\t\t? \"minmax(0, 1.15fr) minmax(0, 0.85fr)\"\n\t\t\t\t: \"minmax(0, 0.85fr) minmax(0, 1.15fr)\";\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-lean={resolvedLean}\n\t\t\t\tdata-slot=\"split\"\n\t\t\t\tmix={[\n\t\t\t\t\tcontainer(\"ui-marketing-split\"),\n\t\t\t\t\tgrid(),\n\t\t\t\t\tgap(12),\n\t\t\t\t\titems(\"start\"),\n\t\t\t\t\tgridTemplate({ columns: \"minmax(0, 1fr)\" }),\n\t\t\t\t\tat(\"lg\", \"ui-marketing-split\", gridTemplate({ columns })),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * The prose column of a {@link Split}. Pass `checks` so nested unordered\n * lists read as claim rows with brand check marks.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the copy column.\n * @example\n * <Split.Copy checks>\n * \t<ul><li>{t(\"claim.one\")}</li></ul>\n * </Split.Copy>\n */\nSplit.Copy = function SplitCopy(handle: Handle<Split.CopyProps>) {\n\treturn () => {\n\t\tlet { checks, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"split-copy\"\n\t\t\t\tdata-checks={checks ? \"true\" : undefined}\n\t\t\t\tmix={[\n\t\t\t\t\tvstack({ gap: 6, align: \"stretch\" }),\n\t\t\t\t\ttext(\"lg\"),\n\t\t\t\t\tleading(\"relaxed\"),\n\t\t\t\t\tfg(\"neutral\"),\n\t\t\t\t\tchecks\n\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t\t\t\"& ul\",\n\t\t\t\t\t\t\t\t\traw({\n\t\t\t\t\t\t\t\t\t\tlistStyle: \"none\",\n\t\t\t\t\t\t\t\t\t\tpadding: \"0\",\n\t\t\t\t\t\t\t\t\t\tmargin: \"0\",\n\t\t\t\t\t\t\t\t\t\tdisplay: \"grid\",\n\t\t\t\t\t\t\t\t\t\tgap: \"0.625rem\",\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t\t\t\"& li\",\n\t\t\t\t\t\t\t\t\traw({\n\t\t\t\t\t\t\t\t\t\tposition: \"relative\",\n\t\t\t\t\t\t\t\t\t\tpaddingInlineStart: \"1.75rem\",\n\t\t\t\t\t\t\t\t\t\tfontSize: \"1rem\",\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\twhen(\n\t\t\t\t\t\t\t\t\t\"& li::before\",\n\t\t\t\t\t\t\t\t\traw({\n\t\t\t\t\t\t\t\t\t\tcontent: '\"\"',\n\t\t\t\t\t\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t\t\t\t\t\tinsetInlineStart: \"0\",\n\t\t\t\t\t\t\t\t\t\tinsetBlockStart: \"0.3em\",\n\t\t\t\t\t\t\t\t\t\tinlineSize: \"1rem\",\n\t\t\t\t\t\t\t\t\t\tblockSize: \"1rem\",\n\t\t\t\t\t\t\t\t\t\tbackgroundColor: \"var(--ui-brand-fg)\",\n\t\t\t\t\t\t\t\t\t\tmask: CHECK_MASK,\n\t\t\t\t\t\t\t\t\t\tWebkitMask: CHECK_MASK,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t: [],\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n\n/**\n * The media column of a {@link Split}, sized to the track rather than its\n * content so a long sample does not tower over the copy beside it.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the media column.\n * @example\n * <Split.Media>\n * \t<img src={shot} alt={alt} />\n * </Split.Media>\n */\nSplit.Media = function SplitMedia(handle: Handle<Split.MediaProps>) {\n\treturn () => {\n\t\tlet { mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-slot=\"split-media\"\n\t\t\t\tmix={[\n\t\t\t\t\tvstack({ gap: 4, align: \"stretch\" }),\n\t\t\t\t\tminIs(0),\n\t\t\t\t\ttext(\"base\"),\n\t\t\t\t\twhen(\"& pre\", raw({ maxBlockSize: \"22rem\", overflowY: \"auto\" })),\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n};\n"
11
+ },
12
+ "test": {
13
+ "path": "split.test.tsx",
14
+ "content": "/**\n * Covers {@link Split} lean tracks, check-styled copy lists, and media column\n * sizing.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { Split } from \"@sdxc/ui/split\";\n\ndescribe(\"Split\", () => {\n\ttest(\"leans the wider track toward copy when requested\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Split lean=\"copy\">\n\t\t\t\t<Split.Copy>Claims</Split.Copy>\n\t\t\t\t<Split.Media>Shot</Split.Media>\n\t\t\t</Split>,\n\t\t);\n\n\t\texpect(html).toContain('data-lean=\"copy\"');\n\t\texpect(html).toContain(\"container: ui-marketing-split / inline-size\");\n\t\texpect(html).toContain(\"1.15fr\");\n\t\texpect(html).toContain(\"0.85fr\");\n\t\texpect(html).toContain('data-slot=\"split-copy\"');\n\t\texpect(html).toContain('data-slot=\"split-media\"');\n\t});\n\n\ttest(\"marks checked claim lists when checks is set\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<Split.Copy checks>\n\t\t\t\t<ul>\n\t\t\t\t\t<li>Claim one</li>\n\t\t\t\t</ul>\n\t\t\t</Split.Copy>,\n\t\t);\n\n\t\texpect(html).toContain('data-checks=\"true\"');\n\t\texpect(html).toContain(\"list-style: none\");\n\t\texpect(html).toContain(\"-webkit-mask:\");\n\t});\n});\n"
15
+ }
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "stat-strip",
3
+ "changedIn": "2026.10.29",
4
+ "dependencies": [],
5
+ "exports": [
6
+ "StatStrip"
7
+ ],
8
+ "source": {
9
+ "path": "stat-strip.tsx",
10
+ "content": "/**\n * A numeric proof strip for marketing bands: each cell carries a value and a\n * label supplied by the page, laid out as a responsive grid with ruled or\n * gapped seams.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport type { Handle, Props as TagProps, RemixNode } from \"remix/component\";\n\nimport { borderEdge, fg } from \"@sdxc/u/color\";\nimport { container, gap, grid, gridTemplate, repeat, vstack } from \"@sdxc/u/layout\";\nimport { at } from \"@sdxc/u/responsive\";\nimport { p } from \"@sdxc/u/size\";\nimport { when } from \"@sdxc/u/state\";\nimport { balance, leading, text, tracking, weight } from \"@sdxc/u/typography\";\n\n/** Seam treatment {@link StatStrip} applies when `variant` is omitted. */\nconst DEFAULT_VARIANT: StatStrip.Variant = \"ruled\";\n\n/**\n * Prop types for {@link StatStrip} and its compound parts.\n */\nexport namespace StatStrip {\n\t/**\n\t * How cells meet: a hairline between them, or a gap with no rule.\n\t */\n\texport type Variant = \"ruled\" | \"gap\";\n\n\t/**\n\t * Props accepted by {@link StatStrip}.\n\t */\n\texport interface Props extends TagProps<\"div\"> {\n\t\t/** Seam treatment. Defaults to {@link DEFAULT_VARIANT}. */\n\t\tvariant?: Variant;\n\t\t/** One or more {@link StatStrip.Item} cells. */\n\t\tchildren: RemixNode;\n\t}\n\n\t/**\n\t * Props accepted by {@link StatStrip.Item}.\n\t */\n\texport interface ItemProps extends TagProps<\"div\"> {\n\t\t/** What the number counts — always supplied by the page. */\n\t\tlabel: RemixNode;\n\t\t/** The figure itself. */\n\t\tchildren: RemixNode;\n\t}\n}\n\n/**\n * Lays {@link StatStrip.Item} children in a responsive grid that starts at two\n * columns and opens to as many as five above `lg` on its own named container.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the strip's markup.\n * @example\n * <StatStrip>\n * \t<StatStrip.Item label={t(\"stats.packages\")}>42</StatStrip.Item>\n * \t<StatStrip.Item label={t(\"stats.apps\")}>12</StatStrip.Item>\n * </StatStrip>\n */\nexport function StatStrip(handle: Handle<StatStrip.Props>) {\n\treturn () => {\n\t\tlet { mix, variant, ...rest } = handle.props;\n\t\tlet resolvedVariant = variant ?? DEFAULT_VARIANT;\n\t\tlet isRuled = resolvedVariant === \"ruled\";\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\t{...rest}\n\t\t\t\tdata-variant={resolvedVariant}\n\t\t\t\tdata-slot=\"stat-strip\"\n\t\t\t\tmix={[\n\t\t\t\t\tcontainer(\"ui-marketing-stat-strip\"),\n\t\t\t\t\tgrid(),\n\t\t\t\t\tisRuled ? gap(0) : gap(6),\n\t\t\t\t\tgridTemplate({ columns: repeat(2, \"minmax(0, 1fr)\") }),\n\t\t\t\t\tat(\n\t\t\t\t\t\t\"lg\",\n\t\t\t\t\t\t\"ui-marketing-stat-strip\",\n\t\t\t\t\t\tgridTemplate({ columns: repeat(5, \"minmax(0, 1fr)\") }),\n\t\t\t\t\t),\n\t\t\t\t\twhen(\"& > *\", [p(6, 5), at(\"md\", \"ui-marketing-stat-strip\", p(8, 8))]),\n\t\t\t\t\tisRuled\n\t\t\t\t\t\t? when(\n\t\t\t\t\t\t\t\t\"& > * + *\",\n\t\t\t\t\t\t\t\tat(\n\t\t\t\t\t\t\t\t\t\"lg\",\n\t\t\t\t\t\t\t\t\t\"ui-marketing-stat-strip\",\n\t\t\t\t\t\t\t\t\tborderEdge(\"inline-start\", {\n\t\t\t\t\t\t\t\t\t\tcolor: \"neutral\",\n\t\t\t\t\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\t\t\t\t\tstyle: \"solid\",\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: [],\n\t\t\t\t\tmix,\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t};\n}\n\n/**\n * One proof cell: the figure as `children`, and what it counts as `label`.\n *\n * @param handle Runtime handle carrying the host `<div>`'s props.\n * @returns The render function producing the cell's markup.\n * @example\n * <StatStrip.Item label={t(\"stats.uptime\")}>99.99%</StatStrip.Item>\n */\nStatStrip.Item = function StatStripItem(handle: Handle<StatStrip.ItemProps>) {\n\treturn () => {\n\t\tlet { children, label, mix, ...rest } = handle.props;\n\n\t\treturn (\n\t\t\t<div {...rest} data-slot=\"stat-strip-item\" mix={[vstack({ gap: 1, align: \"start\" }), mix]}>\n\t\t\t\t<span\n\t\t\t\t\tmix={[\n\t\t\t\t\t\ttext(\"3xl\"),\n\t\t\t\t\t\tweight(\"medium\"),\n\t\t\t\t\t\ttracking(\"tight\"),\n\t\t\t\t\t\tleading(\"none\"),\n\t\t\t\t\t\tfg(\"neutral.emphasis\"),\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</span>\n\t\t\t\t<span mix={[text(\"sm\"), leading(\"snug\"), balance(), fg(\"neutral\")]}>{label}</span>\n\t\t\t</div>\n\t\t);\n\t};\n};\n"
11
+ },
12
+ "test": {
13
+ "path": "stat-strip.test.tsx",
14
+ "content": "/**\n * Covers {@link StatStrip} ruled and gap variants plus item value/label slots.\n *\n * @author [Sergio Xalambrí](https://sergiodxa.com)\n * @copyright Sergio Xalambrí 2026\n */\n\nimport { renderToString } from \"remix/component/server\";\nimport { describe, expect, test } from \"vitest\";\n\nimport { StatStrip } from \"@sdxc/ui/stat-strip\";\n\ndescribe(\"StatStrip\", () => {\n\ttest(\"renders ruled cells with value and label\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<StatStrip>\n\t\t\t\t<StatStrip.Item label=\"Packages\">42</StatStrip.Item>\n\t\t\t\t<StatStrip.Item label=\"Apps\">12</StatStrip.Item>\n\t\t\t</StatStrip>,\n\t\t);\n\n\t\texpect(html).toContain('data-variant=\"ruled\"');\n\t\texpect(html).toContain(\"42\");\n\t\texpect(html).toContain(\"Packages\");\n\t\texpect(html).toContain(\"border-inline-start\");\n\t\texpect(html).toContain(\"container: ui-marketing-stat-strip / inline-size\");\n\t});\n\n\ttest(\"uses a gap seam when variant is gap\", async () => {\n\t\tlet html = await renderToString(\n\t\t\t<StatStrip variant=\"gap\">\n\t\t\t\t<StatStrip.Item label=\"Uptime\">99.99%</StatStrip.Item>\n\t\t\t</StatStrip>,\n\t\t);\n\n\t\texpect(html).toContain('data-variant=\"gap\"');\n\t\texpect(html).toContain(\"99.99%\");\n\t});\n});\n"
15
+ }
16
+ }
@@ -6,7 +6,7 @@
6
6
  * @see {@link https://sdxc.dev/api/mcp}{{header}}
7
7
  */
8
8
 
9
- import { createResource } from "@sdxc/mcp";
9
+ import { createResource } from "@sdxc/mcp/server";
10
10
 
11
11
  import resourceset from "~/app/mcp/resources";
12
12
 
package/stubs/mcp.stub CHANGED
@@ -6,7 +6,7 @@
6
6
  * @see {@link https://sdxc.dev/api/mcp}{{header}}
7
7
  */
8
8
 
9
- import { createTool } from "@sdxc/mcp";
9
+ import { createTool } from "@sdxc/mcp/server";
10
10
 
11
11
  import toolset from "~/app/mcp/tools";
12
12
 
@@ -7,7 +7,7 @@
7
7
  * @see {@link https://sdxc.dev/api/mcp}{{header}}
8
8
  */
9
9
 
10
- import { createTool, ForbiddenError, ToolError } from "@sdxc/mcp";
10
+ import { createTool, ForbiddenError, ToolError } from "@sdxc/mcp/server";
11
11
  import { isFailure } from "@sdxc/result";
12
12
 
13
13
  import toolset from "~/app/mcp/tools";
@@ -7,7 +7,7 @@
7
7
  * @see {@link https://sdxc.dev/api/mcp}{{header}}
8
8
  */
9
9
 
10
- import { createTool, ForbiddenError, ToolError } from "@sdxc/mcp";
10
+ import { createTool, ForbiddenError, ToolError } from "@sdxc/mcp/server";
11
11
  import { isFailure } from "@sdxc/result";
12
12
 
13
13
  import toolset from "~/app/mcp/tools";
@@ -6,7 +6,7 @@
6
6
  * @see {@link https://sdxc.dev/api/mcp}{{header}}
7
7
  */
8
8
 
9
- import { createTool, ToolError } from "@sdxc/mcp";
9
+ import { createTool, ToolError } from "@sdxc/mcp/server";
10
10
 
11
11
  import toolset from "~/app/mcp/tools";
12
12
  import { {{Name}} } from "~/app/models/{{name}}";
@@ -7,7 +7,7 @@
7
7
  * @see {@link https://sdxc.dev/api/mcp}{{header}}
8
8
  */
9
9
 
10
- import { createTool } from "@sdxc/mcp";
10
+ import { createTool } from "@sdxc/mcp/server";
11
11
 
12
12
  import toolset from "~/app/mcp/tools";
13
13
  import { {{Name}} } from "~/app/models/{{name}}";
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  import { NotFound } from "@sdxc/data-model";
11
- import { createTool, ForbiddenError, ToolError } from "@sdxc/mcp";
11
+ import { createTool, ForbiddenError, ToolError } from "@sdxc/mcp/server";
12
12
  import { isFailure } from "@sdxc/result";
13
13
 
14
14
  import toolset from "~/app/mcp/tools";
@@ -9,7 +9,7 @@
9
9
  import { access } from "@sdxc/authz/middleware/router";
10
10
  import { models } from "@sdxc/data-model/router";
11
11
  import { database } from "@sdxc/database-middleware";
12
- import { LATEST_PROTOCOL_VERSION, MetaKey } from "@sdxc/mcp";
12
+ import { LATEST_PROTOCOL_VERSION, MetaKey } from "@sdxc/mcp/server";
13
13
  import { createRouter } from "remix/router";
14
14
 
15
15
  import { openDatabase } from "~/app/initializers/database";
@@ -109,7 +109,7 @@ bun run test # every test, under Vitest
109
109
  (`app/jobs/billing/`, `app/services/billing/`).
110
110
  - `app/mcp/` declares tools in `tools/index.ts` and resources in `resources/index.ts`, with one
111
111
  handler file per tool or resource beside them; `app/initializers/mcp.ts` maps each one
112
- through `lazy()` from `@sdxc/mcp`. `app/commands/` follows the same shape, with the contract
112
+ through `lazy()` from `@sdxc/mcp/server`. `app/commands/` follows the same shape, with the contract
113
113
  in `app/commands/index.ts` and the wiring in `app/initializers/cli.ts`.
114
114
 
115
115
  ### Writing code
@@ -4,7 +4,7 @@
4
4
  * `lazy()`, so a request imports only the handlers it reaches.
5
5
  */
6
6
 
7
- import { createHandler } from "@sdxc/mcp";
7
+ import { createHandler } from "@sdxc/mcp/server";
8
8
 
9
9
  /** The server `app/http/controllers/mcp.ts` forwards each `/mcp` request to. */
10
10
  const mcp = createHandler({
@@ -3,7 +3,7 @@
3
3
  * person attaches to a conversation. Each handler lives in its own file beside this one.
4
4
  */
5
5
 
6
- import { resources } from "@sdxc/mcp";
6
+ import { resources } from "@sdxc/mcp/server";
7
7
 
8
8
  /** The app's resources; `sdxc make mcp <name> --resource` declares one here and maps it. */
9
9
  export default resources({});
@@ -4,7 +4,7 @@
4
4
  * this one.
5
5
  */
6
6
 
7
- import { tools } from "@sdxc/mcp";
7
+ import { tools } from "@sdxc/mcp/server";
8
8
 
9
9
  /** The app's tools; `sdxc make mcp <name>` declares one here and maps its handler. */
10
10
  export default tools({});
@@ -9,7 +9,7 @@
9
9
  import { access } from "@sdxc/authz/middleware/router";
10
10
  import { models } from "@sdxc/data-model/router";
11
11
  import { database } from "@sdxc/database-middleware";
12
- import { LATEST_PROTOCOL_VERSION, MetaKey } from "@sdxc/mcp";
12
+ import { LATEST_PROTOCOL_VERSION, MetaKey } from "@sdxc/mcp/server";
13
13
  import { createRouter } from "remix/router";
14
14
 
15
15
  import { openDatabase } from "~/app/initializers/database";