Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

feat(cli): add --lang flag and TranslationDoc for i18n/compressed docs (#611)

Joey9e96e789427c
diff --git a/.claude/skills/dense-compression-protocol.md b/.claude/skills/dense-compression-protocol.md
new file mode 100644
index 0000000000..5f8325f507
--- /dev/null
+++ b/.claude/skills/dense-compression-protocol.md
@@ -0,0 +1,66 @@
+# XDS Translation Protocol
+
+Apply this protocol to create a dense (compressed) translation for an XDS component `.doc.mjs` file.
+
+## Task
+
+Read the `docs` export. Produce a `TranslationDoc` object that contains only the compressed prose fields. The CLI merges this onto `docs` at read time, so you only need to provide the fields that change.
+
+## TranslationDoc Shape
+
+```js
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'compressed component description',
+ features: ['compressed feature 1', 'compressed feature 2'],
+ notes: ['compressed note 1', 'compressed note 2'],
+ accessibility: ['compressed a11y item 1'],
+ keyboard: 'compressed keyboard string',
+ propDescriptions: {
+ label: 'compressed desc',
+ variant: 'compressed desc',
+ },
+ // Only for multi-component docs (docs.components)
+ components: [
+ {
+ name: 'XDSDialogHeader',
+ description: 'compressed sub-component desc',
+ propDescriptions: {
+ title: 'compressed desc',
+ },
+ },
+ ],
+};
+```
+
+## What to Compress
+
+Every string value in the TranslationDoc gets compressed:
+
+- Drop articles: a, the, an
+- Drop filler: is used for, provides, supports, displays, whether, when set to
+- Fragments only: "Shows a loading spinner and disables interaction" -> "shows spinner+disables"
+- Shorthand: w/ w/o + -> ;
+
+## What to Include
+
+- `description` always
+- `features` if docs.features exists (same count, same order)
+- `notes` if docs.notes exists (same count, same order)
+- `accessibility` if docs.accessibility exists (same count, same order)
+- `keyboard` if docs.keyboard exists
+- `propDescriptions` one entry per prop that has a description in docs.props
+- `components` if docs.components exists, one entry per sub-component
+
+## What NEVER Changes
+
+Prop names, types, defaults live in `docs`, not in the translation.
+Example code and labels live in `docs`, not in the translation.
+Sub-component names copied exactly from docs.components[n].name.
+
+## Counts Must Match
+
+- features array length must equal docs.features length
+- notes array length must equal docs.notes length
+- accessibility array length must equal docs.accessibility length
+- components array length must equal docs.components length (if present)
diff --git a/.claude/skills/writing-component-docs.md b/.claude/skills/writing-component-docs.md
new file mode 100644
index 0000000000..c6ba8e2d6f
--- /dev/null
+++ b/.claude/skills/writing-component-docs.md
@@ -0,0 +1,118 @@
+# Component Documentation Guide
+
+## Overview
+
+Every component directory has a `{Name}.doc.mjs` file with structured documentation. The XDS CLI reads these files to generate agent-friendly docs, skill files, and reference material.
+
+## Exports
+
+| Export | Type | Purpose | Required? |
+| ----------- | ---------------- | -------------------------------- | ------------------------------- |
+| `docs` | `ComponentDoc` | English docs (source of truth) | Yes |
+| `docsZh` | `TranslationDoc` | Chinese Simplified prose overlay | Optional, falls back to English |
+| `docsDense` | `TranslationDoc` | Compressed prose overlay | Optional, falls back to English |
+
+**English first.** When adding a new component, write the `docs` export. That's it. Both `--lang zh` and `--lang dense` fall back to English if their exports don't exist. Translations are generated from English by AI and can be added later.
+
+## Architecture
+
+`docs` contains everything: props, examples, types, defaults, and English prose. Translations only override the prose. The CLI merges them at read time.
+
+```
+docs (English, full) <- source of truth
+ + docsZh (prose only) <- merged onto docs when --lang zh
+ + docsDense (prose only) <- merged onto docs when --lang dense
+```
+
+This means:
+
+- Examples are defined once in `docs`, shared across all languages
+- Prop names, types, defaults are defined once in `docs`
+- Adding a new example only requires editing `docs`
+- Translations only need to be updated when prose changes
+
+## Writing `docs` (English)
+
+See `docs-types.ts` for the full type definition.
+
+```js
+/** @type {import('../docs-types').ComponentDoc} */
+export const docs = {
+ name: 'Button',
+ description:
+ 'XDSButton component with multiple variants, sizes, and isLoading state.',
+ features: [
+ 'Variants: primary, secondary, ghost, destructive',
+ 'Sizes: sm (28px), md (32px), lg (36px)',
+ ],
+ props: [
+ {
+ name: 'label',
+ type: 'string',
+ description: 'Accessible label.',
+ required: true,
+ },
+ {
+ name: 'variant',
+ type: "'primary' | 'secondary' | 'ghost' | 'destructive'",
+ description: 'Visual style.',
+ default: "'secondary'",
+ },
+ ],
+ examples: [
+ {label: 'Basic', code: '<XDSButton label="Save" variant="primary" />'},
+ ],
+ accessibility: ['Uses native <button> with proper ARIA attributes.'],
+ keyboard: 'Enter/Space activates; Tab moves focus.',
+ notes: ['Prefer XDSButton over <div onClick> for accessibility.'],
+};
+```
+
+## Writing Translations (docsZh / docsDense)
+
+Translations use the `TranslationDoc` type. Only prose fields, no structure.
+
+```js
+// -------------------------------------------------------
+// Auto-generated translations below. Do not edit manually.
+// Regenerate with the dense compression protocol.
+// See .context/decisions/dense-compression-protocol.md
+// -------------------------------------------------------
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'multi-variant btn w/ loading state',
+ features: [
+ '4 variants: primary secondary ghost destructive',
+ 'sizes: sm 28px, md 32px, lg 36px',
+ ],
+ propDescriptions: {
+ label: 'a11y label; aria-label for icon-only',
+ variant: 'visual style',
+ },
+ accessibility: ['native <button> w/ proper ARIA attrs'],
+ keyboard: 'Enter/Space=activate; Tab=move focus',
+ notes: ['prefer over div onClick for a11y'],
+};
+```
+
+The CLI merges this onto `docs`: compressed descriptions replace English ones, but props, examples, types, and defaults all come from `docs`.
+
+## Adding a New Component's Docs
+
+1. Create `packages/core/src/MyComponent/MyComponent.doc.mjs`
+2. Write the `docs` export (English, required)
+3. Optionally add `docsZh` and `docsDense` (both fall back to English if missing)
+4. The CLI discovers doc files automatically, no registration needed
+
+## CLI Flags
+
+```bash
+npx xds component Button # English docs (default)
+npx xds component Button --compact # Token-optimized format
+npx xds component Button --brief # Minimal one-line summary
+npx xds --lang zh component Button # Chinese prose, same structure
+npx xds --lang dense component Button # Compressed prose, same structure
+```
+
+`--lang` controls which prose translation is used. `--compact`, `--brief`, `--full` control how much detail. They compose independently.
diff --git a/packages/cli/src/commands/agent-docs.mjs b/packages/cli/src/commands/agent-docs.mjs
index adae913f3e..8af808637d 100644
--- a/packages/cli/src/commands/agent-docs.mjs
+++ b/packages/cli/src/commands/agent-docs.mjs
@@ -21,7 +21,7 @@ const XDS_MARKER_END = '<!-- XDS:END -->';
* Directs agents to use CLI commands for retrieval.
* When zh=true, outputs a Chinese Simplified version (placeholder: same content for now).
*/
-export function generateCompressedIndex(version, {zh = false} = {}) {
+export function generateCompressedIndex(version, {zh = false, lang} = {}) {
// TODO: Replace with actual Chinese Simplified translations
// For now, zh mode outputs the same English content as a placeholder
return `${XDS_MARKER_START}
@@ -96,9 +96,9 @@ export function injectXdsBlock(filePath, compressedIndex, {createIfMissing = fal
* Inject or update XDS section in AGENTS.md.
* Always creates the file if it doesn't exist.
*/
-export function injectAgentsMd(targetDir, version, {zh = false} = {}) {
+export function injectAgentsMd(targetDir, version, {zh = false, lang} = {}) {
const agentsPath = path.join(targetDir, AGENTS_MD);
- const compressedIndex = generateCompressedIndex(version, {zh});
+ const compressedIndex = generateCompressedIndex(version, {zh, lang});
injectXdsBlock(agentsPath, compressedIndex, {
createIfMissing: true,
header: `# AGENTS.md\n\nProject-specific guidance for AI coding agents.`,
@@ -111,9 +111,9 @@ export function injectAgentsMd(targetDir, version, {zh = false} = {}) {
*
* @returns {boolean} Whether the file was written
*/
-export function injectClaudeMd(targetDir, version, {zh = false} = {}) {
+export function injectClaudeMd(targetDir, version, {zh = false, lang} = {}) {
const claudePath = path.join(targetDir, CLAUDE_MD);
- const compressedIndex = generateCompressedIndex(version, {zh});
+ const compressedIndex = generateCompressedIndex(version, {zh, lang});
return injectXdsBlock(claudePath, compressedIndex);
}
@@ -177,19 +177,19 @@ export function removeAgentDocs(targetDir) {
* - If only AGENTS.md exists (or neither), inject into AGENTS.md
* - If both exist, inject into both
*/
-export function installAgentDocs(targetDir, {zh = false} = {}) {
+export function installAgentDocs(targetDir, {zh = false, lang} = {}) {
const coreDir = findCoreDir(targetDir);
const version = getXdsVersion(coreDir);
const hasClaudeMd = fs.existsSync(path.join(targetDir, CLAUDE_MD));
const hasAgentsMd = fs.existsSync(path.join(targetDir, AGENTS_MD));
if (hasClaudeMd) {
- injectClaudeMd(targetDir, version, {zh});
+ injectClaudeMd(targetDir, version, {zh, lang});
if (hasAgentsMd) {
- injectAgentsMd(targetDir, version, {zh});
+ injectAgentsMd(targetDir, version, {zh, lang});
}
} else {
- injectAgentsMd(targetDir, version, {zh});
+ injectAgentsMd(targetDir, version, {zh, lang});
}
}
@@ -203,6 +203,7 @@ export function registerAgentDocs(program) {
const coreDir = findCoreDir(targetDir);
const version = getXdsVersion(coreDir);
const zh = program.opts().zh || false;
+ const lang = program.opts().lang || null;
if (options.remove) {
console.log('\n🗑️ Removing XDS agent docs...\n');
@@ -218,16 +219,16 @@ export function registerAgentDocs(program) {
const targets = [];
if (hasClaudeMd) {
- injectClaudeMd(targetDir, version, {zh});
+ injectClaudeMd(targetDir, version, {zh, lang});
console.log(`✓ Injected compressed index into ${CLAUDE_MD}`);
targets.push(CLAUDE_MD);
if (hasAgentsMd) {
- injectAgentsMd(targetDir, version, {zh});
+ injectAgentsMd(targetDir, version, {zh, lang});
console.log(`✓ Injected compressed index into ${AGENTS_MD}`);
targets.push(AGENTS_MD);
}
} else {
- injectAgentsMd(targetDir, version, {zh});
+ injectAgentsMd(targetDir, version, {zh, lang});
console.log(`✓ Injected compressed index into ${AGENTS_MD}`);
targets.push(AGENTS_MD);
}
diff --git a/packages/cli/src/commands/component.mjs b/packages/cli/src/commands/component.mjs
index ad8113f500..a3af2ba748 100644
--- a/packages/cli/src/commands/component.mjs
+++ b/packages/cli/src/commands/component.mjs
@@ -124,16 +124,77 @@ export function discoverComponents(coreDir) {
return ordered;
}
+/**
+ * Merge a TranslationDoc overlay onto a base ComponentDoc.
+ * Replaces prose fields (description, features, notes, accessibility, keyboard,
+ * prop descriptions) while keeping structure (props, examples, types, defaults).
+ */
+function mergeTranslation(docs, translation) {
+ if (!translation) return docs;
+
+ const merged = {...docs};
+ if (translation.description) merged.description = translation.description;
+ if (translation.features) merged.features = translation.features;
+ if (translation.notes) merged.notes = translation.notes;
+ if (translation.accessibility) merged.accessibility = translation.accessibility;
+ if (translation.keyboard) merged.keyboard = translation.keyboard;
+
+ // Merge prop descriptions for single-component docs
+ if (translation.propDescriptions && merged.props) {
+ merged.props = merged.props.map(prop => {
+ const desc = translation.propDescriptions[prop.name];
+ return desc != null ? {...prop, description: desc} : prop;
+ });
+ }
+
+ // Merge sub-component translations
+ if (translation.components && merged.components) {
+ merged.components = merged.components.map((comp, i) => {
+ const trans = translation.components.find(t => t.name === comp.name)
+ || translation.components[i];
+ if (!trans) return comp;
+
+ const mergedComp = {...comp};
+ if (trans.description) mergedComp.description = trans.description;
+ if (trans.propDescriptions && comp.props) {
+ mergedComp.props = comp.props.map(prop => {
+ const desc = trans.propDescriptions[prop.name];
+ return desc != null ? {...prop, description: desc} : prop;
+ });
+ }
+ return mergedComp;
+ });
+ }
+
+ return merged;
+}
+
/**
* Load the typed docs object from a .doc.mjs file.
- * When zh=true, returns docsZh export if available, falling back to docs.
+ * Supports --lang flag: 'zh' for Chinese, 'dense' for compressed format.
+ * Also supports legacy --zh and --dense flags.
+ * Translations are merged onto the base docs, keeping structure intact.
*/
-export async function loadDocs(readmePath, {zh = false} = {}) {
+export async function loadDocs(readmePath, {zh = false, dense = false, lang} = {}) {
const mod = await import(pathToFileURL(readmePath).href);
- if (zh && mod.docsZh) {
- return mod.docsZh;
+ const docs = mod.docs;
+
+ // Resolve which translation to use (--lang takes priority over legacy flags)
+ const locale = lang || (dense ? 'dense' : zh ? 'zh' : null);
+ if (!locale) return docs;
+
+ const translationKey = locale === 'zh' ? 'docsZh' : locale === 'dense' ? 'docsDense' : null;
+ if (!translationKey || !mod[translationKey]) return docs;
+
+ const translation = mod[translationKey];
+
+ // If the translation is a full ComponentDoc (legacy docsZh shape), return it directly
+ if (translation.props || translation.components?.some(c => c.props)) {
+ return translation;
}
- return mod.docs;
+
+ // Otherwise it's a TranslationDoc — merge it onto docs
+ return mergeTranslation(docs, translation);
}
/**
@@ -1046,7 +1107,7 @@ export function formatProps(docs, componentName) {
/**
* Format brief summaries for ALL components in one output.
*/
-export async function formatBriefAll(coreDir, {zh = false} = {}) {
+export async function formatBriefAll(coreDir, {zh = false, lang} = {}) {
const components = discoverComponents(coreDir);
const output = [];
@@ -1054,10 +1115,15 @@ export async function formatBriefAll(coreDir, {zh = false} = {}) {
output.push(`## ${category}\n`);
for (const comp of comps) {
const readmePath = findComponentReadme(coreDir, comp);
- if (readmePath) {
- const docs = await loadDocs(readmePath, {zh});
+ if (readmePath && readmePath.endsWith('.doc.mjs')) {
+ const docs = await loadDocs(readmePath, {zh, lang});
const importPath = resolveImportPath(coreDir, comp);
output.push(formatBrief(docs, comp, importPath));
+ } else if (readmePath) {
+ // Legacy README.md path
+ const content = fs.readFileSync(readmePath, 'utf-8');
+ const importPath = resolveImportPath(coreDir, comp);
+ output.push(extractBrief(content, comp, importPath));
} else {
output.push(`XDS${comp}\n (no docs)\n`);
}
@@ -1081,6 +1147,8 @@ export function registerComponent(program) {
.action(async (name, options) => {
const coreDir = findCoreDir(process.cwd());
const zh = program.opts().zh || false;
+ const dense = program.opts().dense || false;
+ const lang = program.opts().lang || null;
if (!coreDir) {
console.error(
@@ -1091,7 +1159,7 @@ export function registerComponent(program) {
}
if (options.briefAll) {
- console.log(await formatBriefAll(coreDir, {zh}));
+ console.log(await formatBriefAll(coreDir, {zh, lang}));
return;
}
@@ -1176,7 +1244,7 @@ export function registerComponent(program) {
}
if (readmePath.endsWith('.doc.mjs')) {
- const docs = await loadDocs(readmePath, {zh});
+ const docs = await loadDocs(readmePath, {zh, dense, lang});
const importHint = resolveImportPath(coreDir, resolvedName);
if (options.props) {
console.log(formatProps(docs, resolvedName));
diff --git a/packages/cli/src/index.mjs b/packages/cli/src/index.mjs
index 8e193fe26d..d0ffd9a2a4 100644
--- a/packages/cli/src/index.mjs
+++ b/packages/cli/src/index.mjs
@@ -22,6 +22,8 @@ program
.description('XDS design system CLI — components, themes, and tooling')
.version('0.0.1')
.option('--zh', 'Output docs in Chinese Simplified')
+ .option('--dense', 'Output docs in compressed dense format (token-efficient)')
+ .option('--lang <locale>', 'Output docs in specified language/format (en, zh, dense)')
.addHelpCommand('help', 'Show all commands')
.action(() => {
program.help();
diff --git a/packages/core/src/AppShell/AppShell.doc.mjs b/packages/core/src/AppShell/AppShell.doc.mjs
index 6f5c971ff3..9392a381b9 100644
--- a/packages/core/src/AppShell/AppShell.doc.mjs
+++ b/packages/core/src/AppShell/AppShell.doc.mjs
@@ -498,3 +498,50 @@ const isMobile = useMediaQuery('(max-width: 768px)');
'在 "fill" 高度模式下,外壳填满 100dvh,TopNav 固定在顶部,SideNav 和内容区域各有独立的滚动容器。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'app-level layout shell w/ header, side nav, main content; composes XDSLayout internally, replaces XDSPage+XDSPageLayout',
+ features: [
+ 'two nav slots: topNav (horizontal bar) + sideNav (vertical sidebar)',
+ 'two height modes: fill (viewport 100dvh, independent scroll) + auto (page-scroll w/ sticky nav)',
+ 'controlled+uncontrolled sideNav collapse w/ responsive auto-collapse via sideNavBreakpoint',
+ 'mobile: collapsed sideNav renders as overlay w/ backdrop',
+ 'composes XDSLayout internally for auto padding collapse, scroll containment, slot awareness',
+ 'semantic HTML: <main> role="main", SideNav role="navigation", skip-to-content link',
+ 'Escape closes mobile sideNav overlay',
+ ],
+ notes: [
+ 'w/ TopNav, omit SideNavHeading from SideNav to avoid double identity',
+ 'w/o TopNav, include SideNavHeading for app name+logo',
+ 'composes XDSLayout: topNav+banner map to XDSLayoutHeader, sideNav to XDSLayoutPanel, children to XDSLayoutContent',
+ 'collapse animations snap open/closed; ViewTransitions planned',
+ '"auto" height: TopNav sticky top:0, SideNav sticky top:<header-height>',
+ '"fill" height: 100dvh, TopNav pinned, SideNav+content have independent scroll',
+ ],
+ accessibility: [
+ 'semantic HTML via XDSLayout slots, each slot maps to landmark element',
+ '<main> has role="main" for landmark nav',
+ 'SideNav has role="navigation" w/ aria-label="Application navigation"',
+ 'skip-to-content link visually hidden, shown on focus for keyboard users',
+ 'Escape closes mobile sideNav overlay',
+ ],
+ propDescriptions: {
+ children: 'main content area, rendered inside <main>',
+ topNav: 'top nav slot, typically XDSTopNav',
+ sideNav: 'side nav slot, typically XDSSideNav',
+ mobileNav: 'mobile nav slot, typically XDSMobileNav; rendered below sideNavBreakpoint',
+ banner: 'slot for system-wide announcements above topNav',
+ height:
+ 'fill=viewport 100dvh w/ independent scroll; auto=content-driven w/ sticky nav',
+ isSideNavCollapsed: 'sideNav collapsed (controlled)',
+ defaultIsSideNavCollapsed: 'initial collapsed state (uncontrolled)',
+ onSideNavCollapsedChange: 'callback on sideNav collapse change',
+ sideNavBreakpoint: 'auto-collapse breakpoint; "none" disables responsive collapse',
+ sideNavWidth: 'sideNav panel width in px',
+ variant:
+ 'nav bg style: wash=wash bg, surface=surface bg, section=dividers, elevated=wash nav w/ elevated surface content+radius',
+ xstyle: 'StyleX layout customization via stylex.create()',
+ },
+};
diff --git a/packages/core/src/AspectRatio/AspectRatio.doc.mjs b/packages/core/src/AspectRatio/AspectRatio.doc.mjs
index 717dc0d2c9..fce1ea5244 100644
--- a/packages/core/src/AspectRatio/AspectRatio.doc.mjs
+++ b/packages/core/src/AspectRatio/AspectRatio.doc.mjs
@@ -110,3 +110,18 @@ export const docsZh = {
],
},
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'maintains specific aspect ratio for children',
+ features: [
+ 'any numeric ratio as width/height (e.g. 16/9, 4/3, 1)',
+ 'children positioned absolutely to fill container',
+ 'themeable via aspectRatio component key',
+ ],
+ propDescriptions: {
+ ratio: 'width/height ratio (e.g. 16/9, 1)',
+ children: 'content positioned absolutely to fill container',
+ xstyle: 'StyleX layout customization via stylex.create()',
+ },
+};
diff --git a/packages/core/src/Avatar/Avatar.doc.mjs b/packages/core/src/Avatar/Avatar.doc.mjs
index 673eb99720..c9235ea6df 100644
--- a/packages/core/src/Avatar/Avatar.doc.mjs
+++ b/packages/core/src/Avatar/Avatar.doc.mjs
@@ -302,3 +302,49 @@ export const docsZh = {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'user avatar w/ profile pictures + fallback support',
+ features: [
+ 'image loading: primary + fallback sources',
+ 'initials fallback: auto-generates from user name',
+ 'default icon: generic person icon w/o image or name',
+ 'sizes: tiny(20px), xsmall(24px), small(36px), medium(48px), large(128px) + numeric px',
+ 'status slot: corner position for indicators/badges',
+ 'size-aware status dot: XDSAvatarStatusDot scales proportionally w/ avatar',
+ 'proper role + aria-label support',
+ ],
+ notes: [
+ 'always circular (border-radius: 50%)',
+ 'color.deemphasized + color.textSecondary for fallback bg',
+ 'initials from first+last word of name',
+ 'XDSAvatarSizeContext gives resolved numeric size to sub-components',
+ 'status dot uses CIRCLE_EDGE_OFFSET_RATIO for 45 deg circle edge positioning',
+ 'fallback cascade: src, fallbackSrc, initials from name, generic person icon',
+ 'status dot tiers: avatar <=36px: 8px dot 1px border; 40-72px: 16px dot 2px border; >=96px: 24px dot 4px border',
+ ],
+ components: [
+ {
+ name: 'XDSAvatar',
+ description: 'user avatar w/ image, initials fallback, optional status indicator',
+ propDescriptions: {
+ src: 'primary image URL',
+ fallbackSrc: 'fallback image on primary fail',
+ name: 'user name for initials+alt text',
+ alt: 'alt text (falls back to name)',
+ size: 'avatar size (named or numeric px)',
+ status: 'corner content for status indicators',
+ },
+ },
+ {
+ name: 'XDSAvatarStatusDot',
+ description: 'size-aware status dot, reads avatar size from context + scales proportionally',
+ propDescriptions: {
+ variant: 'semantic color variant',
+ label: 'accessible label for screen readers',
+ icon: 'icon centered in dot (hidden at tiny sizes)',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/Badge/Badge.doc.mjs b/packages/core/src/Badge/Badge.doc.mjs
index 155784c40e..327fd81784 100644
--- a/packages/core/src/Badge/Badge.doc.mjs
+++ b/packages/core/src/Badge/Badge.doc.mjs
@@ -98,3 +98,13 @@ export const docsZh = {
],
},
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'badge for status indicators, counts, or labels',
+ propDescriptions: {
+ variant: 'visual style variant',
+ children: 'badge content; omit for dot indicator',
+ icon: 'optional leading icon',
+ },
+};
diff --git a/packages/core/src/Banner/Banner.doc.mjs b/packages/core/src/Banner/Banner.doc.mjs
index 41fc22b876..bfb784f1c9 100644
--- a/packages/core/src/Banner/Banner.doc.mjs
+++ b/packages/core/src/Banner/Banner.doc.mjs
@@ -250,3 +250,39 @@ export const docsZh = {
'折叠支持已规划:内容区将通过 useXDSCollapsible 支持折叠(issue #187)',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'persistent status notification for info, warning, error, success messages',
+ features: [
+ 'two-part layout: colored status header w/ icon+title+description+actions+dismiss; optional card-bg content below',
+ 'w/o children, only colored header renders',
+ 'self-managed dismiss state, hides w/o external state wiring',
+ 'onDismiss fires alongside internal state change for logging/backend sync',
+ 'default status icons from @heroicons/react/24/solid: InformationCircleIcon, ExclamationTriangleIcon, XCircleIcon, CheckCircleIcon',
+ 'status colors: info=accent-deemphasized, warning=warning-deemphasized, error=negative-deemphasized, success=positive-deemphasized',
+ 'card variant (default): border-radius w/ optional card content below header',
+ 'section variant: no border-radius, full-width for page-level banners',
+ ],
+ notes: [
+ 'collapsible support planned via useXDSCollapsible (issue #187)',
+ ],
+ accessibility: [
+ 'role="alert" for error+warning',
+ 'role="status" for info+success',
+ 'dismiss button has aria-label="Dismiss"',
+ 'status icon aria-hidden="true", status conveyed by ARIA role',
+ ],
+ propDescriptions: {
+ status: 'controls icon+color',
+ title: 'title text/ReactNode in header',
+ description: 'text below title in header',
+ icon: 'override default status icon',
+ isDismissable: 'user can dismiss banner',
+ onDismiss: 'dismiss callback; banner self-hides regardless',
+ endContent: 'end-aligned action in header, typically button/link',
+ variant: 'card=border-radius; section=full-width no radius for page-level',
+ children: 'content in card-bg area below colored header',
+ xstyle: 'StyleX layout customization via stylex.create()',
+ },
+};
diff --git a/packages/core/src/Breadcrumbs/Breadcrumbs.doc.mjs b/packages/core/src/Breadcrumbs/Breadcrumbs.doc.mjs
index ce59b50fb0..14e2ec87a0 100644
--- a/packages/core/src/Breadcrumbs/Breadcrumbs.doc.mjs
+++ b/packages/core/src/Breadcrumbs/Breadcrumbs.doc.mjs
@@ -338,3 +338,48 @@ export const docsZh = {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'navigation breadcrumb trail w/ semantic HTML',
+ features: [
+ 'renders <nav> landmark w/ ordered breadcrumb list',
+ 'configurable separator between items (default /)',
+ 'two variants: default + supporting (smaller, secondary text)',
+ 'current page marked w/ aria-current="page"',
+ 'separators hidden from assistive tech via aria-hidden',
+ 'startIcon before item labels',
+ 'auto-detects last child as current page w/o isCurrent',
+ ],
+ accessibility: [
+ '<nav aria-label> landmark; label defaults to "Breadcrumb", customizable via label prop',
+ 'items in <ol> w/ <li> wrappers for list semantics',
+ 'current page gets aria-current="page"',
+ 'separators aria-hidden="true" so screen readers skip',
+ 'auto-detects last child as current w/o isCurrent set',
+ ],
+ components: [
+ {
+ name: 'XDSBreadcrumbs',
+ description: 'nav container rendering <nav> w/ ordered breadcrumb list',
+ propDescriptions: {
+ children: 'XDSBreadcrumbItem elements in breadcrumb trail',
+ separator: 'separator between items',
+ variant: 'supporting=smaller w/ secondary text styling',
+ label: 'nav landmark aria-label',
+ xstyle: 'StyleX layout customization via stylex.create()',
+ },
+ },
+ {
+ name: 'XDSBreadcrumbItem',
+ description: 'individual breadcrumb; link w/ href, plain text for current page',
+ propDescriptions: {
+ children: 'label content',
+ href: 'link URL; omit for non-navigable items',
+ onClick: 'click handler',
+ isCurrent: 'marks current page w/ aria-current="page"',
+ startIcon: 'icon before label',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/Button/Button.doc.mjs b/packages/core/src/Button/Button.doc.mjs
index 59bf74b09d..97ed45cb33 100644
--- a/packages/core/src/Button/Button.doc.mjs
+++ b/packages/core/src/Button/Button.doc.mjs
@@ -290,3 +290,37 @@ export const docsZh = {
'纯图标按钮适用于工具栏、操作网格和紧凑控件。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'button w/ multiple variants, sizes, loading state',
+ features: [
+ "variants: primary, secondary, ghost, destructive",
+ 'sizes: sm(28px), md(32px), lg(36px)',
+ 'loading state: shows spinner+disables interaction',
+ 'focus visible: accessible focus outline w/ variant-specific colors',
+ 'hover/active: overlay colors via backgroundImage for consistent layering',
+ ],
+ notes: [
+ 'XDSButtonVariant derived from keyof typeof variants StyleX object',
+ 'hover/active use backgroundImage linear-gradient overlay on base bg',
+ 'destructive variant uses colorTokens.negative for focus outline',
+ 'endSlot wrapped in <span> w/ color:inherit, matches button text across variants',
+ 'icon w/o children=icon-only: square (aspectRatio:1/1), label=aria-label, any ReactNode as icon',
+ 'endSlot ignored for icon-only to preserve square ratio',
+ 'prefer XDSButton over <div onClick> for a11y: keyboard nav, focus management, screen reader',
+ 'icon-only suits toolbars, action grids, compact controls',
+ ],
+ propDescriptions: {
+ label: 'accessible label; aria-label for icon-only buttons',
+ variant: 'visual style variant',
+ size: 'size variant',
+ isLoading: 'shows spinner+disables interaction',
+ icon: 'icon element; w/o children renders square icon-only button',
+ children: 'w/ icon, text rendered next to icon',
+ endSlot: 'trailing icon/badge after label; accepts XDSIcon or XDSBadge; ignored for icon-only; color inherited',
+ tooltip: 'tooltip on hover',
+ onClick: 'standard click handler',
+ onClickAction: 'async click handler; shows loading while promise pending',
+ },
+};
diff --git a/packages/core/src/Calendar/Calendar.doc.mjs b/packages/core/src/Calendar/Calendar.doc.mjs
index dfdbefe882..67f0156aba 100644
--- a/packages/core/src/Calendar/Calendar.doc.mjs
+++ b/packages/core/src/Calendar/Calendar.doc.mjs
@@ -256,3 +256,37 @@ export const docsZh = {
'DateRange 接口:{ start: ISODateString; end: ISODateString }',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'calendar for date selection w/ single+range modes',
+ features: [
+ "selection modes: single (default) + range",
+ 'multi-month: 1 or 2 side by side',
+ 'date constraints: min, max, custom dateConstraints fns',
+ 'weekStartsOn for configurable first day of week',
+ 'optional ISO week number column',
+ 'controlled/uncontrolled via value/defaultValue',
+ ],
+ notes: [
+ 'ISODateString type: YYYY-MM-DD template literal',
+ 'DayOfWeek type: 0|1|2|3|4|5|6',
+ 'DateRange: { start: ISODateString; end: ISODateString }',
+ ],
+ propDescriptions: {
+ mode: 'selection mode',
+ value: 'controlled selected value',
+ defaultValue: 'uncontrolled default value',
+ onChange: 'selection callback',
+ numberOfMonths: 'months to display',
+ min: 'minimum selectable date',
+ max: 'maximum selectable date',
+ dateConstraints: 'custom constraint fns',
+ focusDate: 'controlled visible month',
+ onFocusDateChange: 'navigation callback',
+ hasOutsideDays: 'show days from adjacent months',
+ hasWeekNumbers: 'show ISO week numbers',
+ hasVariableRowCount: 'variable vs fixed 6-row grid',
+ weekStartsOn: 'first day of week (0=Sunday)',
+ },
+};
diff --git a/packages/core/src/Card/Card.doc.mjs b/packages/core/src/Card/Card.doc.mjs
index c0b237bec7..c7f1e467c8 100644
--- a/packages/core/src/Card/Card.doc.mjs
+++ b/packages/core/src/Card/Card.doc.mjs
@@ -186,3 +186,23 @@ export const docsZh = {
],
},
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'elevated container w/ themed styling',
+ features: [
+ 'top-level container for elevated content',
+ 'card appearance: background, shadow, border-radius',
+ 'sets CSS vars for child layout components',
+ 'optional full-bleed mode removes padding for edge-to-edge content',
+ 'composable w/ XDSLayout, XDSCollapsible, XDSCollapsibleGroup',
+ ],
+ propDescriptions: {
+ width: 'card width (number=px, string=as-is)',
+ height: 'card height (number=px, string=as-is)',
+ maxWidth: 'max card width',
+ minHeight: 'min card height',
+ children: 'content inside card',
+ padding: 'internal padding via spacing scale',
+ },
+};
diff --git a/packages/core/src/Center/Center.doc.mjs b/packages/core/src/Center/Center.doc.mjs
index 006269af16..b7141ebeb7 100644
--- a/packages/core/src/Center/Center.doc.mjs
+++ b/packages/core/src/Center/Center.doc.mjs
@@ -140,3 +140,21 @@ export const docsZh = {
],
},
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'centers children horizontally+vertically via flexbox',
+ features: [
+ 'centering on both axes, horizontal only, or vertical only',
+ 'inline-flex mode for inline content like text+icons',
+ 'accepts explicit width+height to size container',
+ ],
+ propDescriptions: {
+ axis: 'centering direction(s)',
+ width: 'container width (px or CSS)',
+ height: 'container height (px or CSS)',
+ isInline: 'use inline-flex for text/icons',
+ children: 'content to center',
+ xstyle: 'StyleX styles for layout (margins, positioning, sizing); must be stylex.create() value',
+ },
+};
diff --git a/packages/core/src/CheckboxInput/CheckboxInput.doc.mjs b/packages/core/src/CheckboxInput/CheckboxInput.doc.mjs
index d3514c0417..a636f563ee 100644
--- a/packages/core/src/CheckboxInput/CheckboxInput.doc.mjs
+++ b/packages/core/src/CheckboxInput/CheckboxInput.doc.mjs
@@ -214,3 +214,29 @@ export const docsZh = {
'焦点轮廓使用标准的 XDS 焦点轮廓令牌。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'checkbox for toggling boolean values',
+ features: [
+ 'accessible; always includes label (can be visually hidden)',
+ 'indeterminate state for "select all" patterns',
+ 'optional description text below label',
+ 'custom styling via StyleX w/ XDS design tokens',
+ 'full disabled state styling',
+ ],
+ notes: [
+ 'hidden native <input type="checkbox"> w/ custom visual overlay',
+ 'visual checkbox responds to hover, focus, checked via CSS sibling selectors',
+ 'label clickable + associated via htmlFor/id',
+ 'focus outline uses XDS focus outline token',
+ ],
+ propDescriptions: {
+ label: 'label text; always rendered for a11y',
+ isLabelHidden: 'visually hide label',
+ description: 'text below label',
+ value: 'checked, unchecked, or indeterminate',
+ onChange: 'callback on state change',
+ isDisabled: 'disable checkbox',
+ },
+};
diff --git a/packages/core/src/Collapsible/Collapsible.doc.mjs b/packages/core/src/Collapsible/Collapsible.doc.mjs
index 447b4ce50f..7a7d84085d 100644
--- a/packages/core/src/Collapsible/Collapsible.doc.mjs
+++ b/packages/core/src/Collapsible/Collapsible.doc.mjs
@@ -440,3 +440,52 @@ export const docsZh = {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'collapsible content primitive + group coordination',
+ features: [
+ 'XDSCollapsible makes content collapsible; trigger toggles content visibility',
+ 'handles state, a11y (aria-expanded, keyboard), chevron indicator',
+ 'uncontrolled (defaultIsOpen), controlled (isOpen/onOpenChange), group-coordinated modes',
+ 'XDSCollapsibleGroup coordinates multiple instances; single or multiple open at once',
+ 'XDSCollapsibleGroup renders no wrapper DOM',
+ 'inside group, defers open/close state to group context via value prop',
+ ],
+ keyboard: 'Enter/Space activates trigger to toggle open/close',
+ accessibility: [
+ 'trigger renders as <button> w/ aria-expanded reflecting open state',
+ 'chevron indicator shows expanded/collapsed visual affordance',
+ ],
+ notes: [
+ 'manages own open/close state by default (uncontrolled)',
+ 'nested in XDSCollapsibleGroup w/ matching value, defers to group context',
+ 'group context exposes isOpen(value) + toggle(value) methods',
+ 'group renders no wrapper DOM; layout is consumer responsibility (e.g. XDSVStack)',
+ ],
+ components: [
+ {
+ name: 'XDSCollapsible',
+ description: 'makes content collapsible; trigger toggles visibility, manages own state or defers to parent group',
+ propDescriptions: {
+ trigger: 'content in trigger area (always visible)',
+ children: 'content that collapses+expands',
+ defaultIsOpen: 'default open state (uncontrolled)',
+ isOpen: 'controlled open state',
+ onOpenChange: 'callback on open state change',
+ value: 'ID for group coordination; required inside XDSCollapsibleGroup',
+ },
+ },
+ {
+ name: 'XDSCollapsibleGroup',
+ description: 'coordinates multiple XDSCollapsible instances; single or multiple open. no wrapper DOM.',
+ propDescriptions: {
+ type: 'one or many items open simultaneously',
+ defaultValue: 'default open item(s) (uncontrolled); string for single, array for multiple',
+ value: 'controlled open item(s)',
+ onChange: 'callback on open items change',
+ children: 'XDSCollapsible instances to coordinate',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/DateInput/DateInput.doc.mjs b/packages/core/src/DateInput/DateInput.doc.mjs
index e92e7bd8d4..d53c35fd8b 100644
--- a/packages/core/src/DateInput/DateInput.doc.mjs
+++ b/packages/core/src/DateInput/DateInput.doc.mjs
@@ -342,3 +342,39 @@ export const docsZh = {
],
},
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'text input w/ calendar popover for date selection',
+ features: [
+ 'manual date entry w/ flexible parsing (various formats)',
+ 'calendar popover via icon click or keyboard',
+ 'date constraints: min, max, custom dateConstraints fns',
+ 'error, warning, success status indicators w/ messages',
+ 'full keyboard nav, focus trapping, screen reader support',
+ 'built on XDSField for consistent label, description, validation',
+ ],
+ keyboard: 'Tab=move between input+calendar icon; Enter/Space on icon=open calendar; Escape=close; Arrow keys=navigate days; PageUp/Down=navigate months',
+ notes: [
+ 'accepts multiple date formats: ISO (2026-01-28), US (01/28/2026, 1/28/2026), written (Jan 28, 2026 / January 28 2026)',
+ 'invalid input reverts to previous valid value on blur',
+ ],
+ propDescriptions: {
+ label: 'label text',
+ isLabelHidden: 'visually hide label',
+ description: 'helper text below label',
+ isOptional: 'show "(optional)" indicator',
+ isRequired: 'mark field required',
+ isDisabled: 'disable input+calendar',
+ value: 'selected date YYYY-MM-DD',
+ onChange: 'callback on date change',
+ min: 'min selectable date (YYYY-MM-DD)',
+ max: 'max selectable date (YYYY-MM-DD)',
+ dateConstraints: 'custom constraint fns to disable specific dates',
+ placeholder: 'placeholder text in input',
+ size: 'input control size',
+ status: 'error/warning/success status w/ message',
+ numberOfMonths: 'months shown simultaneously in calendar popover',
+ xstyle: 'StyleX styles for layout; must be stylex.create() value',
+ },
+};
diff --git a/packages/core/src/Dialog/Dialog.doc.mjs b/packages/core/src/Dialog/Dialog.doc.mjs
index 66395f89d5..eab803e67f 100644
--- a/packages/core/src/Dialog/Dialog.doc.mjs
+++ b/packages/core/src/Dialog/Dialog.doc.mjs
@@ -510,3 +510,58 @@ function Example() {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'modal dialog using native <dialog> w/ auto focus trapping, backdrop, purpose-based dismissal',
+ features: [
+ 'native <dialog>: browser built-in modal via showModal()',
+ 'auto focus trap inside dialog (browser-native)',
+ 'native ::backdrop pseudo-element w/ blur',
+ 'variants: standard (configurable dims) + fullscreen (full viewport)',
+ 'purpose-based dismissal: required, form, info control Escape+backdrop-click',
+ 'static position via position prop',
+ 'proper ARIA attrs + keyboard nav',
+ ],
+ keyboard: 'Escape closes dialog (unless purpose="required"); focus trapped inside while open',
+ accessibility: [
+ 'native <dialog> w/ showModal() for correct ARIA modal semantics',
+ 'focus auto-trapped by browser via showModal()',
+ 'XDSDialogHeader title receives focus on open',
+ ],
+ notes: [
+ 'height unset (grows w/ content), constrained by maxHeight',
+ 'variant="fullscreen" ignores width, maxHeight, position',
+ 'form purpose: backdrop click only allowed before user interaction',
+ 'required=no Escape+no backdrop click; form=no backdrop click after interaction; info=both allowed',
+ 'designed for use w/ XDSLayout as child',
+ ],
+ components: [
+ {
+ name: 'XDSDialog',
+ description: 'modal dialog using native <dialog>',
+ propDescriptions: {
+ isOpen: 'dialog open state',
+ onOpenChange: 'callback on visibility change',
+ children: 'dialog content',
+ width: 'dialog width (px or CSS)',
+ maxHeight: 'max dialog height',
+ position: 'static position; centered by default',
+ variant: 'standard or fullscreen (fills viewport)',
+ purpose: 'dismissal behavior: required=no dismiss; form=no backdrop after interaction; info=both allowed',
+ },
+ },
+ {
+ name: 'XDSDialogHeader',
+ description: 'dialog header w/ title, optional subtitle, close button, start/end content slots',
+ propDescriptions: {
+ title: 'dialog title (receives focus on open)',
+ subtitle: 'subtitle below title',
+ onOpenChange: 'close button callback (omit=no button)',
+ startContent: 'content before title (e.g. back button)',
+ endContent: 'content after title, before close button',
+ hasDivider: 'bottom border',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/Divider/Divider.doc.mjs b/packages/core/src/Divider/Divider.doc.mjs
index f5f2f22f38..50836d0653 100644
--- a/packages/core/src/Divider/Divider.doc.mjs
+++ b/packages/core/src/Divider/Divider.doc.mjs
@@ -143,3 +143,22 @@ export const docsZh = {
],
},
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'visual separator w/ optional label, using XDS design tokens',
+ features: [
+ 'horizontal+vertical orientations',
+ 'optional centered label on divider line',
+ 'subtle+strong visual weight variants',
+ 'full-bleed mode extends to container edges via negative margins',
+ 'themeable via className; target .xds-divider w/ variant+orientation classes',
+ ],
+ propDescriptions: {
+ orientation: 'divider orientation',
+ label: 'optional centered label on divider',
+ variant: 'visual weight of divider line',
+ isFullBleed: 'extend to container edges w/ negative margins',
+ xstyle: 'StyleX styles for layout; must be stylex.create() value',
+ },
+};
diff --git a/packages/core/src/DropdownMenu/DropdownMenu.doc.mjs b/packages/core/src/DropdownMenu/DropdownMenu.doc.mjs
index cef61d4f8a..3ecb5c8658 100644
--- a/packages/core/src/DropdownMenu/DropdownMenu.doc.mjs
+++ b/packages/core/src/DropdownMenu/DropdownMenu.doc.mjs
@@ -646,3 +646,82 @@ export const docsZh = {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'dropdown menu for actionable items in popup',
+ features: [
+ 'customize trigger button via button prop (all XDSButton props)',
+ 'data-driven items via items prop w/ sections+dividers',
+ 'controlled (isMenuOpen/onOpenChange) + uncontrolled modes',
+ 'custom menu width via menuWidth prop (default matches button)',
+ 'group related items w/ optional headers via XDSDropdownMenuSection',
+ 'full keyboard: Arrow keys, Home, End, Enter, Space, Escape',
+ 'proper ARIA roles (menu, menuitem) + attrs',
+ 'optional children render fn w/ XDSDropdownMenuItem helper',
+ ],
+ keyboard: 'Arrow keys=navigate items; Home/End=first/last; Enter/Space=select; Escape=close',
+ accessibility: [
+ 'ARIA roles: menu on popup, menuitem on each item',
+ 'focus returns to trigger button on menu close',
+ 'keyboard nav skips disabled items',
+ ],
+ notes: [
+ 'uses useXDSLayer w/ mode:"context" for CSS anchor positioning',
+ 'uses XDSButton internally w/ ChevronDownIcon inheriting text color',
+ 'items tracked via items prop for keyboard nav',
+ 'light dismiss enabled by default (click outside closes)',
+ ],
+ components: [
+ {
+ name: 'XDSDropdownMenu',
+ description: 'trigger button + popup item list',
+ propDescriptions: {
+ button: 'trigger button props (XDSButton props except onClick)',
+ items: 'menu items, dividers, or sections in popup',
+ isMenuOpen: 'controlled open state',
+ onOpenChange: 'callback on open state change',
+ menuWidth: 'custom menu width; default matches trigger button',
+ onClick: 'trigger button click callback',
+ children: 'custom render fn per item',
+ },
+ },
+ {
+ name: 'XDSDropdownMenuItem',
+ description: 'helper for custom item rendering w/ consistent styling',
+ propDescriptions: {
+ icon: 'icon before label',
+ label: 'primary label text',
+ description: 'secondary text below label',
+ children: 'additional content after label+description',
+ xstyle: 'StyleX styles for root container',
+ },
+ },
+ {
+ name: 'XDSDropdownMenuItemData',
+ description: 'data shape for single actionable menu item via items prop',
+ propDescriptions: {
+ label: 'display label',
+ onClick: 'callback on selection',
+ isDisabled: 'disabled; skipped in keyboard nav',
+ icon: 'icon before label',
+ },
+ },
+ {
+ name: 'XDSDropdownMenuDivider',
+ description: 'visual divider between items in items array',
+ propDescriptions: {
+ type: 'discriminant identifying entry as divider',
+ },
+ },
+ {
+ name: 'XDSDropdownMenuSection',
+ description: 'labeled group of items in items array',
+ propDescriptions: {
+ type: 'discriminant identifying entry as section',
+ title: 'optional header text above section items',
+ items: 'actionable items in this section',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/EmptyState/EmptyState.doc.mjs b/packages/core/src/EmptyState/EmptyState.doc.mjs
index 9387d8dc28..5d686d6e98 100644
--- a/packages/core/src/EmptyState/EmptyState.doc.mjs
+++ b/packages/core/src/EmptyState/EmptyState.doc.mjs
@@ -190,3 +190,31 @@ export const docsZh = {
'标题渲染为 <h3> 元素,保持在文档标题大纲中。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Empty state placeholder for content areas w/ no data. Displays icon/illustration, title, optional description + action buttons.',
+ features: [
+ 'role="status" so screen readers auto-announce empty state',
+ 'Icon slot renders decorative (aria-hidden="true"); no extra labeling needed',
+ 'Title renders as <h3> for correct document outline',
+ 'Actions horizontal by default; stack vertically in compact mode',
+ 'Compact variant reduces spacing for constrained areas',
+ 'Accepts xstyle, className, style for container adjustments',
+ 'Forwarded ref on root <div> container',
+ ],
+ accessibility: [
+ 'Container uses role="status" to announce empty state to screen readers.',
+ 'Icon wrapper has aria-hidden="true"; decorative icons ignored by assistive tech.',
+ 'Title renders as <h3>, keeping it in document heading outline.',
+ ],
+ propDescriptions: {
+ title: 'Primary msg rendered as <h3> inside empty state.',
+ description: 'Optional secondary text w/ additional context below title.',
+ icon: 'Optional icon/illustration above title; rendered decorative (aria-hidden="true").',
+ actions: 'Optional action buttons below description; horizontal by default, vertical when isCompact.',
+ isCompact: 'Enables compact variant w/ reduced spacing for constrained areas.',
+ xstyle: 'StyleX styles for layout customization. Must be stylex.create() value.',
+ },
+};
diff --git a/packages/core/src/Field/Field.doc.mjs b/packages/core/src/Field/Field.doc.mjs
index a633d2af99..86904ef0ff 100644
--- a/packages/core/src/Field/Field.doc.mjs
+++ b/packages/core/src/Field/Field.doc.mjs
@@ -534,3 +534,68 @@ const bioDescId = useId();
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Form field wrapper providing label, description + optional/required indicators.',
+ features: [
+ 'Label support; required for a11y (can be visually hidden)',
+ 'Optional description text between label + input',
+ 'Optional/Required indicators w/ bullet separator',
+ 'Label tooltip; optional info icon w/ tooltip at end of label',
+ 'Label properly associated w/ input via htmlFor/id',
+ 'Styled w/ StyleX; uses XDS design tokens for consistent styling',
+ ],
+ notes: [
+ 'Parent components generate IDs (useId hook).',
+ 'Label always rendered for a11y; use isLabelHidden to hide visually.',
+ 'Hidden label uses CSS technique accessible to screen readers.',
+ 'Description rendered when provided; descriptionID sets element ID for aria-describedby.',
+ 'isOptional + isRequired mutually exclusive; both set shows "Optional".',
+ 'Optional/Required text on same line as label.',
+ ],
+ components: [
+ {
+ name: 'XDSField',
+ description: 'Form field wrapper w/ label, description + optional/required indicators.',
+ propDescriptions: {
+ label: 'Label text for field (always rendered for a11y).',
+ inputID: 'Input element ID (used for label htmlFor).',
+ children: 'Input or control to render.',
+ isLabelHidden: 'Visually hide label (still accessible to screen readers).',
+ description: 'Description text between label + input.',
+ descriptionID: 'ID for description element (use for aria-describedby on input).',
+ isOptional: 'Field optional (mutually exclusive w/ isRequired).',
+ isRequired: 'Field required (mutually exclusive w/ isOptional).',
+ labelIcon: 'Icon before label text.',
+ labelTooltip: 'Tooltip text in info icon at end of label.',
+ xstyle: 'StyleX styles for layout customization. Must be stylex.create() value.',
+ },
+ },
+ {
+ name: 'XDSFieldLabel',
+ description: 'Standalone label w/ optional/required indicators + tooltip support.',
+ propDescriptions: {
+ label: 'Label text.',
+ inputID: 'ID of input this label is for.',
+ isLabelHidden: 'Visually hide label.',
+ isDisabled: 'Associated input disabled.',
+ isOptional: 'Show "Optional" indicator.',
+ isRequired: 'Show "Required" indicator.',
+ labelIcon: 'Icon before label text.',
+ labelTooltip: 'Tooltip text for info icon at end of label.',
+ },
+ },
+ {
+ name: 'XDSFieldStatus',
+ description: 'Status message for form field validation feedback.',
+ propDescriptions: {
+ type: 'Status type.',
+ message: 'Status message text.',
+ id: 'ID for aria-describedby association.',
+ variant: 'Visual variant; attached overlaps input, detached floats below.',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/FormLayout/FormLayout.doc.mjs b/packages/core/src/FormLayout/FormLayout.doc.mjs
index cdd69a0a1a..a711e09573 100644
--- a/packages/core/src/FormLayout/FormLayout.doc.mjs
+++ b/packages/core/src/FormLayout/FormLayout.doc.mjs
@@ -180,3 +180,26 @@ export const docsZh = {
'还通过 rest props 接受标准 HTML div 属性(id、role、aria-* 等)。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Spatial layout container for arranging form fields w/ consistent spacing + direction.',
+ features: [
+ "Three layout modes: 'vertical' (default), 'horizontal', 'horizontal-labels'",
+ 'Direction context via XDSFormLayoutContext; children read current layout direction',
+ 'Responsive: horizontal-labels collapses to vertical on narrow viewports (<=480px)',
+ 'Nestable: inner FormLayout overrides context for children',
+ 'Purely spatial: no form state management or <form> rendering',
+ ],
+ notes: [
+ 'Renders <div> not <form>. Use separate <form> + HTML form attribute for submit buttons.',
+ 'XDSFormLayoutContext provides { direction } to children. Import from @xds/core/FormLayout.',
+ 'Accepts standard HTML div attributes (id, role, aria-*) via rest props.',
+ ],
+ propDescriptions: {
+ direction: 'Field arrangement. Vertical stacks top-to-bottom, horizontal arranges left-to-right w/ equal flex-grow, horizontal-labels uses CSS Grid w/ labels left of inputs (collapses <=480px).',
+ children: 'Form fields to arrange. Accepts XDS inputs + XDSField-wrapped custom controls.',
+ xstyle: 'StyleX styles for layout customization. Must be stylex.create() value.',
+ },
+};
diff --git a/packages/core/src/Grid/Grid.doc.mjs b/packages/core/src/Grid/Grid.doc.mjs
index 1afe0ed504..e4d85008fc 100644
--- a/packages/core/src/Grid/Grid.doc.mjs
+++ b/packages/core/src/Grid/Grid.doc.mjs
@@ -338,3 +338,48 @@ export const docsZh = {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'CSS Grid-based layout w/ responsive auto-fit support.',
+ features: [
+ 'Fixed-column grids via columns prop',
+ 'Responsive auto-fit columns via minChildWidth; items wrap based on available space',
+ 'Combine minChildWidth + columns to cap max columns',
+ 'Gap tokens via SpacingScale for gap, rowGap, columnGap',
+ 'Vertical + horizontal item alignment via align + justify',
+ 'XDSGridSpan lets items span multiple columns/rows',
+ 'Theming support; override root styles via grid component key',
+ ],
+ notes: [
+ 'Use XDSGrid for any grid layout instead of manual CSS grid. Handles gap tokens w/ any column count.',
+ ],
+ components: [
+ {
+ name: 'XDSGrid',
+ description: 'Grid container w/ fixed or responsive auto-fit columns.',
+ propDescriptions: {
+ columns: 'Max number of columns.',
+ minChildWidth: 'Min item width in px; enables responsive auto-fit.',
+ width: 'Container width.',
+ height: 'Container height.',
+ gap: 'Spacing between all items.',
+ rowGap: 'Row spacing; overrides gap for row axis.',
+ columnGap: 'Column spacing; overrides gap for column axis.',
+ align: 'Vertical alignment of items.',
+ justify: 'Horizontal alignment of items.',
+ children: 'Grid content.',
+ xstyle: 'StyleX styles for layout customization. Must be stylex.create() value.',
+ },
+ },
+ {
+ name: 'XDSGridSpan',
+ description: 'Grid item spanning multiple columns/rows.',
+ propDescriptions: {
+ columns: "Columns to span; 'full' spans entire row.",
+ rows: 'Rows to span.',
+ children: 'Content.',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/HoverCard/HoverCard.doc.mjs b/packages/core/src/HoverCard/HoverCard.doc.mjs
index df290e5250..324432bb70 100644
--- a/packages/core/src/HoverCard/HoverCard.doc.mjs
+++ b/packages/core/src/HoverCard/HoverCard.doc.mjs
@@ -368,3 +368,60 @@ export const docsZh = {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Hover/focus triggered overlay for displaying rich, interactive content anchored to trigger element.',
+ features: [
+ 'CSS Anchor Positioning for auto-placement relative to triggers',
+ 'Popover API for top-layer rendering; no React portals needed',
+ 'Hover triggers w/ configurable show + hide delays',
+ 'Focus triggers w/ auto-detection for focusable elements',
+ 'Stay-open when mouse/focus moves into hover card',
+ 'display:contents wrapper preserves children refs',
+ 'Hover indication (dashed underline) for text-only triggers',
+ ],
+ notes: [
+ 'useXDSHoverCard returns describedBy id; pass as aria-describedby on trigger for screen reader support.',
+ 'Merge multiple aria-describedby sources w/ ids.filter(Boolean).join(" ") || undefined.',
+ 'LayerPlacement: above | below | start | end. LayerAlignment: start | center | end.',
+ ],
+ accessibility: [
+ 'Links hover card content to trigger via aria-describedby.',
+ 'Merge multiple aria-describedby sources w/ utility.',
+ 'Escape dismisses hover card + returns focus to trigger.',
+ ],
+ keyboard: 'Escape closes hover card. Focus triggers show/hide based on focusTrigger option.',
+ components: [
+ {
+ name: 'XDSHoverCard',
+ description: 'Component wrapper for hover card overlay; richer overlay triggered on hover/focus.',
+ propDescriptions: {
+ children: 'Trigger element; must accept ref.',
+ content: 'Hover card content.',
+ placement: 'Position relative to anchor element.',
+ alignment: 'Alignment along placement axis.',
+ delay: 'Show delay in ms.',
+ hideDelay: 'Hide delay in ms.',
+ focusTrigger: 'Controls when focus events trigger hover card.',
+ isEnabled: 'Enable/disable hover + focus triggers.',
+ hasHoverIndication: 'Dashed underline on trigger element.',
+ },
+ },
+ {
+ name: 'useXDSHoverCard',
+ description: 'Hook for hover card w/ hover/focus triggers. Builds on useXDSLayer.',
+ propDescriptions: {
+ placement: 'Position relative to anchor element.',
+ alignment: 'Alignment along placement axis.',
+ delay: 'Show delay in ms.',
+ hideDelay: 'Hide delay in ms.',
+ focusTrigger: 'Controls when focus events trigger layer.',
+ isEnabled: 'Enable/disable all hover + focus triggers.',
+ onShow: 'Callback when hover card becomes visible.',
+ onHide: 'Callback when hover card hidden.',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/Icon/Icon.doc.mjs b/packages/core/src/Icon/Icon.doc.mjs
index 0edb8686f4..4f044ffa96 100644
--- a/packages/core/src/Icon/Icon.doc.mjs
+++ b/packages/core/src/Icon/Icon.doc.mjs
@@ -184,3 +184,37 @@ import {Home} from 'lucide-react';
'尺寸规格——xsm:12x12px(密集 UI、徽章、指示器);sm:16x16px(与文本内联、紧凑 UI);md:20x20px(默认,按钮、输入框);lg:24x24px(强调、独立图标)。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Renders icons w/ XDS design system colors + sizes. Supports direct SVG icon components + semantic icon names that adapt to active theme.',
+ features: [
+ "Semantic icon names: use 'close' or 'chevronDown'; resolved from theme icon registry",
+ 'Direct icon components: pass any SVG component (heroicons, lucide, etc.)',
+ "Theme-adaptable: semantic icons auto-match active theme's icon set",
+ 'Built-in fallbacks: 12 lightweight inline SVGs (~1.4KB) ensure rendering w/o theme',
+ 'Theme colors: variants mapped to XDS icon color tokens',
+ 'Consistent sizing: four size options aligned w/ common UI patterns',
+ 'Accessible: icons hidden from screen readers by default (aria-hidden)',
+ ],
+ notes: [
+ 'Semantic name resolution: (1) theme registry if XDSTheme active; (2) built-in fallback inline SVG. Themes accept partial overrides.',
+ 'Component icon passes extra SVG props (aria-label, role) through to SVG element.',
+ 'flexShrink: 0 prevents shrinking in flex containers.',
+ 'String mode wraps in <span> w/ fontSize-based sizing for 1em registry icons.',
+ 'Component mode passes stylex.props directly to SVG for zero-overhead styling.',
+ 'Semantic names: close (CloseButton, TimeInput) chevronDown (DropdownMenu, Selector, TabMenu) chevronLeft/Right (Calendar) check (Selector, TabMenu) checkCircle/xCircle/warning (Input status) info (FieldLabel) calendar (DateInput) clock (TimeInput) externalLink (Link).',
+ 'Color tokens: primary=--color-icon-primary; secondary=--color-icon-secondary; tertiary=--color-icon-tertiary; disabled=--color-icon-disabled; accent=--color-accent; positive=--color-positive; negative=--color-negative; warning=--color-warning; inherit=currentColor.',
+ 'Size: xsm=12x12px sm=16x16px md=20x20px lg=24x24px.',
+ ],
+ accessibility: [
+ 'Icons hidden from screen readers by default via aria-hidden="true"; typically decorative.',
+ 'For meaningful icons: set aria-hidden={false}, role="img", aria-label for accessible context.',
+ ],
+ propDescriptions: {
+ icon: 'Semantic name or SVG icon component.',
+ color: 'Color variant mapped to XDS icon color tokens.',
+ size: 'Icon size.',
+ },
+};
diff --git a/packages/core/src/Kbd/Kbd.doc.mjs b/packages/core/src/Kbd/Kbd.doc.mjs
index c976f3c4a4..39ddb6a269 100644
--- a/packages/core/src/Kbd/Kbd.doc.mjs
+++ b/packages/core/src/Kbd/Kbd.doc.mjs
@@ -136,3 +136,31 @@ export const docsZh = {
'按键显示符号遵循 macOS 惯例(⌘、⌥、⇧、⌃)',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Displays keyboard shortcut as styled <kbd> elements. Use in tooltips, menus + docs to show key combinations.',
+ features: [
+ 'Key parsing; splits "mod+k" into individual styled <kbd> elements',
+ 'Modifier symbols; maps mod/ctrl/alt/shift/enter/backspace/escape/arrows to platform symbols',
+ 'Inline display; renders as inline-flex for use inside text, tooltips + menus',
+ 'Accessible; aria-hidden="true" since shortcuts supplementary to visible labels',
+ ],
+ notes: [
+ 'Fixed 20px height w/ min-width 20px per key badge',
+ 'Uses --color-wash background + --color-text-secondary text color',
+ 'Key display symbols follow macOS conventions (\u2318, \u2325, \u21e7, \u2303)',
+ ],
+ accessibility: [
+ 'Renders w/ aria-hidden="true"; keyboard shortcuts are visual hints, not primary content',
+ 'Uses semantic <kbd> elements for each key',
+ ],
+ keyboard: 'Not interactive; purely presentational',
+ propDescriptions: {
+ keys: 'Shortcut string. "+" separates keys. Special: mod (Cmd on Mac), ctrl, alt, shift, enter, backspace, escape, tab, up, down, left, right.',
+ xstyle: 'StyleX styles for layout customization. Must be stylex.create() value.',
+ className: 'CSS class for root element. Prefer xstyle; className for non-StyleX integration.',
+ style: 'Inline styles for root element. Prefer xstyle; inline styles bypass StyleX optimization.',
+ },
+};
diff --git a/packages/core/src/Layer/Layer.doc.mjs b/packages/core/src/Layer/Layer.doc.mjs
index 4812b3bbc3..ec6f1bab63 100644
--- a/packages/core/src/Layer/Layer.doc.mjs
+++ b/packages/core/src/Layer/Layer.doc.mjs
@@ -178,3 +178,39 @@ layer.show();
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Core hook for overlay positioning using CSS Anchor Positioning + Popover API; no React portals needed. Popover, HoverCard, Tooltip build on this.',
+ features: [
+ 'CSS Anchor Positioning for auto-placement relative to triggers',
+ 'Popover API for top-layer rendering; no React portals needed',
+ 'Type-safe mode system: context (anchor positioning) + fixed (manual coordinates)',
+ 'TypeScript enforces correct render props per mode at compile time',
+ 'Graceful degradation in Firefox: Popover API works, anchor positioning degrades acceptably',
+ 'Full support in Chrome + Safari',
+ ],
+ notes: [
+ 'CSS Anchor Positioning fully supported in Chrome + Safari. Firefox supports Popover API but not anchor positioning; acceptable degradation.',
+ 'Context mode: pass ref to trigger, call render(children, { placement?, alignment? }). Fixed mode: call show() then render(children, { x, y }).',
+ 'LayerPlacement: above | below | start | end. LayerAlignment: start | center | end.',
+ 'For click popovers use XDSPopover (@xds/core/Popover). Hover overlays use XDSHoverCard (@xds/core/HoverCard). Tooltips use XDSTooltip (@xds/core/Tooltip).',
+ ],
+ accessibility: [
+ 'Layer hook provides positioning + visibility foundation. ARIA patterns implemented by higher-level components (XDSPopover, XDSHoverCard, XDSTooltip).',
+ ],
+ keyboard: 'Escape closes any open layer.',
+ components: [
+ {
+ name: 'useXDSLayer',
+ description: 'Core layer hook w/ type-safe modes for positioning (context=anchor, fixed=coordinates).',
+ propDescriptions: {
+ mode: 'Positioning strategy: context uses CSS anchor positioning relative to trigger ref; fixed uses explicit x/y coordinates.',
+ onShow: 'Callback when layer becomes visible.',
+ onHide: 'Callback when layer hidden.',
+ xstyle: 'StyleX styles for layout customization.',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/Layout/Layout.doc.mjs b/packages/core/src/Layout/Layout.doc.mjs
index 5ec520186e..107810b52e 100644
--- a/packages/core/src/Layout/Layout.doc.mjs
+++ b/packages/core/src/Layout/Layout.doc.mjs
@@ -784,3 +784,110 @@ export const docsZh = {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Composable utilities + components for structured layouts w/ container/content separation pattern.',
+ features: [
+ 'Primitive + higher-order architecture; XDSLayoutContainer is primitive; XDSCard, XDSSection higher-order',
+ 'Directional padding via CSS variables; inner/outer, horizontal/vertical padding control',
+ 'Context-aware defaults; components detect slot + self-adjust',
+ 'Automatic RTL support; uses CSS logical properties',
+ 'XDSLayout provides page shell w/ header, sidebar(s), content, footer slots',
+ 'XDSHStack + XDSVStack for simple stacking layouts',
+ 'XDSStackItem for fill/alignment control within stacks',
+ ],
+ notes: [
+ 'Use XDSLayout for page shells + app layouts (header bar, sidebar nav, scrollable content, action footer). Not for simple stacking (use XDSVStack/XDSHStack).',
+ 'XDSLayoutContainer sets CSS vars child components read: --layout-padding-outer-x (outer horizontal), --layout-padding-outer-y (outer vertical), --layout-padding-inner-x (inner horizontal for Header/Footer/Content/Panel), --layout-padding-inner-y (inner vertical for Header/Footer/Content/Panel).',
+ 'Architecture layers top to bottom: Higher-Order (XDSCard, XDSSection), Layout Structure (XDSLayout + Header/Footer/Content/Panel), Primitive (XDSLayoutContainer sets CSS vars), Utilities (XDSHStack, XDSVStack, stack(), stackItem()).',
+ 'All layout utilities + components exported from @xds/core/Layout.',
+ ],
+ components: [
+ {
+ name: 'XDSLayout',
+ description:
+ 'Page shell w/ header, sidebar(s), content, footer slots for full app layouts.',
+ propDescriptions: {
+ content: 'Main content area (center).',
+ header: 'Header slot.',
+ footer: 'Footer slot.',
+ start: 'Start panel (left in LTR).',
+ end: 'End panel (right in LTR).',
+ height: 'Height behavior; fill container or grow w/ content.',
+ },
+ },
+ {
+ name: 'XDSLayoutHeader',
+ description: 'Top bar for page titles, app bars, toolbars.',
+ propDescriptions: {
+ children: 'Header content.',
+ hasDivider: 'Border at bottom edge.',
+ height: 'Header height.',
+ label: 'Accessible label for landmark element.',
+ role: 'ARIA landmark role.',
+ },
+ },
+ {
+ name: 'XDSLayoutContent',
+ description: 'Scrollable main content area.',
+ propDescriptions: {
+ children: 'Content.',
+ isScrollable: 'Enable scrollable overflow.',
+ label: 'Accessible label for landmark element.',
+ role: 'ARIA landmark role.',
+ },
+ },
+ {
+ name: 'XDSLayoutFooter',
+ description: 'Bottom bar for action bars, pagination, status bars.',
+ propDescriptions: {
+ children: 'Footer content.',
+ hasDivider: 'Border at top edge.',
+ height: 'Footer height.',
+ label: 'Accessible label for landmark element.',
+ role: 'ARIA landmark role.',
+ },
+ },
+ {
+ name: 'XDSLayoutPanel',
+ description: 'Sidebar for navigation, settings, inspector panels.',
+ propDescriptions: {
+ children: 'Panel content.',
+ hasDivider: 'Border on appropriate edge.',
+ isScrollable: 'Enable scrollable overflow.',
+ label: 'Accessible label for landmark element.',
+ role: 'ARIA landmark role.',
+ },
+ },
+ {
+ name: 'XDSLayoutContainer',
+ description:
+ 'Primitive setting CSS padding vars; base for XDSCard + XDSSection.',
+ },
+ {
+ name: 'XDSCard',
+ description:
+ 'Card w/ elevation + themed styling, built on XDSLayoutContainer.',
+ },
+ {
+ name: 'XDSSection',
+ description:
+ 'Section w/ background variants (section, transparent, wash), built on XDSLayoutContainer.',
+ },
+ {
+ name: 'XDSHStack',
+ description: 'Horizontal stack arranging children left-to-right.',
+ },
+ {
+ name: 'XDSVStack',
+ description: 'Vertical stack arranging children top-to-bottom.',
+ },
+ {
+ name: 'XDSStackItem',
+ description:
+ 'Stack item w/ fill + alignment control inside XDSHStack or XDSVStack.',
+ },
+ ],
+};
diff --git a/packages/core/src/Link/Link.doc.mjs b/packages/core/src/Link/Link.doc.mjs
index b6b6bebc92..851b9c371a 100644
--- a/packages/core/src/Link/Link.doc.mjs
+++ b/packages/core/src/Link/Link.doc.mjs
@@ -428,3 +428,61 @@ import {XDSLinkProvider} from '@xds/core/Link';
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Styled anchor links w/ multiple variants + polymorphic link infra for custom link components (Next.js Link, React Router Link, etc.).',
+ features: [
+ "Color control: uses XDSText color prop ('active' default, 'secondary', 'inherit', etc.)",
+ 'External links: opens new tab w/ external link icon',
+ 'Tooltip support: displays tooltip text on hover',
+ 'Underline control: always show underline or only on hover',
+ 'Inline support: inherits parent font styles when used within text',
+ 'Standalone mode: applies base font sizing for independent links',
+ 'Disabled state: visual + interaction disabled',
+ 'Focus visible: accessible focus outline',
+ 'Polymorphic link: render as custom component via `as` prop or XDSLinkProvider',
+ ],
+ notes: [
+ 'Links inherit font family, size, line-height, weight from parent elements',
+ 'Use isStandalone when link not inline within other text content',
+ 'isExternalLink auto-sets target="_blank" + rel="noopener noreferrer" for security',
+ 'Disabled state uses aria-disabled + pointer-events: none for accessibility',
+ 'Tooltip wraps link in XDSTooltip when provided',
+ 'XDSLinkComponentType is React.ElementType; allows string tags ("a") + custom components',
+ 'XDSLinkContext separated from XDSLinkProvider (mirrors ThemeContext/XDSTheme pattern); consumers import context w/o full provider',
+ 'XDSLinkProvider memoizes context value to prevent unnecessary re-renders',
+ 'Resolution order: (1) per-component as prop (highest priority), (2) XDSLinkProvider context, (3) native <a> element (default)',
+ 'All XDS link components (XDSLink, XDSTopNavItem, XDSSideNavItem, XDSBreadcrumbItem, XDSTab) support custom link rendering',
+ ],
+ components: [
+ {
+ name: 'XDSLink',
+ description:
+ 'Styled anchor link w/ variants, external link support, polymorphic rendering.',
+ propDescriptions: {
+ as: 'Custom component to render instead of <a>',
+ label: 'Accessible label',
+ href: 'Link destination URL',
+ hasUnderline: 'Always show underline',
+ isDisabled: 'Disables link',
+ isExternalLink: 'Opens new tab w/ external icon',
+ target: 'Where to open linked document',
+ onClick: 'Click event handler',
+ tooltip: 'Tooltip text on hover',
+ isStandalone: 'Applies base font sizing',
+ children: 'Link content',
+ },
+ },
+ {
+ name: 'XDSLinkProvider',
+ description:
+ 'Provider setting default link component for all XDS links in subtree.',
+ propDescriptions: {
+ component: 'Component for all link elements',
+ children: 'Subtree',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/List/List.doc.mjs b/packages/core/src/List/List.doc.mjs
index e97f2159cd..7d332e9742 100644
--- a/packages/core/src/List/List.doc.mjs
+++ b/packages/core/src/List/List.doc.mjs
@@ -387,3 +387,63 @@ export const docsZh = {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Vertical list for rendering item collections w/ consistent spacing, dividers, marker styles. Composition model: XDSList wraps XDSListItem sub-components.',
+ features: [
+ 'Composition model; XDSList wraps XDSListItem sub-components',
+ 'Density variants: compact, balanced, spacious',
+ 'Optional dividers between items',
+ 'Optional header associated via aria-labelledby',
+ 'List marker styles: none, disc, decimal (renders <ol>), circle',
+ 'Interactive items via invisible button or anchor pattern',
+ 'Start + end content slots (icon, avatar, badge, chevron)',
+ ],
+ accessibility: [
+ 'Semantic <ul> / <ol> w/ <li> elements',
+ "role=\"list\" added when listStyle='none' (Safari fix for list semantics removed by CSS list-style:none)",
+ 'aria-labelledby links header element to list',
+ 'aria-selected on selected items',
+ 'aria-disabled on disabled items',
+ 'Dividers are aria-hidden="true"',
+ 'Interactive items keyboard-focusable via Tab',
+ ],
+ notes: [
+ 'Invisible button pattern: onClick wraps label+description in invisible <button> for accessibility. <li> is visual container w/ hover/press styles. startContent + endContent siblings to button (not inside). Container click fires onClick unless from interactive child. :focus-within shows focus outline.',
+ 'When href provided instead of onClick, same invisible pattern uses <a> element.',
+ ],
+ components: [
+ {
+ name: 'XDSList',
+ description: 'List container w/ density, dividers, header support.',
+ propDescriptions: {
+ children: 'List items (XDSListItem components).',
+ density: 'Spacing density for items.',
+ hasDividers: 'Show dividers between items.',
+ header: 'Header content, associated w/ list via aria-labelledby.',
+ listStyle:
+ "List marker style. 'decimal' renders <ol> instead of <ul>.",
+ xstyle:
+ 'StyleX styles for layout customization (margins, positioning, sizing). Must be stylex.create() value.',
+ },
+ },
+ {
+ name: 'XDSListItem',
+ description:
+ 'List item w/ label, description, start/end content slots, interactive patterns.',
+ propDescriptions: {
+ label: 'Primary text.',
+ description: 'Secondary text below label.',
+ startContent: 'Content before label area (e.g. icon, avatar).',
+ endContent: 'Content after label area (e.g. badge, chevron).',
+ onClick: 'Click handler; enables invisible button pattern.',
+ href: 'Link URL; enables invisible anchor pattern.',
+ target: 'Link target attribute, only when href provided.',
+ isDisabled: 'Disabled state; sets aria-disabled.',
+ isSelected: 'Selected state; sets aria-selected.',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/MobileNav/MobileNav.doc.mjs b/packages/core/src/MobileNav/MobileNav.doc.mjs
index e6ef627d21..8547d9a39f 100644
--- a/packages/core/src/MobileNav/MobileNav.doc.mjs
+++ b/packages/core/src/MobileNav/MobileNav.doc.mjs
@@ -293,3 +293,36 @@ const navSections = (
],
},
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Slide-out drawer overlay for mobile navigation. Mobile counterpart to XDSSideNav; accepts same children (XDSSideNavSection, XDSSideNavItem, or any ReactNode).',
+ features: [
+ 'Native <dialog> w/ showModal() for top-layer rendering; no z-index stacking issues',
+ 'Animated slide-in from start or end edge w/ backdrop fade',
+ 'Shares children w/ XDSSideNav; extract nav sections into variable + render in both',
+ 'RTL-aware: auto mirrors slide direction for right-to-left layouts',
+ 'Respects prefers-reduced-motion: reduces animation duration',
+ ],
+ accessibility: [
+ 'Uses native <dialog> w/ showModal() for correct ARIA modal semantics.',
+ "aria-label set to title or 'Navigation' as fallback.",
+ 'Focus trapping provided by showModal() (browser-native).',
+ 'Escape key closes via native cancel event.',
+ 'Backdrop click closes drawer.',
+ 'Body scroll locked while modal open.',
+ ],
+ keyboard:
+ 'Escape closes drawer; Tab/Shift+Tab cycles focus within drawer (browser-native focus trapping)',
+ propDescriptions: {
+ isOpen: 'Whether drawer is open.',
+ onOpenChange:
+ 'Called when drawer visibility changes (backdrop click, Escape key, close button).',
+ children:
+ 'Drawer content; typically XDSSideNavSection/XDSSideNavItem or any ReactNode.',
+ title: 'Optional title at top of drawer.',
+ width: 'Drawer width px. Capped at 85vw to prevent overflow on small screens.',
+ side: 'Slide direction. Start=left LTR, right RTL.',
+ },
+};
diff --git a/packages/core/src/MoreMenu/MoreMenu.doc.mjs b/packages/core/src/MoreMenu/MoreMenu.doc.mjs
index c7c5e25302..6cbda1fe41 100644
--- a/packages/core/src/MoreMenu/MoreMenu.doc.mjs
+++ b/packages/core/src/MoreMenu/MoreMenu.doc.mjs
@@ -305,3 +305,40 @@ export const docsZh = {
'在紧凑空间(表格行、卡片标题)中使用 XDSMoreMenu 作为仅图标的溢出操作。使用 XDSDropdownMenu 作为带标签和箭头的触发按钮。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Overflow menu w/ three-dot icon trigger. Convenience wrapper composing icon-only XDSButton w/ dropdown menu, eliminating boilerplate for state management, positioning, accessibility.',
+ features: [
+ "Zero-config defaults: three-dot icon, 'More options' label, ghost variant; just pass items",
+ 'Data-driven items: same items prop as XDSDropdownMenu (items, dividers, sections)',
+ 'Icon-only trigger: always renders as square icon button w/ aria-label',
+ 'Tooltip: shows label on hover, hidden when menu open',
+ 'Custom rendering: optional children render function for custom item content',
+ ],
+ accessibility: [
+ 'Proper ARIA roles: menu + menuitem on dropdown elements.',
+ 'Trigger button has aria-haspopup="menu" + aria-expanded.',
+ 'aria-activedescendant tracks highlighted menu item.',
+ 'Disabled items have aria-disabled set.',
+ 'Sections use role="group" w/ aria-label.',
+ ],
+ keyboard:
+ 'Arrow keys navigate items; Home/End jump to first/last; Enter/Space select highlighted item; Escape closes menu',
+ notes: [
+ 'For full control over trigger rendering or menu content, compose XDSButton + useXDSLayer + XDSDropdownMenuItem directly.',
+ 'Use XDSMoreMenu for icon-only overflow actions in tight spaces (table rows, card headers). Use XDSDropdownMenu for labeled trigger buttons w/ chevrons.',
+ ],
+ propDescriptions: {
+ items: 'Menu items (actions, dividers, sections). Same type as XDSDropdownMenu items.',
+ label: 'Accessible label (aria-label) + tooltip text.',
+ variant: 'Trigger button visual style variant.',
+ size: 'Trigger button size.',
+ icon: 'Override default three-dot icon. Accepts any ReactNode.',
+ isDisabled: 'Whether menu trigger disabled.',
+ children: 'Custom render function for selectable items (not dividers/sections).',
+ xstyle:
+ 'StyleX styles for layout customization (margins, positioning, sizing). Must be stylex.create() value.',
+ },
+};
diff --git a/packages/core/src/NavIcon/NavIcon.doc.mjs b/packages/core/src/NavIcon/NavIcon.doc.mjs
index 53556474ad..e677489713 100644
--- a/packages/core/src/NavIcon/NavIcon.doc.mjs
+++ b/packages/core/src/NavIcon/NavIcon.doc.mjs
@@ -108,3 +108,17 @@ export const docsZh = {
],
},
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Circular icon container w/ accent background for navigation headers.',
+ features: [
+ 'Shared; used in both XDSTopNavHeading + XDSPageNavHeader',
+ 'Accent background; uses --color-accent w/ --color-icon-on-media contrast',
+ 'Fixed size; renders at medium (--size-md) design token size',
+ ],
+ propDescriptions: {
+ icon: 'Icon element inside circular background. Should be XDSIcon or similar.',
+ },
+};
diff --git a/packages/core/src/NumberInput/NumberInput.doc.mjs b/packages/core/src/NumberInput/NumberInput.doc.mjs
index 44997a2f4a..3944a84de7 100644
--- a/packages/core/src/NumberInput/NumberInput.doc.mjs
+++ b/packages/core/src/NumberInput/NumberInput.doc.mjs
@@ -474,3 +474,64 @@ export const docsZh = {
'单位以浅灰色后缀显示在输入值之后。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Number input component for collecting numeric user input w/ validation.',
+ features: [
+ 'Label support; required label for accessibility (can be visually hidden)',
+ 'Description; optional text between label + input',
+ 'Optional/Required indicators; display "Optional" or "Required" w/ bullet separator',
+ 'Label tooltip; optional info icon w/ tooltip at label end',
+ 'Label icon; optional icon before label text',
+ 'Accessible; label associated w/ input via htmlFor/id',
+ 'Styled w/ StyleX; uses XDS design tokens for consistent styling',
+ 'Size variants; three sizes (sm, md, lg) for different contexts',
+ 'Status handling; error, warning, success states w/ messages',
+ 'Number constraints; support for min, max, step attributes',
+ 'Validated onChange; only calls onChange when value passes validation',
+ 'Units display; optional units suffix (e.g. "%" or "GB")',
+ 'Integer mode; option to restrict to integers only',
+ 'Native controls; uses type="number" for browser step controls',
+ 'Event callbacks; onFocus, onBlur, onEnter handlers',
+ ],
+ accessibility: [
+ 'Label always rendered + associated w/ input via htmlFor/id using useId hook.',
+ 'Use isLabelHidden to hide label visually while keeping screen reader access via CSS.',
+ 'Wraps XDSField for consistent label, description, optional/required indicator handling.',
+ ],
+ notes: [
+ 'isOptional + isRequired mutually exclusive; both set shows "Optional".',
+ 'Uses type="number" to enable native browser step controls (up/down arrows).',
+ 'Validated onChange: only calls onChange when value is valid number passing min/max/integer constraints.',
+ 'Uses internal pending state for free-form typing while validating on commit.',
+ 'Units displayed as lighter grey suffix after input value.',
+ ],
+ propDescriptions: {
+ label: 'Label text (always rendered for accessibility).',
+ value: 'Current input value.',
+ onChange: 'Callback on valid input change.',
+ size: 'Size variant.',
+ isLabelHidden: 'Visually hide label (still accessible to screen readers).',
+ description: 'Text between label + input.',
+ isOptional: 'Field optional (mutually exclusive w/ isRequired).',
+ isRequired: 'Field required (mutually exclusive w/ isOptional).',
+ isDisabled: 'Input disabled.',
+ placeholder: 'Placeholder text.',
+ labelTooltip: 'Tooltip text in info icon at label end.',
+ startIcon: 'Icon at input start.',
+ labelIcon: 'Icon before label text.',
+ status: 'Validation status w/ optional message.',
+ min: 'Minimum value allowed.',
+ max: 'Maximum value allowed.',
+ step: 'Step increment.',
+ units: 'Units suffix (e.g. "%" or "GB").',
+ isIntegerOnly: 'Only allow integer values.',
+ htmlName: 'HTML name for form submissions.',
+ autoComplete: 'HTML autocomplete attribute.',
+ hasAutoFocus: 'Focus input on mount.',
+ onFocus: 'Callback on focus.',
+ onBlur: 'Callback on blur.',
+ onEnter: 'Callback on Enter key.',
+ },
+};
diff --git a/packages/core/src/Pagination/Pagination.doc.mjs b/packages/core/src/Pagination/Pagination.doc.mjs
index 10c52d1edb..70f3fa8574 100644
--- a/packages/core/src/Pagination/Pagination.doc.mjs
+++ b/packages/core/src/Pagination/Pagination.doc.mjs
@@ -332,3 +332,50 @@ export const docsZh = {
'还导出 generatePageRange 工具函数,用于计算带省略号的可见页码。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Standalone pagination controls for navigating content pages. Supports multiple display variants + works w/ known totals or cursor-based pagination.',
+ features: [
+ "Five display variants: 'pages', 'count', 'compact', 'dots', 'none'",
+ 'Offset + cursor-based pagination: totalItems/totalPages for known totals, hasMore for cursor-based',
+ 'Page size selector: shows dropdown when pageSizeOptions provided',
+ 'Ellipsis truncation for page numbers via generatePageRange utility',
+ 'React transitions: onChangeAction uses useTransition for built-in loading state',
+ "Sizes: 'sm' and 'md'",
+ ],
+ accessibility: [
+ 'Root is <nav> w/ configurable aria-label.',
+ 'Current page button has aria-current="page".',
+ 'Prev/next buttons have descriptive aria-label.',
+ 'Ellipsis elements are aria-hidden.',
+ 'All interactive elements keyboard accessible.',
+ ],
+ notes: [
+ "Page number buttons use XDSButton (variant='ghost' inactive, variant='primary' active) for theming + swizzle compatibility.",
+ "Prev/next buttons use XDSButton w/ variant='ghost' + icon-only mode.",
+ 'Dot indicators remain custom elements (intentionally different visual treatment from buttons).',
+ 'Returns null when totalItems <= 0 or totalPages <= 0.',
+ 'Exports generatePageRange utility for computing visible page numbers w/ ellipsis.',
+ ],
+ propDescriptions: {
+ page: 'Current page number (1-based).',
+ onChange: 'Called on page change.',
+ onChangeAction:
+ 'Async action on page change. Fires after onChange; uses React transitions for loading.',
+ totalItems: 'Total items. Calculates page count. Precedence over totalPages.',
+ totalPages: 'Total pages. Use when page count known but not item count.',
+ hasMore: 'More pages exist after current. For cursor-based pagination.',
+ pageSize: 'Items per page.',
+ pageSizeOptions: 'Page size options. Shows selector dropdown when provided.',
+ onPageSizeChange: 'Called on page size change. Auto resets to page 1.',
+ variant: 'Display between prev/next buttons.',
+ siblingCount: "Page buttons each side of current; only variant='pages'.",
+ size: 'Control size.',
+ isDisabled: 'Component disabled.',
+ label: 'Accessible label for nav landmark.',
+ xstyle:
+ 'StyleX styles for layout customization (margins, positioning, sizing). Must be stylex.create() value.',
+ },
+};
diff --git a/packages/core/src/Popover/Popover.doc.mjs b/packages/core/src/Popover/Popover.doc.mjs
index 0646ac68c9..745527f9f4 100644
--- a/packages/core/src/Popover/Popover.doc.mjs
+++ b/packages/core/src/Popover/Popover.doc.mjs
@@ -424,3 +424,64 @@ export const docsZh = {
],
},
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Click-triggered popover displaying interactive content anchored to trigger element; implements button+dialog ARIA pattern.',
+ features: [
+ 'CSS Anchor Positioning for auto placement relative to trigger',
+ 'Popover API for top-layer rendering; no React portals needed',
+ 'Controlled + uncontrolled modes',
+ 'Light dismiss support (click outside or Escape to close)',
+ 'Focus trap inside open popovers',
+ 'ARIA button+dialog pattern auto-applied to trigger elements',
+ 'Sibling mode via anchorRef for external trigger elements',
+ 'Stable anchor wrapper immune to pressed-state transforms',
+ ],
+ notes: [
+ 'XDSPopover finds trigger button in children by searching <button> or [role="button"]; child tree must contain one. Applies click/keydown handlers + aria-haspopup, aria-expanded, aria-controls automatically.',
+ 'Uses inline-flex anchor wrapper so pressed-state transforms (e.g. :active scale) don\'t shift anchor position causing jitter.',
+ 'Sibling mode (anchorRef prop) attaches to external ref instead of wrapping children; useful when trigger+overlay not parent/child.',
+ 'LayerPlacement values: above | below | start | end. LayerAlignment values: start | center | end.',
+ ],
+ accessibility: [
+ 'Implements button+dialog ARIA pattern: aria-haspopup, aria-expanded, aria-controls set on trigger button automatically.',
+ 'Traps focus inside popover dialog while open.',
+ 'Supports keyboard activation for role="button" elements (Enter+Space) plus native <button> click synthesis.',
+ ],
+ keyboard:
+ 'Escape closes popover. Enter/Space open popover when trigger focused. Focus trapped inside open popover.',
+ components: [
+ {
+ name: 'XDSPopover',
+ description:
+ 'Click-triggered popover for interactive content anchored to trigger element.',
+ propDescriptions: {
+ children: 'Trigger element. Must contain <button> or [role="button"] element.',
+ anchorRef: 'External ref for popover anchor in sibling mode.',
+ content: 'Content displayed inside popover.',
+ placement: 'Position relative to trigger.',
+ alignment: 'Alignment along placement axis.',
+ isOpen: 'Whether popover shown in controlled mode.',
+ onOpenChange: 'Callback fired when popover visibility changes.',
+ isEnabled: 'When false, trigger interactions ignored.',
+ width: 'Popover container width.',
+ label: 'Accessible label for popover dialog.',
+ },
+ },
+ {
+ name: 'useXDSPopover',
+ description:
+ 'Hook for popover dialogs w/ focus trapping. Combines useXDSLayer w/ useFocusTrap.',
+ propDescriptions: {
+ onShow: 'Callback fired when popover shown.',
+ onHide: 'Callback fired when popover hidden.',
+ hasLightDismiss: 'Whether clicking outside dismisses popover.',
+ hasAutoFocus: 'Whether to auto-focus first focusable element when opened.',
+ hasCloseButton: 'Whether to include hidden close button for accessibility.',
+ dialogLabel: 'Accessible label for dialog.',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/PowerSearch/PowerSearch.doc.mjs b/packages/core/src/PowerSearch/PowerSearch.doc.mjs
index fff0dfbb91..f08cc54939 100644
--- a/packages/core/src/PowerSearch/PowerSearch.doc.mjs
+++ b/packages/core/src/PowerSearch/PowerSearch.doc.mjs
@@ -194,3 +194,45 @@ const [filters, setFilters] = useState([]);
keyboard:
'Type to search fields; Enter to select; Click token to edit; Backspace on empty input removes last filter; Escape closes popover',
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Structured filter bar where each token represents filter (field+operator+value). Users select fields from typeahead dropdown, configure operators+values in edit popover, manage filters as removable tokens.',
+ features: [
+ 'Typeahead field selection w/ search + aliases',
+ 'Edit popover w/ field, operator, value selectors',
+ 'Support for 13 value types: string, integer, float, enum, date, time, more',
+ 'Token-based display w/ click-to-edit + remove',
+ 'Imperative API for focus/blur control via ref',
+ 'Read-only mode for displaying filters w/o editing',
+ ],
+ accessibility: [
+ 'Built on XDSTokenizer providing combobox pattern w/ aria-expanded + aria-autocomplete.',
+ 'Filter tokens have accessible labels w/ field name, operator, value.',
+ 'Edit popover uses XDSPopover w/ focus trapping + light dismiss.',
+ 'Clear all button has accessible label.',
+ ],
+ keyboard:
+ 'Type to search fields; Enter to select; Click token to edit; Backspace on empty input removes last filter; Escape closes popover',
+ propDescriptions: {
+ config: 'Configuration defining available fields, operators, value types.',
+ filters: 'Currently active filters.',
+ onChange: "Called on filter change. changeType is 'add', 'edit', or 'remove'. index is affected filter position.",
+ label: 'Accessible label for search input.',
+ isLabelHidden: 'Visually hides label while keeping accessible.',
+ placeholder: 'Text shown when no filters selected.',
+ hasAutoFocus: 'Auto-focus input on mount.',
+ hasClear: 'Show clear-all button for removing all filters.',
+ isReadOnly: 'Prevent adding, editing, or removing filters.',
+ isDisabled: 'Disables entire component.',
+ status: 'Validation status object w/ type + optional message.',
+ maxTokenLength: 'Max char length for filter value display in tokens.',
+ popoverSaveButtonLabel: 'Label for save button in edit popover.',
+ timezoneID: 'Timezone ID for date formatting (e.g. "America/New_York").',
+ ref: 'Imperative handle w/ focusTypeahead() + blurTypeahead() methods.',
+ endContent: 'Content at end of input row. Useful for action buttons or controls.',
+ resultCount: 'Result count matching current filters. Number formatted as "N results"; string displayed as-is.',
+ xstyle: 'StyleX styles for layout customization. Must be stylex.create() value.',
+ },
+};
diff --git a/packages/core/src/ProgressBar/ProgressBar.doc.mjs b/packages/core/src/ProgressBar/ProgressBar.doc.mjs
index 01d461ed38..2495f3e8e5 100644
--- a/packages/core/src/ProgressBar/ProgressBar.doc.mjs
+++ b/packages/core/src/ProgressBar/ProgressBar.doc.mjs
@@ -244,3 +244,38 @@ export const docsZh = {
'不确定动画遵循 prefers-reduced-motion 偏好设置',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Progress bar for displaying determinate or indeterminate progress.',
+ features: [
+ 'Determinate mode uses role="meter" w/ aria-valuenow, aria-valuemin, aria-valuemax',
+ 'Indeterminate mode uses role="progressbar" w/o value attributes',
+ 'Label always connected via aria-labelledby',
+ 'aria-valuetext provides human-readable value description (determinate only)',
+ 'Indeterminate animation respects prefers-reduced-motion',
+ 'Supports four semantic color variants: accent, positive, warning, negative',
+ 'Three track height sizes: sm=4px, md=8px, lg=12px',
+ 'Supports custom value label formatter via formatValueLabel',
+ ],
+ accessibility: [
+ 'Determinate: uses role="meter" w/ aria-valuenow, aria-valuemin, aria-valuemax',
+ 'Indeterminate: uses role="progressbar" w/o value attributes',
+ 'Label always connected via aria-labelledby',
+ 'aria-valuetext provides human-readable value description (determinate only)',
+ 'Indeterminate animation respects prefers-reduced-motion',
+ ],
+ propDescriptions: {
+ label: 'Accessible label (required).',
+ value: 'Current value (ignored when indeterminate).',
+ max: 'Maximum value.',
+ isLabelHidden: 'Visually hide label (remains accessible).',
+ hasValueLabel: 'Show formatted value text (ignored when indeterminate).',
+ formatValueLabel: 'Custom value label formatter; defaults to percentage string.',
+ variant: 'Semantic color variant.',
+ size: 'Track height: sm=4px, md=8px, lg=12px.',
+ isIndeterminate: 'Animated loading indicator for unknown progress.',
+ xstyle: 'StyleX styles for layout customization. Must be stylex.create() value.',
+ },
+};
diff --git a/packages/core/src/RadioList/RadioList.doc.mjs b/packages/core/src/RadioList/RadioList.doc.mjs
index 0bd1e29d92..6807397afd 100644
--- a/packages/core/src/RadioList/RadioList.doc.mjs
+++ b/packages/core/src/RadioList/RadioList.doc.mjs
@@ -502,3 +502,62 @@ export const docsZh = {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Radio group component for single-value selection from list of options.',
+ features: [
+ 'Accessible; uses native <input type="radio"> w/ proper role="radiogroup" + ARIA attributes',
+ 'Orientation; supports vertical + horizontal layouts',
+ 'Sizes; sm (18px radio, 20px wrapper) + md (22px radio, 24px wrapper)',
+ 'Descriptions; optional description text per item',
+ 'Custom content; startContent + endContent slots on each item',
+ 'Disabled state; supports disabling entire group or individual items',
+ 'Field integration; uses XDSField for label, description, required/optional, status messaging',
+ ],
+ notes: [
+ 'XDSRadioList creates RadioListContext providing name, value, onChange, isDisabled, isRequired, size, status to child items',
+ 'XDSRadioListItem must be within XDSRadioList; throws if context missing',
+ 'Uses hidden native <input type="radio"> w/ custom visual overlay for consistent styling',
+ 'Focus outline uses standard XDS focus outline token w/ 2px offset',
+ 'Hover states use color-mix() for consistent overlay tinting',
+ 'Size variants match CheckboxInput dimensions for visual consistency',
+ ],
+ components: [
+ {
+ name: 'XDSRadioList',
+ description:
+ 'Radio group container w/ field integration for label, description, status.',
+ propDescriptions: {
+ label: 'Label text for radio group (always rendered for accessibility).',
+ value: 'Currently selected value.',
+ onChange: 'Callback fired when selected value changes.',
+ children: 'XDSRadioListItem elements.',
+ isLabelHidden: 'Whether to visually hide label.',
+ description: 'Description text below label.',
+ orientation: 'Layout direction of radio items.',
+ isDisabled: 'Whether all radio items disabled.',
+ isRequired: 'Whether radio group required.',
+ isOptional: 'Whether field optional (mutually exclusive w/ isRequired).',
+ status: 'Status indicator ({ type, message }).',
+ size: 'Size of radio controls.',
+ labelTooltip: 'Tooltip text for info icon next to label.',
+ xstyle: 'StyleX styles for layout customization. Must be stylex.create() value.',
+ },
+ },
+ {
+ name: 'XDSRadioListItem',
+ description:
+ 'Individual radio item w/ label, description, content slots.',
+ propDescriptions: {
+ label: 'Label text for radio item.',
+ value: 'Value of this radio item.',
+ description: 'Description text below label.',
+ isDisabled: 'Whether this individual radio item disabled.',
+ startContent: 'Content rendered before radio circle.',
+ endContent: 'Content rendered after label.',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/Section/Section.doc.mjs b/packages/core/src/Section/Section.doc.mjs
index 3d95ce8988..ff3146ed9b 100644
--- a/packages/core/src/Section/Section.doc.mjs
+++ b/packages/core/src/Section/Section.doc.mjs
@@ -184,3 +184,25 @@ export const docsZh = {
],
},
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Container w/ background variants for creating visually distinct regions; auto-escapes parent container padding for edge-to-edge fills.',
+ features: [
+ 'Background variants: section, transparent, wash',
+ 'Auto-escapes parent container padding for edge-to-edge fills',
+ 'Supports divider borders on any combination of sides (top, bottom, start, end)',
+ 'Flexible sizing via SizeValue for width, height, maxWidth, minHeight',
+ 'Full-bleed mode removes internal padding for edge-to-edge content',
+ ],
+ propDescriptions: {
+ variant: 'Background variant applied to section container.',
+ width: 'Section width; number interpreted as pixels, string used as-is.',
+ height: 'Section height; number interpreted as pixels, string used as-is.',
+ maxWidth: 'Maximum width of section.',
+ minHeight: 'Minimum height of section.',
+ children: 'Content rendered inside section.',
+ dividers: 'Which sides of section have divider borders.',
+ },
+};
diff --git a/packages/core/src/Selector/Selector.doc.mjs b/packages/core/src/Selector/Selector.doc.mjs
index 4dd69d1d51..2e2f190e57 100644
--- a/packages/core/src/Selector/Selector.doc.mjs
+++ b/packages/core/src/Selector/Selector.doc.mjs
@@ -464,3 +464,57 @@ export const docsZh = {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Dropdown selector for choosing from list of options. Follows XDS input conventions w/ label, status, field props.',
+ features: [
+ 'Supports string items (auto-converted to {value, label}), object items w/ optional icon + disabled state, dividers, labeled sections',
+ 'Custom item rendering via children render prop + XDSSelectorItem helper',
+ 'Integrates w/ XDS field conventions: label, description, isRequired, isOptional, isLabelHidden, status',
+ 'Size variants: sm, md, lg',
+ 'Full keyboard navigation w/ typeahead support',
+ 'Accessible; role="combobox" trigger, role="listbox" dropdown, role="group" for sections, aria-activedescendant for focus',
+ ],
+ keyboard:
+ '\u2191\u2193 navigate, Enter/Space select, Escape close, Home/End jump, A-Z typeahead.',
+ accessibility: [
+ 'Uses role="combobox" on trigger button.',
+ 'Dropdown uses role="listbox".',
+ 'Section groups use role="group".',
+ 'aria-activedescendant tracks focused option.',
+ ],
+ components: [
+ {
+ name: 'XDSSelector',
+ description: 'Dropdown selector for choosing from list of options.',
+ propDescriptions: {
+ label: 'Label text for accessibility.',
+ options: 'Array of items; strings, objects w/ value/label/icon/disabled, dividers ({type: "divider"}), sections ({type: "section", title, items}).',
+ value: 'Currently selected value.',
+ onChange: 'Callback fired when selection changes.',
+ placeholder: 'Placeholder text when no value selected.',
+ size: 'Size variant for selector.',
+ isDisabled: 'Disables selector.',
+ isLabelHidden: 'Visually hides label while keeping accessible.',
+ description: 'Helper text below label.',
+ isOptional: 'Marks field optional.',
+ isRequired: 'Marks field required.',
+ status: 'Validation status w/ optional message.',
+ children: 'Custom render function for each dropdown item.',
+ xstyle: 'StyleX styles for layout customization. Must be stylex.create() value.',
+ },
+ },
+ {
+ name: 'XDSSelectorItem',
+ description:
+ 'Helper component for custom item rendering inside XDSSelector children render prop.',
+ propDescriptions: {
+ label: 'Primary label text for item.',
+ icon: 'Icon displayed before label.',
+ description: 'Secondary description text below label.',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/SideNav/SideNav.doc.mjs b/packages/core/src/SideNav/SideNav.doc.mjs
index dd476d0fc0..f23219c125 100644
--- a/packages/core/src/SideNav/SideNav.doc.mjs
+++ b/packages/core/src/SideNav/SideNav.doc.mjs
@@ -728,3 +728,90 @@ export const docsZh = {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Sidebar navigation component for app pages. Supports sections, nested items, selected state, icons, responsive collapse.',
+ features: [
+ 'Five-zone layout: header, topContent, children (scrollable), footer, footerIcons',
+ 'Smart header interaction boundary logic; links + menu trigger coexist w/o overlap',
+ 'Nested items via children on XDSSideNavItem',
+ 'Selected state w/ optional alternate icon for filled/outline variants',
+ 'Section grouping w/ optional title, subtitle, end content',
+ 'Accessible; nav landmark, aria-current="page", role="group" w/ aria-labelledby on sections',
+ 'Keyboard navigable; Tab through items, Enter/Space to activate',
+ ],
+ accessibility: [
+ '<nav aria-label="Side navigation"> wraps entire component',
+ 'aria-current="page" applied to selected item',
+ 'Sections use role="group" w/ aria-labelledby pointing to section title',
+ 'isHeaderHidden visually hides section title while keeping accessible to screen readers',
+ ],
+ keyboard: 'Tab through items, Enter/Space to activate links',
+ notes: [
+ 'W/ XDSAppShell alongside XDSTopNav, omit XDSSideNavHeading; TopNav already provides app identity.',
+ 'W/o TopNav, include XDSSideNavHeading to provide app identity.',
+ 'Header interaction model: headingHref only = whole header is one link; headingHref+superheadingHref no menu = each text independent link; menu only no hrefs = whole header is popover trigger; menu+hrefs = links are independent <a> elements, chevron/remaining is popover trigger.',
+ 'Depends on useXDSPopover for header menu popover + XDSIcon for rendering icon components in nav items.',
+ ],
+ components: [
+ {
+ name: 'XDSSideNav',
+ description:
+ 'Container w/ five zones: header, topContent, children (scrollable), footer, footerIcons.',
+ propDescriptions: {
+ header: 'Header area (typically XDSSideNavHeading). Sticky.',
+ topContent: 'Content below header, e.g. create button.',
+ children: 'Navigation sections + items. Scrollable.',
+ footer: 'Footer area above icon bar.',
+ footerIcons: 'Footer icon bar.',
+ xstyle: 'StyleX styles for layout customization. Must be stylex.create() value.',
+ },
+ },
+ {
+ name: 'XDSSideNavHeading',
+ description:
+ 'Product/suite/account heading w/ smart interaction boundary logic for links + menu popover.',
+ propDescriptions: {
+ heading: 'Product/app name.',
+ icon: 'Product/app icon.',
+ headingHref: 'Link for heading.',
+ superheading: 'Text above heading.',
+ superheadingHref: 'Link for superheading.',
+ subheading: 'Text below heading.',
+ subheadingHref: 'Link for subheading.',
+ menu: 'Menu content rendered inside popover.',
+ },
+ },
+ {
+ name: 'XDSSideNavItem',
+ description:
+ 'Navigation item w/ icon, selected state, optional end content, nesting via children.',
+ propDescriptions: {
+ label: 'Item label.',
+ as: 'Custom link component.',
+ icon: 'Icon displayed in outline (unselected) variant.',
+ selectedIcon: 'Icon displayed when item selected (filled variant).',
+ isSelected: 'Marks this item as current page.',
+ isDisabled: 'Disabled state.',
+ href: 'Navigation URL.',
+ onClick: 'Click handler.',
+ endContent: 'Right-side content such as badges or counts.',
+ children: 'Sub-items for nesting.',
+ },
+ },
+ {
+ name: 'XDSSideNavSection',
+ description:
+ 'Section grouping w/ optional title, subtitle, end content.',
+ propDescriptions: {
+ title: 'Section title.',
+ subtitle: 'Section subtitle.',
+ children: 'Section items.',
+ endContent: 'Right-side content in section header.',
+ isHeaderHidden: 'Visually hides section header while keeping accessible to screen readers.',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/Skeleton/Skeleton.doc.mjs b/packages/core/src/Skeleton/Skeleton.doc.mjs
index 3393ae3dec..2549700e85 100644
--- a/packages/core/src/Skeleton/Skeleton.doc.mjs
+++ b/packages/core/src/Skeleton/Skeleton.doc.mjs
@@ -150,3 +150,29 @@ export const docsZh = {
'动画时序常量:DELAY_TIME(1000ms)动画开始前的初始延迟,FADE_TIME(1000ms)一个透明度循环的持续时间,STAGGER_TIME(100ms)连续元素之间的延迟增量。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description:
+ 'Placeholder loading component displaying animated pulsing effect while content loads.',
+ features: [
+ 'Pulsing Animation: smooth opacity animation using stepped timing for subtle shimmer effect',
+ 'Staggered Animation: sequential skeletons can be staggered to create wave effect',
+ 'High Contrast Support: auto-adjusts for users w/ prefers-contrast: more',
+ 'Flexible Sizing: width + height props accept pixels or any CSS value',
+ 'Token-aligned Radius: border radius options map directly to design tokens',
+ ],
+ notes: [
+ 'Uses steps(10, end) timing function for subtle shimmer effect.',
+ 'Animation alternates between 0.25 and 1.0 opacity.',
+ 'Background color from glimmer token, w/ glimmerHighContrast for accessibility.',
+ 'Numeric dimensions converted to pixels; strings passed through as-is.',
+ 'Animation timing constants: DELAY_TIME (1000ms) initial delay before animation starts, FADE_TIME (1000ms) duration of one opacity cycle, STAGGER_TIME (100ms) delay increment between sequential elements.',
+ ],
+ propDescriptions: {
+ width: 'Width in pixels (number) or CSS value (string).',
+ height: 'Height in pixels (number) or CSS value (string).',
+ radius: 'Border radius using design tokens. none for sharp corners, rounded for fully rounded (avatars, pills, circles).',
+ index: 'Index for staggered animation timing. Element at index n starts at DELAY_TIME + (STAGGER_TIME \u00d7 n).',
+ },
+};
diff --git a/packages/core/src/Slider/Slider.doc.mjs b/packages/core/src/Slider/Slider.doc.mjs
index c43b924fc8..34bca4e618 100644
--- a/packages/core/src/Slider/Slider.doc.mjs
+++ b/packages/core/src/Slider/Slider.doc.mjs
@@ -476,3 +476,55 @@ export const docsZh = {
'垂直方向反转 Y 轴,使底部为最小值,顶部为最大值。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Numeric value/range selector w/ full keyboard + pointer support.',
+ features: [
+ 'Single + range modes: number for single thumb, [number, number] for range',
+ 'Orientation: horizontal + vertical layouts',
+ 'Value display: tooltip (default), inline text, or none',
+ 'Tick marks: optional marks at specified positions w/ labels',
+ 'Keyboard nav: Arrow keys, Page Up/Down, Home/End',
+ 'Drag: pointer capture for smooth dragging',
+ 'Custom formatting: formatValue fn for display + aria-valuetext',
+ 'Field integration: uses XDSField for label, description, required/optional, status messaging',
+ 'Accessible: role="slider" w/ full ARIA attributes',
+ ],
+ notes: [
+ 'ref merged w/ internal trackRef for pointer position calc.',
+ 'Pointer capture during drag for smooth interaction even when cursor leaves track.',
+ 'snapToStep rounds to nearest valid step; clamp enforces min/max bounds.',
+ 'Range mode auto-selects closest thumb to click position.',
+ 'minStepsBetweenThumbs enforces min gap between range thumbs.',
+ 'Vertical orientation inverts Y axis; bottom=min, top=max.',
+ ],
+ accessibility: [
+ 'role="slider" w/ aria-valuenow, aria-valuemin, aria-valuemax, aria-valuetext on each thumb.',
+ 'Label always in DOM for a11y even when isLabelHidden=true.',
+ 'Tooltip uses XDSTooltip w/ delay={0} focusTrigger="always"; value visible on focus.',
+ ],
+ keyboard: 'Arrow=\u00b11 step; PageUp/PageDown=\u00b110 steps; Home/End=jump to min/max.',
+ propDescriptions: {
+ label: 'Label text (always rendered for a11y).',
+ value: 'Current value; number for single thumb, [number, number] for range.',
+ onChange: 'Fired on value change during drag.',
+ onChangeEnd: 'Fired when drag ends.',
+ min: 'Minimum value.',
+ max: 'Maximum value.',
+ step: 'Step increment.',
+ orientation: 'Slider orientation.',
+ formatValue: 'Custom value formatting fn for display + aria-valuetext.',
+ valueDisplay: 'How current value is displayed.',
+ marks: 'Tick marks at specified positions w/ optional labels.',
+ minStepsBetweenThumbs: 'Min steps between thumbs in range mode; prevents overlap.',
+ isDisabled: 'Whether slider is disabled.',
+ isOptional: 'Whether field is optional.',
+ isRequired: 'Whether field is required.',
+ isLabelHidden: 'Visually hide label.',
+ description: 'Description text below label.',
+ status: 'Status indicator ({type, message}) for validation feedback.',
+ labelTooltip: 'Tooltip text for info icon next to label.',
+ xstyle: 'StyleX layout styles; must be stylex.create() value.',
+ },
+};
\ No newline at end of file
diff --git a/packages/core/src/Spinner/Spinner.doc.mjs b/packages/core/src/Spinner/Spinner.doc.mjs
index c914ea00e8..083e46e33c 100644
--- a/packages/core/src/Spinner/Spinner.doc.mjs
+++ b/packages/core/src/Spinner/Spinner.doc.mjs
@@ -120,3 +120,26 @@ export const docsZh = {
'尺寸参考:sm = 10×10px / 3px 边框,md = 14×14px / 3px 边框,lg = 18×18px / 3px 边框。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Pure spinner for loading state. No layout, no text; just spinning indicator.',
+ features: [
+ 'CSS border animation: lightweight border-based spinner w/ smooth 360\u00b0 rotation',
+ 'Size variants: sm (10px), md (14px), lg (18px) matching inline spinners',
+ 'Shade support: default for light bg, onMedia for dark/accent bg',
+ 'Accessible: role="status" + aria-label="Loading" by default',
+ ],
+ notes: [
+ 'CSS border technique: 3 visible borders + 1 transparent for gap.',
+ 'Animation: rotate(360deg) at 0.75s linear infinite.',
+ 'Color inherits currentColor, controlled by shade styles w/ theme tokens.',
+ 'Element is <span> w/ display: inline-block for inline composability.',
+ 'Intentionally minimal; compose w/ layout + text components for full loading states.',
+ 'Size ref: sm=10x10px/3px border, md=14x14px/3px border, lg=18x18px/3px border.',
+ ],
+ propDescriptions: {
+ size: 'Spinner size (10px, 14px, 18px).',
+ shade: 'Color shade for light or dark backgrounds.',
+ },
+};
\ No newline at end of file
diff --git a/packages/core/src/Stack/Stack.doc.mjs b/packages/core/src/Stack/Stack.doc.mjs
index bf218b4130..3fe016be32 100644
--- a/packages/core/src/Stack/Stack.doc.mjs
+++ b/packages/core/src/Stack/Stack.doc.mjs
@@ -666,3 +666,73 @@ import * as stylex from '@stylexjs/stylex';
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Stack layout primitives for horizontal/vertical sequences using flexbox w/ themed spacing tokens.',
+ features: [
+ 'Horizontal (XDSHStack) + vertical (XDSVStack) stacking',
+ 'Themed spacing via gap tokens from design system spacing scale',
+ 'Individual item control via XDSStackItem',
+ 'Polymorphic rendering via element prop',
+ 'Low-level StyleX utilities (stack, stackItem) for advanced use',
+ ],
+ notes: [
+ "Import from '@xds/core/Layout': XDSHStack, XDSVStack, XDSStackItem, stack, stackItem.",
+ 'gap accepts numeric spacing steps: 0, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 8, 10.',
+ 'stack + stackItem are low-level StyleX utilities for cases where component API is insufficient.',
+ ],
+ components: [
+ {
+ name: 'XDSHStack',
+ description: 'Horizontal stack; left-to-right, polymorphic rendering.',
+ propDescriptions: {
+ gap: 'Numeric spacing step for gap: 0, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 8, 10.',
+ vAlign: 'Vertical (cross-axis) alignment.',
+ wrap: 'Flex wrap behavior.',
+ element: 'HTML element to render as container.',
+ children: 'Stack content.',
+ xstyle: 'StyleX layout styles; must be stylex.create() value.',
+ },
+ },
+ {
+ name: 'XDSVStack',
+ description: 'Vertical stack; top-to-bottom, polymorphic rendering.',
+ propDescriptions: {
+ gap: 'Numeric spacing step for gap: 0, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 8, 10.',
+ hAlign: 'Horizontal (cross-axis) alignment.',
+ wrap: 'Flex wrap behavior.',
+ element: 'HTML element to render as container.',
+ children: 'Stack content.',
+ },
+ },
+ {
+ name: 'XDSStackItem',
+ description: 'Controls individual item behavior in stack; polymorphic rendering.',
+ propDescriptions: {
+ size: 'Flex grow: static=natural size, fill=expand to remaining space.',
+ crossAlignSelf: 'Override cross-axis alignment for this item, ignoring parent.',
+ element: 'HTML element to render as wrapper.',
+ children: 'Item content.',
+ },
+ },
+ {
+ name: 'stack',
+ description: 'Low-level StyleX utility for flex containers w/ stack behavior.',
+ propDescriptions: {
+ direction: 'Stack direction.',
+ gap: 'Numeric spacing step for gap: 0, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 8, 10.',
+ crossAlign: 'Cross-axis alignment of all items.',
+ wrap: 'Flex wrap behavior.',
+ },
+ },
+ {
+ name: 'stackItem',
+ description: 'Low-level StyleX utility for flex item behavior.',
+ propDescriptions: {
+ size: 'Flex grow: static=natural size, fill=expand to remaining space.',
+ crossAlignSelf: 'Override cross-axis alignment for this item.',
+ },
+ },
+ ],
+};
\ No newline at end of file
diff --git a/packages/core/src/StatusDot/StatusDot.doc.mjs b/packages/core/src/StatusDot/StatusDot.doc.mjs
index 74daabeb80..5a9275995b 100644
--- a/packages/core/src/StatusDot/StatusDot.doc.mjs
+++ b/packages/core/src/StatusDot/StatusDot.doc.mjs
@@ -144,3 +144,27 @@ export const docsZh = {
'isPulsing 动画尊重 prefers-reduced-motion: reduce 设置。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Small colored dot indicator for status display (online/offline, severity, etc).',
+ features: [
+ 'Five semantic color variants: positive, warning, negative, info, neutral',
+ 'Two sizes: sm (8px) + md (10px)',
+ 'Optional pulse animation respecting prefers-reduced-motion',
+ 'Accessible: <span role="img" aria-label={label}> for screen readers',
+ 'Not focusable (decorative indicator)',
+ ],
+ accessibility: [
+ 'Renders <span role="img" aria-label={label}> for screen readers.',
+ 'Not focusable; decorative indicator only.',
+ 'isPulsing animation respects prefers-reduced-motion: reduce.',
+ ],
+ propDescriptions: {
+ variant: 'Semantic color variant.',
+ label: 'Accessible label via aria-label.',
+ size: 'Dot size: sm=8px, md=10px.',
+ isPulsing: 'Pulse animation; respects prefers-reduced-motion: reduce.',
+ xstyle: 'StyleX layout styles; must be stylex.create() value.',
+ },
+};
\ No newline at end of file
diff --git a/packages/core/src/Switch/Switch.doc.mjs b/packages/core/src/Switch/Switch.doc.mjs
index a405399da9..709975d69a 100644
--- a/packages/core/src/Switch/Switch.doc.mjs
+++ b/packages/core/src/Switch/Switch.doc.mjs
@@ -408,3 +408,54 @@ export const docsZh = {
'遵循与 XDSCheckboxInput 相同的模式以保持结构一致性',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Toggle switch for boolean values w/ integrated label support.',
+ features: [
+ 'Boolean toggle; fixed 40x24px track w/ animated 16px (off) / 20px (on) thumb',
+ 'Label integration; uses XDSFieldLabel for accessible labels w/ optional tooltip + icon',
+ 'Label position; label before or after switch via labelPosition',
+ 'Label spacing; spread layout pushes label + switch to opposite ends',
+ 'Description; optional text below label',
+ 'Optional/required indicators; visual markers for field status',
+ 'Status messages; error, warning, success, or info boxes below switch',
+ 'Async action support; onChangeAction w/ optimistic UI + built-in loading spinner',
+ 'Accessible; native checkbox w/ role="switch", aria-describedby, aria-invalid, aria-busy',
+ ],
+ notes: [
+ 'Fixed dimensions: 40px wide, 24px high, 16px thumb (off), 20px thumb (on).',
+ 'Track + thumb use CSS transitions for background-color, transform, width, height.',
+ 'Hover tints via stylex.when.ancestor w/ @media (hover: hover) guard.',
+ 'onChangeAction uses React useTransition + useOptimistic for seamless async toggling.',
+ 'labelPosition="start" + labelSpacing="spread" produces settings panel layout.',
+ 'Follows same patterns as XDSCheckboxInput for structural consistency.',
+ ],
+ accessibility: [
+ 'Native <input type="checkbox" role="switch"> for correct semantics.',
+ 'Label always associated via htmlFor/id even when visually hidden.',
+ 'Description linked via aria-describedby on input element.',
+ 'Status messages linked via aria-describedby; aria-invalid set on error type.',
+ 'aria-busy set during async onChangeAction execution.',
+ ],
+ keyboard: 'Space=toggle; Tab/Shift+Tab=move focus in/out.',
+ propDescriptions: {
+ label: 'Label text (always rendered for a11y).',
+ value: 'Whether switch is on or off.',
+ onChange: 'Fired when switch state changes.',
+ onChangeAction: 'Async action after onChange; triggers optimistic UI + loading spinner until resolved.',
+ isLoading: 'Loading state; shows spinner in thumb.',
+ isLabelHidden: 'Visually hides label; still accessible to screen readers.',
+ description: 'Description text below label.',
+ isDisabled: 'Whether switch is disabled.',
+ isOptional: 'Whether field is optional; mutually exclusive w/ isRequired.',
+ isRequired: 'Whether switch is required; mutually exclusive w/ isOptional.',
+ status: 'Status indicator w/ type + message; colored message box, sets aria-invalid on error.',
+ onFocus: 'Fired when switch receives focus.',
+ onBlur: 'Fired when switch loses focus.',
+ labelIcon: 'Icon before label text.',
+ labelTooltip: 'Tooltip text in info icon at label end.',
+ labelPosition: 'Which side label appears; "start" places before switch.',
+ labelSpacing: 'Spacing behavior; "spread" pushes to opposite ends (full width).',
+ },
+};
\ No newline at end of file
diff --git a/packages/core/src/TabList/TabList.doc.mjs b/packages/core/src/TabList/TabList.doc.mjs
index 8569aa9965..543d22c52a 100644
--- a/packages/core/src/TabList/TabList.doc.mjs
+++ b/packages/core/src/TabList/TabList.doc.mjs
@@ -478,3 +478,72 @@ export const docsZh = {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Tab navigation w/ overflow menu support; semantic nav landmark w/ button or anchor tab items.',
+ features: [
+ 'Context-based: XDSTabListContext passes value/onChange/size from XDSTabList to children',
+ 'Single-responsibility XDSTab: renders <button> or <a> (when href provided) in nav',
+ 'Overflow menu: XDSTabMenu accepts options prop, renders menu items from dropdown',
+ "Dynamic trigger label: shows selected option's label when active",
+ "Menu heading: dropdown includes XDSDivider w/ menu's label as separator heading",
+ 'Selection indicator: selected items show checkmark icon (matching XDSSelector pattern)',
+ 'Keyboard nav: Tab between items, ArrowUp/Down in menu, Home/End, Escape closes (via useListFocus)',
+ 'Hover state: unselected tabs show gray underline on hover; no bg hover overlay',
+ 'Accessible: nav landmark, aria-current="page" on selected, role="menu" + aria-label on dropdown, aria-controls, role="menuitem", role="separator"',
+ ],
+ notes: [
+ 'XDSTab renders <button> by default, <a> when href provided.',
+ 'XDSTabMenu renders items internally from options prop; no child composition.',
+ 'Trigger label: options.find(o => o.value === ctx.value)?.label ?? label.',
+ 'Menu trigger underline scopes to label text span only, not chevron.',
+ 'Icons on menu items via XDSIcon size="sm" color="secondary".',
+ 'Selected menu items show CheckIcon (matching XDSSelector pattern).',
+ 'hasDivider controls bottom border (default: off).',
+ 'Size uses sizeVars tokens for tab heights (sm/md/lg).',
+ ],
+ accessibility: [
+ 'XDSTabList renders <nav> w/ aria-label="Tabs".',
+ 'XDSTab renders <button> or <a>; uses nav pattern, not role="tab".',
+ 'Selected XDSTab has aria-current="page".',
+ 'XDSTabMenu trigger has aria-haspopup="menu", aria-expanded, aria-controls.',
+ 'XDSTabMenu dropdown has role="menu" + aria-label matching label prop.',
+ 'XDSTabMenu heading divider has role="separator".',
+ 'XDSTabMenu items have role="menuitem" + aria-current="true" when selected.',
+ ],
+ keyboard: 'Tab=move focus between items; ArrowUp/ArrowDown=navigate menu (wrapping); Home/End=first/last; Escape=close menu.',
+ components: [
+ {
+ name: 'XDSTabList',
+ description: 'Nav wrapper providing XDSTabListContext (value, onChange, size) to children.',
+ propDescriptions: {
+ value: 'Currently selected tab value.',
+ onChange: 'Fired when tab is selected.',
+ size: 'Size variant applied to all child tabs.',
+ hasDivider: 'Show bottom border divider under tab list.',
+ children: 'XDSTab + XDSTabMenu items inside nav.',
+ },
+ },
+ {
+ name: 'XDSTab',
+ description: 'Individual tab; renders as button or anchor w/ selected-state styling + optional icons.',
+ propDescriptions: {
+ value: 'Unique value matched against XDSTabListContext.value.',
+ label: 'Visible label text.',
+ href: 'URL; renders as <a> when provided.',
+ as: 'Custom link component overriding XDSLinkProvider; only w/ href.',
+ icon: 'Icon shown when not selected.',
+ selectedIcon: 'Icon shown when selected; falls back to icon.',
+ },
+ },
+ {
+ name: 'XDSTabMenu',
+ description: "Overflow menu trigger; dropdown of extra tab options, shows selected option's label as trigger text.",
+ propDescriptions: {
+ label: 'Trigger text (when no option selected) + dropdown heading.',
+ options: 'Menu options array rendered in dropdown.',
+ },
+ },
+ ],
+};
\ No newline at end of file
diff --git a/packages/core/src/Table/Table.doc.mjs b/packages/core/src/Table/Table.doc.mjs
index dc83795765..f7b5bec767 100644
--- a/packages/core/src/Table/Table.doc.mjs
+++ b/packages/core/src/Table/Table.doc.mjs
@@ -992,3 +992,101 @@ const selectionPlugin = useXDSTableSelection<User>({
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Data-driven table w/ rich cell content via renderCell. Compose cells w/ XDSBadge, XDSStatusDot, XDSText, XDSAvatar, layout primitives. XDSBaseTable provides unstyled structural core w/ composable plugin pipeline.',
+ features: [
+ 'Data-driven rendering; pass data + columns, rows render automatically',
+ 'Rich cell content via renderCell; compose XDS components inside cells',
+ 'Children mode; compose XDSTableRow/XDSTableCell directly for manual layouts',
+ 'Plugin system; extend behavior w/ composable transform plugins',
+ 'Density variants: compact, balanced, spacious',
+ 'Divider styles: rows, columns, grid, none',
+ 'Striped even rows + hover highlight via XDSTableContext',
+ 'Selection via useXDSTableSelection; checkboxes, select-all, aria-selected',
+ 'Body rows memoized w/ custom comparison; only changed rows re-render',
+ 'Auto-generated columns from data object keys when columns omitted',
+ 'Themeable via className; target .xds-base-table, .xds-table-row, .xds-table-cell, .xds-table-header-cell',
+ ],
+ notes: [
+ 'Two-layer design: XDSBaseTable=unstyled structure + plugin pipeline; XDSTable wraps w/ XDSTableContext + styled sub-components.',
+ 'Styling owned by components (XDSTableRow, XDSTableCell, XDSTableHeaderCell), not plugins; each reads XDSTableContext.',
+ 'XDSTable accepts plugins as Record<string, TablePlugin<T>>, converts to ordered array; XDSBaseTable accepts ordered array directly.',
+ 'Selection plugin uses React Context; checkboxes re-render independently from row content.',
+ 'Body rows memoized via React.memo w/ custom comparison; define columns outside component or memoize to avoid full re-renders.',
+ 'Columns auto-generated from data keys via generateColumns(); widths via proportional() + pixel() helpers.',
+ 'tableProps on XDSBaseTable passes extra HTML attrs to <table> element.',
+ ],
+ accessibility: [
+ 'Selection plugin sets aria-selected on selected body rows.',
+ 'Select-all + per-row checkboxes use visually hidden labels ("Select all rows", "Select row") via isLabelHidden.',
+ 'Non-selectable rows (getIsItemSelectable=false) render no checkbox.',
+ 'Disabled rows (getIsItemEnabled=false) render disabled checkbox.',
+ ],
+ components: [
+ {
+ name: 'XDSTable',
+ description: 'Styled data-driven table w/ density, dividers, hover, striped rows, named plugin support.',
+ propDescriptions: {
+ data: 'Array of data items to render as rows.',
+ columns: 'Column defs; auto-generated from data keys if omitted.',
+ idKey: 'Row key for React reconciliation; property name or fn. Falls back to index.',
+ density: 'Row density controlling cell padding + font size.',
+ dividers: 'Divider style between cells.',
+ isStriped: 'Background wash on even rows.',
+ hasHover: 'Hover highlight on pointer devices.',
+ plugins: 'Named plugins extending behavior via transform pipeline; converted to ordered array.',
+ children: 'Children mode; render XDSTableRow/XDSTableCell directly.',
+ xstyle: 'StyleX layout styles; must be stylex.create() value.',
+ },
+ },
+ {
+ name: 'XDSBaseTable',
+ description: 'Unstyled structural table w/ plugin transform pipeline + components prop for custom row/cell renderers.',
+ propDescriptions: {
+ data: 'Array of data items to render as rows.',
+ columns: 'Column defs; auto-generated from data keys if omitted.',
+ idKey: 'Row key for React reconciliation; property name or fn. Falls back to index.',
+ plugins: 'Ordered plugin array applied as sequential transform pipeline.',
+ components: 'Component overrides for row/cell elements; receive xstyle from plugin transforms.',
+ children: 'Children mode; render rows in tbody directly.',
+ tableProps: 'Extra HTML attrs passed to root <table> element.',
+ },
+ },
+ {
+ name: 'XDSTableRow',
+ description: '<tr> wrapper; reads XDSTableContext for striped/hover/divider styles.',
+ propDescriptions: {
+ children: 'Row cell elements.',
+ },
+ },
+ {
+ name: 'XDSTableCell',
+ description: '<td> wrapper; reads XDSTableContext for density padding, font size, divider borders.',
+ propDescriptions: {
+ children: 'Cell content.',
+ },
+ },
+ {
+ name: 'XDSTableHeaderCell',
+ description: '<th> wrapper; reads XDSTableContext for density padding, semibold weight, secondary color, dividers.',
+ propDescriptions: {
+ children: 'Header cell content.',
+ },
+ },
+ {
+ name: 'useXDSTableSelection',
+ description: 'Hook returning TablePlugin for row selection w/ checkboxes, select-all, aria-selected. Uses React Context for independent checkbox re-renders.',
+ propDescriptions: {
+ getIsItemSelected: 'Returns whether item is selected.',
+ onSelectItem: 'Called on row checkbox toggle; isSelected = new desired state.',
+ onSelectAll: 'Called on select-all header checkbox toggle.',
+ getIsAllSelected: 'Returns whether all selectable items are selected.',
+ getIsIndeterminate: 'Returns partial selection state; renders indeterminate checkbox.',
+ getIsItemSelectable: 'Returns whether row shows checkbox; non-selectable rows render nothing.',
+ getIsItemEnabled: 'Returns whether row checkbox is interactive; disabled rows show disabled checkbox.',
+ },
+ },
+ ],
+};
\ No newline at end of file
diff --git a/packages/core/src/Text/Text.doc.mjs b/packages/core/src/Text/Text.doc.mjs
index 7a85035a73..2079235804 100644
--- a/packages/core/src/Text/Text.doc.mjs
+++ b/packages/core/src/Text/Text.doc.mjs
@@ -726,3 +726,78 @@ function Article() {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Typography components: semantic body text, headings, wrapper for applying typography styles to native HTML.',
+ features: [
+ 'Semantic text types (body, large, label, supporting, code) driven by theme tokens',
+ 'Headings use native h1\u20136 w/ optional aria-level override for decoupled visual vs document hierarchy',
+ 'Line-clamp truncation w/ automatic overflow-detecting tooltip',
+ 'Optical alignment (text-box-trim / capsize) for precise vertical rhythm',
+ 'XDSFontWrapper applies typography styles to native HTML; useful for UGC + markdown output',
+ 'useXDSFontWrapperStyles hook for programmatic StyleX access to heading + prose styles',
+ 'Tabular number support for aligned numeric data',
+ 'All typography driven by CSS custom properties; fully themeable per-component',
+ ],
+ accessibility: [
+ 'XDSHeading renders correct semantic h1\u20136 based on level prop.',
+ 'When accessibilityLevel differs from level, aria-level set for correct document outline.',
+ 'Truncated text sets native title attr as fallback + lazily renders XDSTooltip for keyboard users.',
+ ],
+ components: [
+ {
+ name: 'XDSText',
+ description: 'Semantic body text w/ type-based theme styling, optional truncation, decoration, layout props.',
+ propDescriptions: {
+ type: 'Semantic text type; determines size, weight, line-height from theme.',
+ children: 'Text content.',
+ size: 'Explicit font size override; overrides type size but preserves other properties. Prefer type alone.',
+ color: "Text color; defaults 'secondary' for supporting, 'primary' for others.",
+ weight: 'Font weight override.',
+ display: "Display type; overridden to 'block' when maxLines>0 or hasCapsize.",
+ as: 'HTML element to render.',
+ maxLines: 'Max lines before truncation; 0=none. Shows tooltip if truncated.',
+ hasTruncateTooltip: 'Tooltip for truncated text; true=default position, false=disabled, or LayerPlacement.',
+ wordBreak: "Word break behavior; defaults 'break-all' for single-line, 'break-word' otherwise.",
+ textWrap: 'Text wrapping behavior.',
+ hasCapsize: 'Optical alignment via text-box-trim; forces block display.',
+ hasStrikethrough: 'Strikethrough text decoration.',
+ hasTabularNumbers: 'Tabular (monospace) numbers for aligned data.',
+ id: 'HTML id attribute.',
+ xstyle: 'StyleX layout styles; must be stylex.create() value.',
+ },
+ },
+ {
+ name: 'XDSHeading',
+ description: 'Semantic h1\u20136 w/ themed styling, optional editorial scale, line-clamp truncation.',
+ propDescriptions: {
+ level: 'Visual heading level; determines HTML element + styling from theme.',
+ children: 'Heading content.',
+ accessibilityLevel: 'aria-level override when different from level for document outline.',
+ variant: "Visual variant; 'default'=dense scale (h1:20px), 'editorial'=larger (h1:32px).",
+ color: 'Text color.',
+ display: "Display type; overridden to 'block' when maxLines>0 or hasCapsize.",
+ maxLines: 'Max lines before truncation; 0=none. Shows tooltip if truncated.',
+ hasTruncateTooltip: 'Tooltip for truncated text; true=default position, false=disabled, or LayerPlacement.',
+ wordBreak: "Word break behavior; defaults 'break-all' for single-line, 'break-word' otherwise.",
+ textWrap: 'Text wrapping behavior.',
+ hasCapsize: 'Optical alignment via text-box-trim; forces block display.',
+ hasStrikethrough: 'Strikethrough text decoration.',
+ id: 'HTML id attribute.',
+ },
+ },
+ {
+ name: 'XDSFontWrapper',
+ description: 'Wrapper applying XDS typography to native HTML scope; for UGC, markdown, cases where XDSText/XDSHeading cannot be used directly.',
+ propDescriptions: {
+ children: 'Content to style w/ XDS typography.',
+ variant: "Heading scale; 'default'=dense for tools, 'editorial'=larger for content pages.",
+ },
+ },
+ {
+ name: 'useXDSFontWrapperStyles',
+ description: 'Hook returning StyleX style objects for headings + prose from current theme, for programmatic typography on native HTML.',
+ },
+ ],
+};
\ No newline at end of file
diff --git a/packages/core/src/TextArea/TextArea.doc.mjs b/packages/core/src/TextArea/TextArea.doc.mjs
index 9121ecaf07..9d1f2a371b 100644
--- a/packages/core/src/TextArea/TextArea.doc.mjs
+++ b/packages/core/src/TextArea/TextArea.doc.mjs
@@ -400,3 +400,60 @@ export const docsZh = {
'当 value.length 超过 maxLength 时,字符计数器文本变为红色。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Multi-line text input for collecting longer user input.',
+ features: [
+ 'Label support; required for a11y, can be visually hidden',
+ 'Description; optional text between label+textarea',
+ 'Optional/Required indicators; displays "Optional" or "Required" w/ bullet separator',
+ 'Status variants; warning, error, success states w/ colored borders+icons',
+ 'Character counter; displays current/max length when maxLength set',
+ 'Start icon; optional icon inside leading edge of input',
+ 'Label tooltip; optional info icon w/ tooltip at label end',
+ 'Loading state; shows spinner, uses optimistic updates via useOptimistic',
+ 'Async action support; onChangeAction fires after onChange in React transition',
+ 'Disabled state; visual opacity+cursor changes, no interaction',
+ 'Accessible; label via htmlFor/id, aria-describedby, aria-required, aria-invalid, aria-busy',
+ 'Resizable; vertical resize enabled by default, min height 80px',
+ 'Spell check; browser spell checking enabled by default, configurable',
+ ],
+ notes: [
+ 'isOptional+isRequired mutually exclusive; both set = "Optional" wins.',
+ 'Uses useOptimistic for instant UI feedback when onChangeAction returns Promise.',
+ 'Textarea has vertical resize via CSS w/ min height 80px.',
+ 'Wraps XDSField for consistent label, description, status message layout.',
+ 'Character counter text turns red when value.length exceeds maxLength.',
+ ],
+ accessibility: [
+ 'Label always in DOM; isLabelHidden hides visually, keeps a11y.',
+ 'Textarea id via useId linked to label via htmlFor for correct association.',
+ 'aria-describedby set to description+status message IDs when present.',
+ 'aria-required="true" when isRequired is true.',
+ 'aria-invalid="true" when status.type is "error".',
+ 'aria-busy set during optimistic update or loading state.',
+ ],
+ propDescriptions: {
+ label: 'Label text for textarea; always rendered for a11y.',
+ value: 'Current textarea value.',
+ onChange: 'Fired on textarea value change.',
+ onChangeAction: 'Async action after onChange in React transition. Enables useOptimistic.',
+ isLabelHidden: 'Visually hides label; keeps screen reader access.',
+ description: 'Helper text between label+textarea.',
+ isOptional: 'Shows "Optional" indicator. Mutually exclusive w/ isRequired.',
+ isRequired: 'Shows "Required" indicator+sets aria-required. Mutually exclusive w/ isOptional.',
+ isDisabled: 'Disables textarea, prevents interaction.',
+ isLoading: 'Loading state w/ spinner inside input.',
+ placeholder: 'Placeholder when textarea empty.',
+ rows: 'Visible text rows.',
+ maxLength: 'Max chars allowed. Shows counter (current/max) below textarea.',
+ status: 'Colored border+icon status. Optional floating message below textarea.',
+ labelTooltip: 'Tooltip in info icon at label end.',
+ startIcon: 'Icon inside leading edge of textarea wrapper.',
+ hasSpellCheck: 'Enables/disables browser spell checking.',
+ hasAutoFocus: 'Auto-focus textarea on mount.',
+ onPaste: 'Fired on paste into textarea.',
+ htmlName: 'HTML name attr for form submissions.',
+ },
+};
diff --git a/packages/core/src/TextInput/TextInput.doc.mjs b/packages/core/src/TextInput/TextInput.doc.mjs
index 8183736de2..d100a3e7b8 100644
--- a/packages/core/src/TextInput/TextInput.doc.mjs
+++ b/packages/core/src/TextInput/TextInput.doc.mjs
@@ -402,3 +402,52 @@ export const docsZh = {
'size 属性支持 "sm"、"md" 和 "lg"。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Text input for collecting user text w/ label, description, validation status, optional/required indicators.',
+ features: [
+ 'Label support; required for a11y (can be visually hidden)',
+ 'Description; optional text between label+input',
+ 'Optional/Required indicators; "Optional" or "Required" text w/ bullet separator',
+ 'Label tooltip; optional info icon w/ tooltip at label end',
+ 'Validation status; error, warning, success states w/ colored borders+icons',
+ 'Start icon; optional icon at input start',
+ 'Loading state; shows spinner+sets aria-busy while async action pending',
+ 'Disabled state; dims input, prevents interaction',
+ 'Accessible; label always associated via htmlFor/id; sets aria-invalid, aria-required, aria-busy, aria-describedby',
+ 'Styled w/ StyleX; uses XDS design tokens for consistent styling',
+ ],
+ notes: [
+ 'isOptional+isRequired mutually exclusive; both set = "Optional" shown.',
+ 'onChangeAction fires after onChange in React transition, enables useOptimistic for instant UI update.',
+ 'Wraps XDSField for label, description, optional/required rendering.',
+ 'size supports "sm", "md", "lg".',
+ ],
+ accessibility: [
+ 'Label always rendered+associated via htmlFor/id (useId). isLabelHidden hides visually, keeps screen reader access.',
+ 'aria-describedby auto-set when description or status message present.',
+ 'aria-invalid="true" when status.type is "error".',
+ 'aria-required="true" when isRequired is true.',
+ 'aria-busy set during optimistic update or isLoading.',
+ ],
+ propDescriptions: {
+ label: 'Label text for input; always rendered for a11y.',
+ value: 'Current input value.',
+ onChange: 'Fired on input value change.',
+ onChangeAction: 'Async action after onChange (if not prevented). Triggers optimistic update+spinner while pending.',
+ size: 'Size variant of input.',
+ isLabelHidden: 'Visually hides label; keeps screen reader access.',
+ description: 'Description text between label+input.',
+ isOptional: 'Shows "Optional" indicator. Mutually exclusive w/ isRequired.',
+ isRequired: 'Shows "Required" indicator+sets aria-required. Mutually exclusive w/ isOptional.',
+ isDisabled: 'Disables input, prevents interaction, dims element.',
+ isLoading: 'Loading state w/ spinner+aria-busy.',
+ placeholder: 'Placeholder when input empty.',
+ labelTooltip: 'Tooltip in info icon at label end.',
+ startIcon: 'SVG icon at input start (e.g. heroicons or lucide).',
+ status: 'Validation status; colored border+icon. Message floats below. Error sets aria-invalid.',
+ hasAutoFocus: 'Auto-focus input on mount.',
+ htmlName: 'HTML name attr for form submissions.',
+ },
+};
diff --git a/packages/core/src/TimeInput/TimeInput.doc.mjs b/packages/core/src/TimeInput/TimeInput.doc.mjs
index a07a1e1d82..8aa235364e 100644
--- a/packages/core/src/TimeInput/TimeInput.doc.mjs
+++ b/packages/core/src/TimeInput/TimeInput.doc.mjs
@@ -420,3 +420,50 @@ export const docsZh = {
keyboard:
'上/下方向键按配置的分钟增量调整当前时间。以常见格式(例如 "2:30 PM"、"14:30")输入时间字符串会在失焦时解析。按清除按钮将焦点返回到输入框。',
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Time input w/ free-text entry, text parsing, arrow-key navigation.',
+ features: [
+ 'Accepts free-text time entry; parses common formats (e.g. "2:30 PM", "14:30")',
+ 'Supports 12-hour+24-hour display formats',
+ 'ArrowUp/ArrowDown adjust time by configurable minute increment',
+ 'Optional seconds display via hasSeconds',
+ 'Optional clear button via hasClear',
+ 'Min/max range constraints reject out-of-range values',
+ 'Async action support via onChangeAction w/ optimistic UI+loading spinner',
+ 'Accessible; label, description, status message wired to aria-describedby; aria-required+aria-invalid reflect field state',
+ ],
+ accessibility: [
+ 'Visible label associated w/ input via htmlFor/id.',
+ 'isLabelHidden hides label visually; keeps in a11y tree.',
+ 'description+status.message linked to input via aria-describedby.',
+ 'aria-required set when isRequired is true.',
+ 'aria-invalid set when status.type is "error".',
+ 'aria-busy reflects loading/optimistic-pending state.',
+ 'Clear button has aria-label "Clear time".',
+ ],
+ keyboard: 'ArrowUp/ArrowDown adjust time by configured increment in minutes. Typing common formats (e.g. "2:30 PM", "14:30") parsed on blur. Clear button press returns focus to input.',
+ propDescriptions: {
+ label: 'Label text (required for a11y).',
+ isLabelHidden: 'Visually hides label; keeps screen reader access.',
+ description: 'Description text between label+input.',
+ isOptional: 'Shows "(optional)" indicator. Mutually exclusive w/ isRequired.',
+ isRequired: 'Marks required+sets aria-required. Mutually exclusive w/ isOptional.',
+ isDisabled: 'Disables input, suppresses interactions.',
+ value: 'Controlled time in ISO format (HH:MM or HH:MM:SS).',
+ onChange: 'Fired on time change. Receives undefined when cleared.',
+ onChangeAction: 'Async action after onChange in React transition; triggers spinner while pending.',
+ isLoading: 'Loading state w/ spinner.',
+ min: 'Min selectable time in ISO format. Out-of-range rejected.',
+ max: 'Max selectable time in ISO format. Out-of-range rejected.',
+ hasSeconds: 'Includes seconds in display+parsing.',
+ hasClear: 'Shows clear button when value set+not disabled.',
+ hourFormat: "Display format. '12h' shows AM/PM; '24h' uses 24-hour notation.",
+ increment: 'Minutes to add/subtract on arrow up/down.',
+ placeholder: 'Placeholder when empty. Focused+empty shows format hint.',
+ size: 'Input element height.',
+ status: 'Colored border+icon. Message rendered below input.',
+ labelTooltip: 'Tooltip as info icon at label row end.',
+ },
+};
diff --git a/packages/core/src/Token/Token.doc.mjs b/packages/core/src/Token/Token.doc.mjs
index 0c2a0f6ce5..db4fb64659 100644
--- a/packages/core/src/Token/Token.doc.mjs
+++ b/packages/core/src/Token/Token.doc.mjs
@@ -248,3 +248,38 @@ export const docsZh = {
keyboard:
'Tab 聚焦标记(或使用 onClick 时聚焦其内部按钮)。Enter/Space 激活可点击标记或移除按钮。移除按钮作为单独的 Tab 停靠点可达。',
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Chip/tag for displaying entities inline. Renders as <span> default, <a> w/ href, or <span> w/ invisible <button> when onClick provided.',
+ features: [
+ 'Polymorphic; renders as <span>, <a>, or interactive <span>+<button> based on props',
+ 'Invisible button pattern for onClick preserves real button semantics w/ focus-within outline on full token',
+ 'Remove button w/ expanded 14px hit-area tap target via ::after pseudo-element',
+ 'Eleven color variants including neutral default',
+ 'Leading icon+trailing endContent slots',
+ 'Label can be visually hidden; remains accessible to screen readers',
+ 'Disabled state reduces opacity, blocks pointer events',
+ ],
+ accessibility: [
+ 'isLabelHidden clips label visually but exposes via aria-label so screen readers announce it.',
+ 'description maps to aria-description for supplementary context.',
+ 'onClick wraps content in real <button> so keyboard users activate w/ Enter/Space.',
+ 'Remove button has auto aria-label "Remove <label>"+expanded touch target via ::after pseudo-element.',
+ 'href w/ isDisabled sets aria-disabled on <a>.',
+ ],
+ keyboard: 'Tab focuses token (or inner button w/ onClick). Enter/Space activate clickable token or remove button. Remove button is separate Tab stop.',
+ propDescriptions: {
+ label: 'Text label inside token.',
+ color: 'Color variant of token.',
+ icon: 'Optional icon before label.',
+ isDisabled: 'Reduces opacity, blocks interactions.',
+ onRemove: 'Fired on remove button click. Renders X button when provided.',
+ onClick: 'Click handler. Renders <span> w/ invisible <button> inside for a11y.',
+ href: 'Link URL. Renders as <a> element.',
+ description: 'A11y description via aria-description on root.',
+ endContent: 'Content after label, before remove button.',
+ isLabelHidden: 'Visually hides label w/ screen-reader-only clip; stays accessible.',
+ xstyle: 'StyleX layout styles (margins, positioning). Must be stylex.create() value.',
+ },
+};
diff --git a/packages/core/src/Tokenizer/Tokenizer.doc.mjs b/packages/core/src/Tokenizer/Tokenizer.doc.mjs
index dfb17fdd8a..a3d70f2891 100644
--- a/packages/core/src/Tokenizer/Tokenizer.doc.mjs
+++ b/packages/core/src/Tokenizer/Tokenizer.doc.mjs
@@ -446,3 +446,51 @@ export const docsZh = {
keyboard:
'在空输入框上按退格键移除最后一个标记;方向键导航下拉列表;Enter 选择高亮项目;Escape 关闭下拉列表',
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Multi-select typeahead w/ token chips for selected items. Composes XDSBaseTypeahead for search+XDSToken for chips.',
+ features: [
+ 'Token chips for each selected item w/ remove buttons',
+ 'Filtered search auto-excludes already-selected items',
+ 'Max entries limits selections; input hides at limit',
+ 'Clear all button for bulk removal of all tokens',
+ 'Custom token+item rendering via renderToken+renderItem',
+ 'Backspace on empty input removes last token',
+ "Change metadata: onChange receives second arg w/ type ('add'|'remove'|'reorder')",
+ ],
+ accessibility: [
+ 'Wrapped in XDSField for label, description, status message association.',
+ 'Token container has role="group" w/ aria-label.',
+ 'Clear all button has aria-label="Clear all".',
+ 'Combobox pattern via XDSBaseTypeahead w/ aria-expanded+aria-autocomplete.',
+ ],
+ keyboard: 'Backspace on empty input removes last token. Arrow keys navigate dropdown. Enter selects highlighted item. Escape closes dropdown.',
+ propDescriptions: {
+ label: 'Accessible label for input.',
+ searchSource: 'Data source w/ search+bootstrap methods for populating dropdown.',
+ value: 'Array of currently selected items.',
+ onChange: "Fired on selection change. Change arg includes affected item+type ('add'|'remove'|'reorder').",
+ placeholder: 'Input placeholder. Only shown when no tokens selected.',
+ maxEntries: 'Max selections allowed. Input hidden at limit.',
+ hasClear: 'Clear-all button for bulk removal.',
+ renderToken: 'Custom token render. Default renders XDSToken w/ label+onRemove.',
+ renderItem: 'Custom dropdown item render. Default renders XDSTypeaheadItem.',
+ isDisabled: 'Disables input+all token interactions.',
+ status: 'Validation status w/ type+message for error/warning/success.',
+ isLabelHidden: 'Visually hides label; keeps a11y.',
+ description: 'Helper text below label.',
+ isRequired: 'Marks field required.',
+ isOptional: 'Shows optional indicator on label.',
+ labelTooltip: 'Tooltip on label.',
+ hasEntriesOnFocus: 'Show bootstrap results on focus before typing.',
+ maxMenuItems: 'Max dropdown items to display.',
+ emptySearchResultsText: 'Text when search returns no results.',
+ hasAutoFocus: 'Auto-focus input on mount.',
+ size: 'Input+token size.',
+ debounceMs: 'Search debounce delay ms. 0 for sync sources.',
+ onChangeQuery: 'Fired on search query text change.',
+ endContent: 'Content at input row end. For buttons, counts, controls.',
+ xstyle: 'StyleX layout styles (margins, positioning). Must be stylex.create() value.',
+ },
+};
diff --git a/packages/core/src/Tooltip/Tooltip.doc.mjs b/packages/core/src/Tooltip/Tooltip.doc.mjs
index ffc88716b0..df9eaa1da8 100644
--- a/packages/core/src/Tooltip/Tooltip.doc.mjs
+++ b/packages/core/src/Tooltip/Tooltip.doc.mjs
@@ -376,3 +376,62 @@ export const docsZh = {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Hover/focus triggered tooltip for displaying short, non-interactive text anchored to trigger element.',
+ features: [
+ 'CSS Anchor Positioning for automatic placement relative to trigger',
+ 'Popover API for top-layer rendering; no React portals needed',
+ 'Hover triggers w/ configurable show+hide delays',
+ 'Focus triggers w/ auto-detection for focusable elements',
+ 'Inverted color palette (dark bg, light text) for high contrast',
+ 'display:contents wrapper preserves children refs',
+ 'Hover indication (dashed underline) for text-only triggers',
+ 'Sibling mode via anchorRef for external trigger elements',
+ ],
+ notes: [
+ "Unlike HoverCard, tooltips don't stay open when hovering tooltip content.",
+ 'Shorter delays+inverted colors for high contrast.',
+ 'For interactive content use XDSHoverCard or XDSPopover.',
+ 'Sibling mode (anchorRef) attaches to external ref instead of wrapping children.',
+ 'LayerPlacement: above|below|start|end. LayerAlignment: start|center|end.',
+ ],
+ accessibility: [
+ 'Links tooltip content to trigger via aria-describedby.',
+ 'When composing multiple aria-describedby sources, merge w/ utility.',
+ ],
+ keyboard: 'Focus on trigger shows tooltip. Blur hides it.',
+ components: [
+ {
+ name: 'XDSTooltip',
+ description: 'Component wrapper for tooltip display on hover/focus.',
+ propDescriptions: {
+ children: 'Trigger element(s) that activate tooltip.',
+ anchorRef: 'External anchor ref for sibling mode.',
+ content: 'Tooltip content, typically short text.',
+ placement: 'Position relative to anchor.',
+ alignment: 'Alignment along placement axis.',
+ delay: 'Show delay in ms.',
+ hideDelay: 'Hide delay in ms.',
+ focusTrigger: 'Controls when focus events trigger tooltip.',
+ isEnabled: 'Enables/disables tooltip triggers.',
+ hasHoverIndication: 'Dashed underline on trigger element.',
+ },
+ },
+ {
+ name: 'useXDSTooltip',
+ description: 'Hook for tooltip w/ hover/focus triggers. Builds on useXDSLayer.',
+ propDescriptions: {
+ placement: 'Position relative to anchor.',
+ alignment: 'Alignment along placement axis.',
+ delay: 'Show delay in ms.',
+ hideDelay: 'Hide delay in ms.',
+ focusTrigger: 'Controls when focus events trigger tooltip.',
+ isEnabled: 'Enables/disables all hover+focus triggers.',
+ onShow: 'Fired when tooltip becomes visible.',
+ onHide: 'Fired when tooltip hidden.',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/TopNav/TopNav.doc.mjs b/packages/core/src/TopNav/TopNav.doc.mjs
index 6246742d01..a5aab9ec04 100644
--- a/packages/core/src/TopNav/TopNav.doc.mjs
+++ b/packages/core/src/TopNav/TopNav.doc.mjs
@@ -967,3 +967,94 @@ export const docsZh = {
},
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Top navigation bar for app headers w/ slot-based layout+companion nav item components.',
+ features: [
+ 'Slot-based layout; heading, startContent, centerContent, endContent slots',
+ 'Three-column centering; centerContent switches to CSS grid (1fr auto 1fr) for true horizontal centering',
+ 'Companion components; XDSTopNavHeading, XDSTopNavItem, XDSTopNavMenu, XDSTopNavMegaMenu',
+ 'Accessible; role="navigation" w/ aria-label, aria-current="page" on selected items',
+ 'Themeable via className; target .xds-top-nav+sub-component classes',
+ 'Link customization; XDSTopNavItem accepts as prop to swap anchor element (e.g. React Router)',
+ ],
+ notes: [
+ 'Default height 48px (--spacing-12) w/ 16px horizontal padding.',
+ 'W/o centerContent: heading+startContent grow to push endContent right (flex layout).',
+ 'W/ centerContent: CSS grid (1fr auto 1fr); right column always rendered for 3-col structure.',
+ 'Positioning (sticky/fixed) handled by layout system (e.g. XDSAppShell), not TopNav.',
+ 'Dividers controlled by layout system (e.g. XDSLayoutHeader hasDivider), not TopNav.',
+ 'XDSTopNavMegaMenu panels position relative to nearest positioned ancestor; wrap in position:relative container for full-width.',
+ ],
+ accessibility: [
+ 'XDSTopNav renders <nav> w/ role="navigation"+aria-label from label prop.',
+ 'XDSTopNavItem sets aria-current="page" when isSelected.',
+ 'XDSTopNavItem sets aria-label for icon-only items (icon provided w/o children or visible label).',
+ 'XDSTopNavItem sets aria-disabled+tabIndex=-1 when isDisabled.',
+ 'XDSTopNavMenu sets aria-haspopup="true" on trigger button.',
+ 'XDSTopNavMegaMenu sets aria-haspopup="true"+aria-expanded on trigger button.',
+ 'XDSTopNavMegaMenu items unreachable by keyboard (tabIndex=-1) when panel closed.',
+ 'Escape closes XDSTopNavMegaMenu panel.',
+ ],
+ keyboard: 'Tab navigates between items. Escape closes XDSTopNavMegaMenu panels.',
+ components: [
+ {
+ name: 'XDSTopNav',
+ description: 'Main nav bar container w/ slot-based layout.',
+ propDescriptions: {
+ heading: 'Heading slot (logo, brand) at left edge.',
+ startContent: 'Nav items/breadcrumbs after heading, left-aligned.',
+ centerContent: 'Center slot (tabs, search); switches to 3-column CSS grid for true centering.',
+ endContent: 'Search/icons/profile at right edge.',
+ label: 'A11y label for nav landmark, aria-label on <nav>.',
+ xstyle: 'StyleX layout styles (margins, positioning). Must be stylex.create() value.',
+ },
+ },
+ {
+ name: 'XDSTopNavHeading',
+ description: 'Heading for XDSTopNav heading slot; displays logo+heading text, optionally as clickable link.',
+ propDescriptions: {
+ heading: 'Heading text to display.',
+ logo: 'Logo before heading text. Image, XDSNavIcon, or ReactNode.',
+ href: 'URL on click. Renders as anchor.',
+ },
+ },
+ {
+ name: 'XDSTopNavItem',
+ description: 'Nav link for XDSTopNav startContent; renders as anchor w/ hover+selected states.',
+ propDescriptions: {
+ label: 'Visible text or aria-label for icon-only items.',
+ href: 'Navigation URL.',
+ isSelected: 'Sets aria-current="page"+highlighted styles.',
+ isDisabled: 'Sets aria-disabled, prevents interaction.',
+ icon: 'Icon before label. W/o children becomes icon-only.',
+ children: 'Custom content instead of label text.',
+ as: 'Custom link component. Overrides XDSLinkProvider default. Must accept href, className, style, children.',
+ },
+ },
+ {
+ name: 'XDSTopNavMenu',
+ description: 'Nav item w/ hover-triggered popover menu containing rich items w/ icon, title, optional description.',
+ propDescriptions: {
+ label: 'Trigger button visible label.',
+ items: 'Menu items in hover popover.',
+ delay: 'Show delay ms on hover.',
+ hideDelay: 'Hide delay ms after mouse leaves.',
+ },
+ },
+ {
+ name: 'XDSTopNavMegaMenu',
+ description: 'Nav item w/ full-width mega menu panel on hover; 2-column grid+optional featured area.',
+ propDescriptions: {
+ label: 'Trigger button visible label.',
+ items: 'Menu items in mega panel.',
+ featured: 'Optional featured content on right side of mega panel.',
+ delay: 'Show delay ms on hover.',
+ hideDelay: 'Hide delay ms after mouse leaves.',
+ isSingleColumn: 'Single-column layout instead of two columns.',
+ onOpenChange: 'Fired on open/close. For coordinating wrapper styles.',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/Typeahead/Typeahead.doc.mjs b/packages/core/src/Typeahead/Typeahead.doc.mjs
index 9928aa5819..67f9de16b3 100644
--- a/packages/core/src/Typeahead/Typeahead.doc.mjs
+++ b/packages/core/src/Typeahead/Typeahead.doc.mjs
@@ -830,3 +830,97 @@ export const docsZh = {
'如果项目具有 element 属性,XDSTypeaheadItem 会直接渲染它而不是标准布局。',
],
};
+
+/** @type {import('../docs-types').TranslationDoc} */
+export const docsDense = {
+ description: 'Searchable dropdown for single-item selection w/ keyboard navigation. Supports async+sync search via searchSource interface.',
+ features: [
+ 'Async+sync search via searchSource w/ search()+bootstrap() methods',
+ 'Bootstrap results shown on focus before typing (via hasEntriesOnFocus)',
+ 'Edit mode: clicking selected token enters edit w/ text pre-populated+selected',
+ 'Combobox ARIA pattern for full a11y',
+ 'Debounced search w/ configurable delay (default 150ms, 0 for sync)',
+ 'Two-layer architecture: XDSBaseTypeahead provides engine, XDSTypeahead adds field chrome',
+ ],
+ notes: [
+ 'XDSSearchSource requires items implementing XDSSearchableItem ({ id: string; label: string; [key: string]: unknown }).',
+ 'Edit mode: clicking selected token removes it visually, populates input w/ label text, selects all. Blur w/o selecting restores original.',
+ 'XDSBaseTypeahead renders only <input>+dropdown popover; consumers provide wrapper.',
+ 'If item has element property, XDSTypeaheadItem renders it directly instead of standard layout.',
+ ],
+ accessibility: [
+ 'Combobox ARIA: role="combobox", aria-expanded, aria-autocomplete="list".',
+ 'Dropdown role="listbox" w/ role="option" on each item.',
+ 'aria-activedescendant tracks highlighted option.',
+ 'Selected item has aria-selected="true".',
+ 'Loading state has role="status" w/ aria-label="Loading".',
+ 'XDSTypeahead wraps in XDSField for label+description association.',
+ ],
+ keyboard: 'Arrow keys navigate dropdown items. Enter selects highlighted item. Escape closes dropdown or restores previous value in edit mode. Home/End jump to first/last item.',
+ components: [
+ {
+ name: 'XDSTypeahead',
+ description: 'Styled typeahead w/ label, description, validation. Wraps XDSBaseTypeahead+XDSField.',
+ propDescriptions: {
+ label: 'Accessible label for input.',
+ searchSource: 'Data source w/ search+bootstrap methods for populating dropdown.',
+ value: 'Selected item or null.',
+ onChange: 'Fired on selection change.',
+ placeholder: 'Input placeholder text.',
+ hasEntriesOnFocus: 'Show bootstrap results on focus before typing.',
+ hasClear: 'Clear button to deselect current value.',
+ isDisabled: 'Disables input.',
+ maxMenuItems: 'Max dropdown items to display.',
+ status: 'Validation status w/ type+message for error/warning/success.',
+ renderItem: 'Custom dropdown item render. Default renders XDSTypeaheadItem.',
+ isLabelHidden: 'Visually hides label; keeps a11y.',
+ description: 'Helper text below label.',
+ isRequired: 'Marks field required.',
+ isOptional: 'Shows optional indicator on label.',
+ labelTooltip: 'Tooltip on label.',
+ emptySearchResultsText: 'Text when search returns no results.',
+ hasAutoFocus: 'Auto-focus input on mount.',
+ size: 'Input+token size.',
+ debounceMs: 'Search debounce ms. 0 for sync.',
+ onChangeQuery: 'Fired on search query text change.',
+ onOpenChange: 'Fired on dropdown open/close.',
+ xstyle: 'StyleX layout styles. Must be stylex.create() value.',
+ },
+ },
+ {
+ name: 'XDSBaseTypeahead',
+ description: 'Unstyled combobox engine; input+search+keyboard nav+dropdown. No wrapper/border/token. Used by XDSTypeahead+XDSTokenizer.',
+ propDescriptions: {
+ searchSource: 'Data source w/ search+bootstrap methods.',
+ value: 'Currently selected item.',
+ onChange: 'Fired on selection change.',
+ renderItem: 'Custom dropdown item render.',
+ placeholder: 'Input placeholder.',
+ hasEntriesOnFocus: 'Bootstrap results on focus.',
+ maxMenuItems: 'Max dropdown items.',
+ emptySearchResultsText: 'Text when no results.',
+ isDisabled: 'Whether input disabled.',
+ hasAutoFocus: 'Auto-focus on mount.',
+ debounceMs: 'Search debounce ms. 0 for sync.',
+ anchorRef: 'Anchor for dropdown positioning. Defaults to input.',
+ inputXStyle: 'Additional StyleX styles for input.',
+ onKeyDown: 'Keydown before internal nav. preventDefault() skips internal handling.',
+ onChangeQuery: 'Fired on query text change.',
+ onOpenChange: 'Fired on dropdown open/close.',
+ inputId: 'Input ID for label association.',
+ ariaDescribedBy: 'Additional aria-describedby IDs.',
+ },
+ },
+ {
+ name: 'XDSTypeaheadItem',
+ description: 'Default dropdown item renderer. Label w/ optional icon, description, avatar. Exported for custom renderItem.',
+ propDescriptions: {
+ item: 'Search result item to render.',
+ icon: 'Icon/avatar before label.',
+ description: 'Text below label.',
+ isDisabled: 'Visually disabled.',
+ group: 'Group label for visual grouping.',
+ },
+ },
+ ],
+};
diff --git a/packages/core/src/docs-types.ts b/packages/core/src/docs-types.ts
index ea1eb3cdd7..e16f4abdb7 100644
--- a/packages/core/src/docs-types.ts
+++ b/packages/core/src/docs-types.ts
@@ -199,3 +199,46 @@ export interface MultiComponentDoc extends BaseDoc {
* Use MultiComponentDoc (with `components`) for multi-component directories.
*/
export type ComponentDoc = SingleComponentDoc | MultiComponentDoc;
+
+/**
+ * Translation overlay for component documentation.
+ *
+ * Contains only the prose fields that change between languages/formats.
+ * The CLI merges this onto the base `docs` at read time — props, examples,
+ * types, defaults, and code all come from `docs`.
+ *
+ * Used by both `docsZh` (Chinese translation) and `docsDense` (compressed format).
+ *
+ * @example
+ * ```
+ * export const docsDense = {
+ * description: 'multi-variant btn w/ loading',
+ * features: ['4 variants: primary secondary ghost destructive'],
+ * propDescriptions: { label: 'a11y label; aria-label for icon-only' },
+ * notes: ['prefer over div onClick for a11y'],
+ * };
+ * ```
+ */
+export interface TranslationDoc {
+ /** Compressed/translated component description. */
+ description: string;
+ /** Compressed/translated feature strings. Must match docs.features length and order. */
+ features?: string[];
+ /** Compressed/translated note strings. Must match docs.notes length and order. */
+ notes?: string[];
+ /** Compressed/translated accessibility strings. Must match docs.accessibility length and order. */
+ accessibility?: string[];
+ /** Compressed/translated keyboard string. */
+ keyboard?: string;
+ /** Prop descriptions keyed by prop name. Only include props that have descriptions. */
+ propDescriptions?: Record<string, string>;
+ /** Sub-component translations. Must match docs.components length and order (if present). */
+ components?: Array<{
+ /** Exact name from docs.components[n].name */
+ name: string;
+ /** Compressed/translated sub-component description. */
+ description: string;
+ /** Prop descriptions keyed by prop name. */
+ propDescriptions?: Record<string, string>;
+ }>;
+}