diff --git a/packages/components/.prettierrc.cjs b/packages/components/.prettierrc.cjs index a3e2d4feefb..036db09cf9b 100644 --- a/packages/components/.prettierrc.cjs +++ b/packages/components/.prettierrc.cjs @@ -3,10 +3,21 @@ module.exports = { plugins: ['prettier-plugin-ember-template-tag'], trailingComma: 'es5', + + jsdocPrintWidth: 80, + overrides: [ { - files: '*.{js,gjs,ts,gts,mjs,mts,cjs,cts}', + files: '*.{ts,mts,cts,js,cjs,mjs}', + options: { + singleQuote: true, + plugins: ['prettier-plugin-jsdoc'], + }, + }, + { + files: '*.{gjs,gts}', options: { + plugins: ['prettier-plugin-ember-template-tag'], singleQuote: true, templateSingleQuote: false, }, diff --git a/packages/components/package.json b/packages/components/package.json index 5fcfc12334b..201738c5fe4 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -17,7 +17,10 @@ "license": "MPL-2.0", "author": "HashiCorp Design Systems ", "scripts": { - "build": "rollup --config", + "build": "rollup --config && node scripts/parse-docs.mjs", + "catalog:build": "node scripts/build-component-catalog.mjs", + "catalog:enrich": "node scripts/enrich-component-catalog-from-docs.mjs", + "catalog:generate": "node scripts/generate-component-catalog.mjs", "format": "prettier . --cache --write", "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto", "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm run format", @@ -92,6 +95,9 @@ "@types/luxon": "^3.4.2", "@types/prismjs": "^1.26.5", "babel-plugin-ember-template-compilation": "^2.4.1", + "boxen": "^8.0.1", + "chalk": "^5.4.1", + "cli-table3": "^0.6.5", "concurrently": "^9.1.2", "ember-basic-dropdown": "^8.8.0", "ember-intl": "^8.0.0", @@ -104,9 +110,12 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-n": "^17.18.0", "globals": "^16.0.0", + "log-symbols": "^7.0.1", + "ora": "^9.4.1", "postcss": "^8.5.10", "prettier": "^3.5.3", "prettier-plugin-ember-template-tag": "^2.0.5", + "prettier-plugin-jsdoc": "^1.8.1", "rollup": "^4.59.0", "rollup-plugin-copy": "^3.5.0", "rollup-plugin-scss": "^4.0.1", @@ -114,6 +123,7 @@ "stylelint": "^16.17.0", "stylelint-config-rational-order": "^0.1.2", "stylelint-config-standard-scss": "^14.0.0", + "ts-morph": "^28.0.0", "typescript": "^5.8.2", "typescript-eslint": "^8.29.0", "webpack": "^5.97.1" diff --git a/packages/components/scripts/build-component-catalog.mjs b/packages/components/scripts/build-component-catalog.mjs new file mode 100644 index 00000000000..37854a2c117 --- /dev/null +++ b/packages/components/scripts/build-component-catalog.mjs @@ -0,0 +1,113 @@ +/** Copyright IBM Corp. 2021, 2026 SPDX-License-Identifier: MPL-2.0 */ + +import { execFileSync } from 'node:child_process'; +import { dirname, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url)); +const GENERATE_SCRIPT_PATH = resolve(SCRIPT_DIR, 'generate-component-catalog.mjs'); +const ENRICH_SCRIPT_PATH = resolve( + SCRIPT_DIR, + 'enrich-component-catalog-from-docs.mjs' +); + +function runNodeScript(scriptPath, args) { + execFileSync(process.execPath, [scriptPath, ...args], { + stdio: 'inherit', + }); +} + +function parseCliOptions(argv) { + let component = null; + let group = null; + let provider = null; + let yes = false; + + for (let index = 0; index < argv.length; index += 1) { + const arg = argv[index]; + + if (arg === '--') { + continue; + } + + if (arg.startsWith('--component=')) { + component = arg.slice('--component='.length).trim(); + continue; + } + + if (arg === '--component') { + component = `${argv[index + 1] || ''}`.trim(); + index += 1; + continue; + } + + if (arg.startsWith('--group=')) { + group = arg.slice('--group='.length).trim(); + continue; + } + + if (arg === '--group') { + group = `${argv[index + 1] || ''}`.trim(); + index += 1; + continue; + } + + if (arg.startsWith('--provider=')) { + provider = arg.slice('--provider='.length).trim(); + continue; + } + + if (arg === '--provider') { + provider = `${argv[index + 1] || ''}`.trim(); + index += 1; + continue; + } + + if (arg === '--yes') { + yes = true; + continue; + } + + throw new Error(`Unknown argument: ${arg}`); + } + + return { + component, + group, + provider, + yes, + }; +} + +function main() { + const options = parseCliOptions(process.argv.slice(2)); + const generateArgs = []; + const enrichArgs = []; + + if (options.group) { + generateArgs.push(`--group=${options.group}`); + enrichArgs.push(`--group=${options.group}`); + } + + if (options.component) { + generateArgs.push(`--component=${options.component}`); + } + + if (options.component) { + enrichArgs.push(`--component=${options.component}`); + } + + if (options.provider) { + enrichArgs.push(`--provider=${options.provider}`); + } + + enrichArgs.push('--yes'); + + console.log('Step 1/2: Generating base component catalog'); + runNodeScript(GENERATE_SCRIPT_PATH, generateArgs); + + console.log('\nStep 2/2: Enriching catalog with component docs'); + runNodeScript(ENRICH_SCRIPT_PATH, enrichArgs); +} + +main(); diff --git a/packages/components/scripts/enrich-component-catalog-from-docs.mjs b/packages/components/scripts/enrich-component-catalog-from-docs.mjs new file mode 100644 index 00000000000..d8d5d31efe3 --- /dev/null +++ b/packages/components/scripts/enrich-component-catalog-from-docs.mjs @@ -0,0 +1,1746 @@ +/** Copyright IBM Corp. 2021, 2026 SPDX-License-Identifier: MPL-2.0 */ + +import { existsSync, readFileSync, readdirSync, writeFileSync } from 'node:fs'; +import { execFileSync } from 'node:child_process'; +import { dirname, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { createInterface } from 'node:readline/promises'; +import { stdin as input, stdout as output } from 'node:process'; +import chalk from 'chalk'; +import ora from 'ora'; +import Table from 'cli-table3'; +import boxen from 'boxen'; +import logSymbols from 'log-symbols'; + +const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url)); +const COMPONENTS_ROOT = resolve(SCRIPT_DIR, '..'); +const REPO_ROOT = resolve(COMPONENTS_ROOT, '..', '..'); +const CATALOG_PATH = resolve( + REPO_ROOT, + 'packages/mcp/src/catalogs/components/catalog.json' +); +const DOCS_COMPONENTS_ROOT = resolve(REPO_ROOT, 'website/docs/components'); +const MODEL_PRICING_USD_PER_MILLION_TOKENS = { + 'openai/gpt-4.1': { + input: 2, + output: 8, + }, + 'openai/gpt-4.1-mini': { + input: 0.4, + output: 1.6, + }, +}; +const REVIEW_DOCS_CHAR_LIMIT = 16000; + +function toRepoRelativePath(filePath) { + return filePath.replace(`${REPO_ROOT}/`, ''); +} + +function formatUsd(value) { + return `$${value.toFixed(6)}`; +} + +function normalizeInlineText(text, maxLength = 120) { + const normalized = `${text || ''}`.replace(/\s+/gu, ' ').trim(); + + if (normalized.length <= maxLength) { + return normalized; + } + + return `${normalized.slice(0, maxLength - 1)}...`; +} + +function markdownCell(text, maxLength = 120) { + return normalizeInlineText(text, maxLength).replace(/\|/gu, '\\|'); +} + +function printPanel(title, lines, color = 'cyan') { + const panelText = [chalk.bold(title), ...lines].join('\n'); + + console.log( + boxen(panelText, { + padding: 1, + margin: { top: 1, bottom: 0 }, + borderStyle: 'round', + borderColor: color, + }) + ); +} + +function printTable(headers, rows) { + if (!Array.isArray(headers) || headers.length === 0 || !Array.isArray(rows)) { + return; + } + + const table = new Table({ + head: headers.map((header) => chalk.bold(header)), + style: { + head: [], + border: [], + }, + wordWrap: true, + }); + + for (const row of rows) { + table.push(row); + } + + console.log(table.toString()); +} + +function extractYieldNamesFromText(text) { + if (typeof text !== 'string' || text.length === 0) { + return []; + } + + const names = new Set(); + const scopedRegex = /\[[A-Z]\]\.([A-Za-z_][A-Za-z0-9_]*)/gu; + const codeRegex = /`([A-Za-z_][A-Za-z0-9_]*)`/gu; + let match; + + while ((match = scopedRegex.exec(text)) !== null) { + names.add(match[1]); + } + + while ((match = codeRegex.exec(text)) !== null) { + names.add(match[1]); + } + + return [...names]; +} + +function classifyReviewIssues(componentAfter, review) { + const groups = { + mismatches: [], + docsInconsistencies: [], + uncertain: [], + }; + + if (!review || !Array.isArray(review.issues)) { + return groups; + } + + const blockYieldMap = new Map(); + + function isNoIssueText(value) { + if (typeof value !== 'string') { + return false; + } + + return /\b(matches docs|matches the markdown|no issue)\b/iu.test(value); + } + + function isLikelyDocsInconsistency(issue) { + const joined = `${issue.reason || ''} ${issue.expected || ''} ${issue.actual || ''}`; + + return ( + /\bdocs?\b/iu.test(joined) && + (/not documented/iu.test(joined) || + /possible omission in docs/iu.test(joined) || + /docs yield/iu.test(joined) || + /omits?/iu.test(joined)) + ); + } + + for (const block of componentAfter.blocks || []) { + blockYieldMap.set( + block.name, + new Set((block.yields || []).map((yieldEntry) => yieldEntry.name)) + ); + } + + for (const issue of review.issues) { + if ( + isNoIssueText(issue.reason) && + (!issue.expected || issue.expected === '-') && + (!issue.actual || issue.actual === '-') + ) { + continue; + } + + if (issue.kind === 'docs_inconsistency') { + groups.docsInconsistencies.push(issue); + continue; + } + + if (issue.kind === 'uncertain') { + groups.uncertain.push(issue); + continue; + } + + const blockYieldPathMatch = issue.path.match(/^changedBlocks\.([^.]+)\.yields/u); + + if (blockYieldPathMatch) { + const blockName = blockYieldPathMatch[1]; + const yieldedNames = blockYieldMap.get(blockName) || new Set(); + const mentionedNames = extractYieldNamesFromText( + `${issue.expected || ''} ${issue.reason || ''}` + ); + const referencesMissingYields = + /missing yields?/iu.test(issue.actual || '') || /not present/iu.test(issue.reason || ''); + + if ( + referencesMissingYields && + mentionedNames.length > 0 && + mentionedNames.every((name) => !yieldedNames.has(name)) + ) { + groups.docsInconsistencies.push({ + ...issue, + kind: 'docs_inconsistency', + severity: issue.severity || 'warning', + reason: `${issue.reason} (classified as docs/code inconsistency because these yields are not in component signature output)`, + }); + continue; + } + + if (isLikelyDocsInconsistency(issue)) { + groups.docsInconsistencies.push({ + ...issue, + kind: 'docs_inconsistency', + severity: issue.severity || 'warning', + }); + continue; + } + } + + groups.mismatches.push(issue); + } + + return groups; +} + +function printReviewReport(componentName, review, classifiedIssues, usage, cost) { + const passed = classifiedIssues.mismatches.length === 0; + const statusLabel = passed + ? `${logSymbols.success} ${chalk.bold.green('PASS')}` + : `${logSymbols.warning} ${chalk.bold.yellow('NEEDS ATTENTION')}`; + const confidenceText = + typeof review?.confidence === 'number' ? review.confidence.toFixed(2) : 'n/a'; + + printPanel( + `Review Report: ${componentName}`, + [ + `Status: ${statusLabel}`, + `Confidence: ${chalk.bold(confidenceText)}`, + ], + passed ? 'green' : 'yellow' + ); + + console.log(chalk.bold.cyan('Usage and Cost')); + printTable( + ['Metric', 'Value'], + [ + ['Prompt tokens', `${usage.promptTokens}`], + ['Completion tokens', `${usage.completionTokens}`], + ['Total tokens', `${usage.totalTokens}`], + ['Estimated input cost', formatUsd(cost.inputCost)], + ['Estimated output cost', formatUsd(cost.outputCost)], + ['Estimated total cost', formatUsd(cost.totalCost)], + ] + ); + + if (classifiedIssues.mismatches.length > 0) { + console.log(chalk.bold.magenta('Issues')); + printTable( + ['Path', 'Reason', 'Expected', 'Actual'], + classifiedIssues.mismatches.map((issue) => [ + chalk.cyan(markdownCell(issue.path, 60)), + markdownCell(issue.reason, 120), + markdownCell(issue.expected || '-', 90), + markdownCell(issue.actual || '-', 90), + ]) + ); + } else { + console.log(`${logSymbols.success} ${chalk.green('Issues: none')}`); + } + + if (classifiedIssues.docsInconsistencies.length > 0) { + console.log(chalk.bold.yellow('Docs Inconsistencies (non-blocking)')); + printTable( + ['Path', 'Reason', 'Expected', 'Actual'], + classifiedIssues.docsInconsistencies.map((issue) => [ + chalk.yellow(markdownCell(issue.path, 60)), + markdownCell(issue.reason, 120), + markdownCell(issue.expected || '-', 90), + markdownCell(issue.actual || '-', 90), + ]) + ); + } + + if (classifiedIssues.uncertain.length > 0) { + console.log(chalk.bold.blue('Uncertain (needs human check)')); + printTable( + ['Path', 'Reason', 'Expected', 'Actual'], + classifiedIssues.uncertain.map((issue) => [ + chalk.blue(markdownCell(issue.path, 60)), + markdownCell(issue.reason, 120), + markdownCell(issue.expected || '-', 90), + markdownCell(issue.actual || '-', 90), + ]) + ); + } + + if (Array.isArray(review?.notes) && review.notes.length > 0) { + console.log(chalk.bold.yellow('Notes')); + + for (const note of review.notes) { + console.log(`${chalk.yellow('•')} ${normalizeInlineText(note, 220)}`); + } + } +} + +function startTaskSpinner(text) { + if (!process.stdout.isTTY) { + console.log(`${logSymbols.info} ${text}`); + + return { + stopAndPersist(options = {}) { + const symbol = options.symbol || logSymbols.info; + const message = options.text || text; + console.log(`${symbol} ${message}`); + }, + set text(nextText) { + console.log(`${logSymbols.info} ${nextText}`); + }, + }; + } + + return ora({ + text, + color: 'cyan', + }).start(); +} + +function normalizeGroupSlug(groupName) { + return `${groupName || ''}`.toLowerCase().replace(/[^a-z0-9]/g, ''); +} + +function parseCliOptions(argv) { + let component = null; + let group = null; + let yes = false; + let provider = 'copilot'; + + for (let index = 0; index < argv.length; index += 1) { + const arg = argv[index]; + + if (arg.startsWith('--component=')) { + component = arg.slice('--component='.length).trim(); + continue; + } + + if (arg === '--component') { + component = `${argv[index + 1] || ''}`.trim(); + index += 1; + continue; + } + + if (arg.startsWith('--group=')) { + group = arg.slice('--group='.length).trim(); + continue; + } + + if (arg === '--group') { + group = `${argv[index + 1] || ''}`.trim(); + index += 1; + continue; + } + + if (arg === '--yes') { + yes = true; + continue; + } + + if (arg.startsWith('--provider=')) { + provider = arg.slice('--provider='.length).trim(); + continue; + } + + if (arg === '--provider') { + provider = `${argv[index + 1] || ''}`.trim(); + index += 1; + continue; + } + + throw new Error(`Unknown argument: ${arg}`); + } + + if (component === '') { + throw new Error('The --component option requires a non-empty value.'); + } + + if (group === '') { + throw new Error('The --group option requires a non-empty value.'); + } + + if (!['copilot'].includes(provider)) { + throw new Error(`Unsupported provider: ${provider}`); + } + + return { + component, + group, + yes, + provider, + }; +} + +function readCatalog() { + if (!existsSync(CATALOG_PATH)) { + throw new Error(`Catalog file does not exist: ${CATALOG_PATH}`); + } + + const parsed = JSON.parse(readFileSync(CATALOG_PATH, 'utf8')); + + if (!parsed || !Array.isArray(parsed.components)) { + throw new Error(`Catalog file is malformed: ${CATALOG_PATH}`); + } + + return parsed; +} + +function getComponentDocSlug(component) { + const sourcePath = component.sourcePath || ''; + const match = sourcePath.match(/\/components\/hds\/([^/]+)/u); + + if (match && match[1]) { + return match[1]; + } + + const fallback = component.name + .replace(/^Hds/u, '') + .replace(/([a-z0-9])([A-Z])/gu, '$1-$2') + .toLowerCase(); + + return fallback; +} + +let cachedComponentApiDocPaths = null; + +function collectComponentApiDocPaths(rootDir) { + if (!existsSync(rootDir)) { + return []; + } + + const foundPaths = []; + const queue = [rootDir]; + + while (queue.length > 0) { + const currentDir = queue.pop(); + const entries = readdirSync(currentDir, { withFileTypes: true }); + + for (const entry of entries) { + const entryPath = resolve(currentDir, entry.name); + + if (entry.isDirectory()) { + queue.push(entryPath); + continue; + } + + if ( + entry.isFile() && + (entry.name === 'component-api.md' || entry.name === 'component-api.mdx') + ) { + foundPaths.push(entryPath); + } + } + } + + return foundPaths; +} + +function getAllComponentApiDocPaths() { + if (!cachedComponentApiDocPaths) { + cachedComponentApiDocPaths = collectComponentApiDocPaths(DOCS_COMPONENTS_ROOT); + } + + return cachedComponentApiDocPaths; +} + +function getDocsFileCandidates(component) { + const slug = getComponentDocSlug(component); + const discoveredPaths = getAllComponentApiDocPaths().filter((path) => + path.includes(`/${slug}/`) + ); + + const candidates = [ + resolve( + REPO_ROOT, + `website/docs/components/${slug}/partials/code/component-api.md` + ), + resolve( + REPO_ROOT, + `website/docs/components/${slug}/partials/code/component-api.mdx` + ), + ]; + + for (const discoveredPath of discoveredPaths) { + candidates.push(discoveredPath); + } + + return [...new Set(candidates)]; +} + +function componentDisplayName(component) { + return component.name.replace(/^Hds/u, '').replace(/([a-z0-9])([A-Z])/gu, '$1 $2'); +} + +function extractDocPropertyNames(docsText) { + const names = new Set(); + const nameRegex = /@name="([^"]+)"/gu; + let match; + + while ((match = nameRegex.exec(docsText)) !== null) { + const normalized = `${match[1]}`.trim(); + + if (normalized.length > 0) { + names.add(normalized); + } + } + + return names; +} + +function extractCatalogNamesForMatch(component) { + const names = new Set(); + + for (const arg of component.args || []) { + names.add(arg.name); + } + + for (const block of component.blocks || []) { + names.add(`<:${block.name}>`); + names.add(block.name); + + for (const yieldEntry of block.yields || []) { + names.add(yieldEntry.name); + names.add(`[C].${yieldEntry.name}`); + } + } + + return names; +} + +function scoreDocCandidate(component, candidatePath) { + const signals = []; + const exists = existsSync(candidatePath); + + if (!exists) { + return { + path: candidatePath, + exists: false, + confidence: 0, + signals, + hasComponentApiHeading: false, + hasExpectedTitle: false, + overlapRatio: 0, + docsText: null, + }; + } + + const docsText = readFileSync(candidatePath, 'utf8'); + let score = 0.45; + signals.push('path exists (+0.45)'); + + const hasComponentApiHeading = docsText.includes('## Component API'); + + if (hasComponentApiHeading) { + score += 0.2; + signals.push('has Component API heading (+0.20)'); + } + + const displayName = componentDisplayName(component); + const hasExpectedTitle = docsText.includes(`### ${displayName}`); + + if (hasExpectedTitle) { + score += 0.2; + signals.push('matches expected section title (+0.20)'); + } + + const docNames = extractDocPropertyNames(docsText); + const catalogNames = extractCatalogNamesForMatch(component); + + let matchedCount = 0; + + if (catalogNames.size > 0) { + for (const name of catalogNames) { + if (docNames.has(name)) { + matchedCount += 1; + } + } + } + + const overlapRatio = + catalogNames.size > 0 ? Math.min(1, matchedCount / catalogNames.size) : 0; + + if (overlapRatio > 0) { + const overlapContribution = overlapRatio * 0.15; + score += overlapContribution; + signals.push( + `name overlap ${matchedCount}/${catalogNames.size} (+${overlapContribution.toFixed( + 2 + )})` + ); + } + + return { + path: candidatePath, + exists, + confidence: Math.min(1, score), + signals, + hasComponentApiHeading, + hasExpectedTitle, + overlapRatio, + docsText, + }; +} + +function selectDocsFile(component) { + const candidates = getDocsFileCandidates(component); + const scoredCandidates = candidates.map((candidatePath) => + scoreDocCandidate(component, candidatePath) + ); + const existingCandidates = scoredCandidates.filter((candidate) => candidate.exists); + + if (existingCandidates.length === 0) { + return { + selected: null, + candidates: scoredCandidates, + }; + } + + existingCandidates.sort((a, b) => b.confidence - a.confidence); + + return { + selected: existingCandidates[0], + candidates: scoredCandidates, + }; +} + +function componentMatchesFilters(component, options) { + if (options.component && component.name !== options.component) { + return false; + } + + if (!options.group) { + return true; + } + + return ( + normalizeGroupSlug(getComponentDocSlug(component)) === + normalizeGroupSlug(options.group) + ); +} + +async function confirmDocPath(docPath, componentName, yes) { + if (yes || !process.stdin.isTTY) { + return true; + } + + const relativePath = toRepoRelativePath(docPath); + const rl = createInterface({ input, output }); + + try { + const answer = await rl.question( + `Use ${relativePath} to enrich ${componentName}? [Y/n] ` + ); + const normalized = answer.trim().toLowerCase(); + + return normalized === '' || normalized === 'y' || normalized === 'yes'; + } finally { + rl.close(); + } +} + +function getPricing(model) { + const envInput = Number.parseFloat(process.env.COPILOT_PRICE_INPUT_PER_MILLION || ''); + const envOutput = Number.parseFloat( + process.env.COPILOT_PRICE_OUTPUT_PER_MILLION || '' + ); + + if (Number.isFinite(envInput) && Number.isFinite(envOutput)) { + return { + input: envInput, + output: envOutput, + source: 'env', + }; + } + + if (MODEL_PRICING_USD_PER_MILLION_TOKENS[model]) { + return { + ...MODEL_PRICING_USD_PER_MILLION_TOKENS[model], + source: 'default', + }; + } + + return { + input: 0, + output: 0, + source: 'none', + }; +} + +function resolveCopilotToken() { + const envToken = process.env.GITHUB_TOKEN || process.env.COPILOT_API_KEY; + + if (typeof envToken === 'string' && envToken.trim().length > 0) { + return { + token: envToken.trim(), + source: process.env.GITHUB_TOKEN ? 'GITHUB_TOKEN' : 'COPILOT_API_KEY', + }; + } + + try { + const ghToken = execFileSync('gh', ['auth', 'token'], { + encoding: 'utf8', + stdio: ['ignore', 'pipe', 'ignore'], + }).trim(); + + if (ghToken.length > 0) { + return { + token: ghToken, + source: 'gh auth token', + }; + } + } catch { + // no-op: fall through to explicit error + } + + throw new Error( + 'Missing Copilot token. Set GITHUB_TOKEN/COPILOT_API_KEY or authenticate with `gh auth login`.' + ); +} + +function normalizeUsage(rawUsage) { + if (!rawUsage || typeof rawUsage !== 'object') { + return { + promptTokens: 0, + completionTokens: 0, + totalTokens: 0, + }; + } + + const promptTokens = + Number(rawUsage.prompt_tokens ?? rawUsage.input_tokens ?? rawUsage.promptTokens ?? 0) || + 0; + const completionTokens = + Number( + rawUsage.completion_tokens ?? + rawUsage.output_tokens ?? + rawUsage.completionTokens ?? + 0 + ) || 0; + const totalTokens = + Number(rawUsage.total_tokens ?? rawUsage.totalTokens ?? promptTokens + completionTokens) || + promptTokens + completionTokens; + + return { + promptTokens, + completionTokens, + totalTokens, + }; +} + +function estimateCostUsd(usage, pricing) { + const inputCost = (usage.promptTokens / 1_000_000) * pricing.input; + const outputCost = (usage.completionTokens / 1_000_000) * pricing.output; + + return { + inputCost, + outputCost, + totalCost: inputCost + outputCost, + }; +} + +async function callCopilotJson({ token, model, systemPrompt, userPrompt }) { + const baseUrl = + process.env.COPILOT_BASE_URL || + 'https://models.github.ai/inference/chat/completions'; + + const response = await fetch(baseUrl, { + method: 'POST', + headers: { + Authorization: `Bearer ${token}`, + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + model, + temperature: 0, + response_format: { type: 'json_object' }, + messages: [ + { + role: 'system', + content: systemPrompt, + }, + { + role: 'user', + content: userPrompt, + }, + ], + }), + }); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(`Copilot request failed (${response.status}): ${errorText}`); + } + + const payload = await response.json(); + const content = + payload?.choices?.[0]?.message?.content || payload?.choices?.[0]?.text || ''; + + return { + parsed: safeParseJsonObject(content), + usage: normalizeUsage(payload?.usage), + }; +} + +function safeParseJsonObject(rawText) { + if (!rawText) { + return null; + } + + const trimmed = rawText.trim(); + + try { + return JSON.parse(trimmed); + } catch { + const fenceMatch = trimmed.match(/```(?:json)?\s*([\s\S]*?)```/u); + + if (fenceMatch?.[1]) { + try { + return JSON.parse(fenceMatch[1].trim()); + } catch { + return null; + } + } + + return null; + } +} + +function sanitizeString(value) { + if (typeof value !== 'string') { + return null; + } + + const normalized = value.replace(/\s+/g, ' ').trim(); + + return normalized.length > 0 ? normalized : null; +} + +function sanitizeEnrichmentPayload(payload) { + if (!payload || typeof payload !== 'object') { + return null; + } + + const result = {}; + + const summary = sanitizeString(payload.summary); + + if (summary) { + result.summary = summary; + } + + if (Array.isArray(payload.args)) { + const args = payload.args + .map((arg) => { + if (!arg || typeof arg !== 'object') { + return null; + } + + const name = sanitizeString(arg.name); + + if (!name) { + return null; + } + + const item = { name }; + const itemSummary = sanitizeString(arg.summary); + const itemDefault = sanitizeString(arg.default); + + if (itemSummary) { + item.summary = itemSummary; + } + + if (itemDefault) { + item.default = itemDefault; + } + + return item; + }) + .filter(Boolean); + + if (args.length > 0) { + result.args = args; + } + } + + if (Array.isArray(payload.blocks)) { + const blocks = payload.blocks + .map((block) => { + if (!block || typeof block !== 'object') { + return null; + } + + const name = sanitizeString(block.name); + + if (!name) { + return null; + } + + const item = { name }; + const blockSummary = sanitizeString(block.summary); + + if (blockSummary) { + item.summary = blockSummary; + } + + if (Array.isArray(block.yields)) { + const yields = block.yields + .map((yieldEntry) => { + if (!yieldEntry || typeof yieldEntry !== 'object') { + return null; + } + + const yieldName = sanitizeString(yieldEntry.name); + const yieldSummary = sanitizeString(yieldEntry.summary); + + if (!yieldName || !yieldSummary) { + return null; + } + + return { + name: yieldName, + summary: yieldSummary, + }; + }) + .filter(Boolean); + + if (yields.length > 0) { + item.yields = yields; + } + } + + return item; + }) + .filter(Boolean); + + if (blocks.length > 0) { + result.blocks = blocks; + } + } + + return Object.keys(result).length > 0 ? result : null; +} + +function sanitizeReviewPayload(payload) { + if (!payload || typeof payload !== 'object') { + return null; + } + + const status = payload.status === 'needs_attention' ? 'needs_attention' : 'pass'; + const confidenceNumber = Number(payload.confidence); + const confidence = Number.isFinite(confidenceNumber) + ? Math.max(0, Math.min(1, confidenceNumber)) + : undefined; + const issues = Array.isArray(payload.issues) + ? payload.issues + .map((issue) => { + if (!issue || typeof issue !== 'object') { + return null; + } + + const path = sanitizeString(issue.path); + const expected = sanitizeString(issue.expected); + const actual = sanitizeString(issue.actual); + const reason = sanitizeString(issue.reason); + + if (!path || !reason) { + return null; + } + + const nextIssue = { path, reason }; + const kind = sanitizeString(issue.kind); + const severity = sanitizeString(issue.severity); + + if ( + kind && + ['mismatch', 'docs_inconsistency', 'uncertain'].includes(kind) + ) { + nextIssue.kind = kind; + } + + if (severity && ['error', 'warning', 'info'].includes(severity)) { + nextIssue.severity = severity; + } + + if (expected) { + nextIssue.expected = expected; + } + + if (actual) { + nextIssue.actual = actual; + } + + return nextIssue; + }) + .filter(Boolean) + : []; + const notes = Array.isArray(payload.notes) + ? payload.notes.map((note) => sanitizeString(note)).filter(Boolean) + : []; + + return { + status, + confidence, + issues, + notes, + }; +} + +function createCompactReviewSnapshot(componentBefore, componentAfter) { + const argBeforeMap = new Map((componentBefore.args || []).map((arg) => [arg.name, arg])); + const blockBeforeMap = new Map((componentBefore.blocks || []).map((block) => [block.name, block])); + const changedArgs = []; + const changedBlocks = []; + + for (const argAfter of componentAfter.args || []) { + const argBefore = argBeforeMap.get(argAfter.name) || {}; + const hasSummaryChange = (argAfter.summary || null) !== (argBefore.summary || null); + const hasDefaultChange = (argAfter.default || null) !== (argBefore.default || null); + + if (!hasSummaryChange && !hasDefaultChange) { + continue; + } + + const entry = { + name: argAfter.name, + }; + + if (hasSummaryChange) { + entry.summary = argAfter.summary || null; + } + + if (hasDefaultChange) { + entry.default = argAfter.default || null; + } + + changedArgs.push(entry); + } + + for (const blockAfter of componentAfter.blocks || []) { + const blockBefore = blockBeforeMap.get(blockAfter.name) || {}; + const changedBlock = { + name: blockAfter.name, + }; + let hasChanges = false; + + if ((blockAfter.summary || null) !== (blockBefore.summary || null)) { + changedBlock.summary = blockAfter.summary || null; + hasChanges = true; + } + + const yieldBeforeMap = new Map( + (blockBefore.yields || []).map((yieldEntry) => [yieldEntry.name, yieldEntry]) + ); + const changedYields = []; + + for (const yieldAfter of blockAfter.yields || []) { + const yieldBefore = yieldBeforeMap.get(yieldAfter.name) || {}; + + if ((yieldAfter.summary || null) === (yieldBefore.summary || null)) { + continue; + } + + changedYields.push({ + name: yieldAfter.name, + summary: yieldAfter.summary || null, + }); + } + + if (changedYields.length > 0) { + changedBlock.yields = changedYields; + hasChanges = true; + } + + if (hasChanges) { + changedBlocks.push(changedBlock); + } + } + + return { + componentName: componentAfter.name, + summaryBefore: componentBefore.summary || null, + summaryAfter: componentAfter.summary || null, + changedArgs, + changedBlocks, + }; +} + +function extractRelevantDocsSections(docsText, componentAfter) { + if (typeof docsText !== 'string' || docsText.length === 0) { + return ''; + } + + const lines = docsText.split(/\r?\n/u); + const wantedArgNames = new Set((componentAfter.args || []).map((arg) => arg.name)); + const wantedBlockNames = new Set((componentAfter.blocks || []).map((block) => block.name)); + const wantedYieldNames = new Set(); + + for (const block of componentAfter.blocks || []) { + for (const yieldEntry of block.yields || []) { + wantedYieldNames.add(yieldEntry.name); + } + } + + const selected = []; + let section = null; + let sectionHasUsefulContent = false; + + function flushSection() { + if (!section) { + return; + } + + if (section.level <= 3 || sectionHasUsefulContent) { + selected.push(...section.lines); + } + + section = null; + sectionHasUsefulContent = false; + } + + for (const line of lines) { + const headingMatch = line.match(/^(#{1,6})\s+/u); + + if (headingMatch) { + const level = headingMatch[1].length; + + if (section && level <= section.level) { + flushSection(); + } + + if (!section) { + section = { + level, + lines: [line], + }; + continue; + } + } + + if (!section) { + continue; + } + + section.lines.push(line); + + if (line.includes('## Component API')) { + sectionHasUsefulContent = true; + } + + const nameMatch = line.match(/@name="([^"]+)"/u); + + if (nameMatch?.[1]) { + const name = nameMatch[1].trim(); + + if (wantedArgNames.has(name) || wantedBlockNames.has(name) || wantedYieldNames.has(name)) { + sectionHasUsefulContent = true; + } + } + + const contextualHeadingMatch = line.match(/^####\s+\[A\]\.([A-Za-z0-9_]+)\s*$/u); + + if (contextualHeadingMatch?.[1] && wantedYieldNames.has(contextualHeadingMatch[1])) { + sectionHasUsefulContent = true; + } + } + + flushSection(); + + const reduced = selected.join('\n').trim(); + + if (reduced.length <= REVIEW_DOCS_CHAR_LIMIT) { + return reduced; + } + + return `${reduced.slice(0, REVIEW_DOCS_CHAR_LIMIT)}\n\n[truncated for review token budget]`; +} + +function extractContextualYieldSummaries(docsText) { + const summariesByYieldName = new Map(); + + if (typeof docsText !== 'string' || docsText.length === 0) { + return summariesByYieldName; + } + + const headingRegex = /^####\s+\[A\]\.([A-Za-z0-9_]+)\s*$/gmu; + const matches = []; + let match; + + while ((match = headingRegex.exec(docsText)) !== null) { + matches.push({ + yieldName: match[1], + headingIndex: match.index, + headingEndIndex: headingRegex.lastIndex, + }); + } + + for (let index = 0; index < matches.length; index += 1) { + const current = matches[index]; + const next = matches[index + 1]; + const sectionEnd = next ? next.headingIndex : docsText.length; + const sectionText = docsText.slice(current.headingEndIndex, sectionEnd).trim(); + + if (sectionText.length === 0) { + continue; + } + + const lines = sectionText + .split(/\r?\n/u) + .map((line) => line.trim()) + .filter((line) => line.length > 0); + + if (lines.length === 0) { + continue; + } + + const firstNarrativeLine = lines.find( + (line) => !line.startsWith('<') && !line.startsWith('```') + ); + + if (!firstNarrativeLine) { + continue; + } + + const cleanedSummary = firstNarrativeLine + .replace(/`/gu, '') + .replace(/\s+/gu, ' ') + .trim(); + + if (cleanedSummary.length > 0) { + summariesByYieldName.set(current.yieldName, cleanedSummary); + } + } + + return summariesByYieldName; +} + +function backfillContextualYieldSummaries(component, enrichment, docsText) { + const contextualSummaries = extractContextualYieldSummaries(docsText); + + if (contextualSummaries.size === 0 || !Array.isArray(component.blocks)) { + return { + enrichment, + backfilledCount: 0, + }; + } + + const nextEnrichment = enrichment && typeof enrichment === 'object' ? { ...enrichment } : {}; + const blocks = Array.isArray(nextEnrichment.blocks) + ? nextEnrichment.blocks.map((block) => ({ + ...block, + yields: Array.isArray(block.yields) ? [...block.yields] : undefined, + })) + : []; + let backfilledCount = 0; + + for (const [yieldName, summary] of contextualSummaries.entries()) { + let alreadyPresent = false; + + for (const block of blocks) { + for (const yieldEntry of block.yields || []) { + if (yieldEntry.name === yieldName && typeof yieldEntry.summary === 'string') { + alreadyPresent = true; + break; + } + } + + if (alreadyPresent) { + break; + } + } + + if (alreadyPresent) { + continue; + } + + const targetBlock = component.blocks.find((block) => + Array.isArray(block.yields) + ? block.yields.some((yieldEntry) => yieldEntry.name === yieldName) + : false + ); + + if (!targetBlock) { + continue; + } + + let enrichmentBlock = blocks.find((block) => block.name === targetBlock.name); + + if (!enrichmentBlock) { + enrichmentBlock = { name: targetBlock.name, yields: [] }; + blocks.push(enrichmentBlock); + } + + if (!Array.isArray(enrichmentBlock.yields)) { + enrichmentBlock.yields = []; + } + + enrichmentBlock.yields.push({ + name: yieldName, + summary, + }); + backfilledCount += 1; + } + + if (blocks.length > 0) { + nextEnrichment.blocks = blocks; + } + + return { + enrichment: sanitizeEnrichmentPayload(nextEnrichment), + backfilledCount, + }; +} + +async function enrichWithCopilot({ component, docsText, docPath, token, model }) { + + const systemPrompt = [ + 'You extract structured component API docs from markdown.', + 'Return JSON only.', + 'Only reference names that already exist in the provided component object.', + 'Do not invent args, blocks, or yields.', + 'Important: contextual components in docs can appear under headings like "#### [A].Item".', + 'If present, map that narrative description to the root component yield named "Item".', + 'Do not shorten to first sentence only. Capture complete behavior from the property prose.', + 'For each summary, include all materially relevant details present in the docs, including:', + '- defaults and fallback behavior (for example, what happens when an arg is omitted)', + '- conditional behavior and cross-argument dependencies', + '- constraints or unsupported combinations', + '- callback argument details when documented', + 'Prefer 1-3 sentences copied/normalized from docs over paraphrased shorthand.', + 'If prose references a related arg (example: caption and sortedMessageText), include that relationship.', + 'If a field is not documented, omit it.', + 'Output shape:', + '{ "summary"?: string, "args"?: [{"name": string, "summary"?: string, "default"?: string}], "blocks"?: [{"name": string, "summary"?: string, "yields"?: [{"name": string, "summary": string}]}] }', + ].join('\n'); + + const userPrompt = [ + `Component name: ${component.name}`, + `Doc path: ${docPath}`, + 'Extraction quality requirements:', + '- Keep summaries complete, not sentence-truncated.', + '- Include important qualifiers (if/when/unless) and interactions with related properties.', + '- For callback args, include the documented callback parameter details in summary when present.', + '- Prefer faithful wording from docs; do not collapse to generic descriptions.', + 'Current component object (only these names are valid):', + JSON.stringify(component, null, 2), + 'Markdown to interpret:', + docsText, + ].join('\n\n'); + + const result = await callCopilotJson({ + token, + model, + systemPrompt, + userPrompt, + }); + + return { + enrichment: sanitizeEnrichmentPayload(result.parsed), + usage: result.usage, + }; +} + +async function reviewEnrichmentWithCopilot({ + componentBefore, + componentAfter, + docsText, + docPath, + token, + model, +}) { + const compactSnapshot = createCompactReviewSnapshot(componentBefore, componentAfter); + const relevantDocs = extractRelevantDocsSections(docsText, componentAfter); + const systemPrompt = [ + 'You review whether enriched component JSON matches prose in component API docs.', + 'Return JSON only.', + 'Focus on summary/default fields and yielded contextual component descriptions.', + 'Flag mismatches, omissions, or clearly incorrect values.', + 'If docs claim yields that are not present in component signature output, mark them as docs inconsistencies rather than enrichment mismatches.', + 'Use issue kind and severity fields to classify outcomes.', + 'Output shape:', + '{"status":"pass"|"needs_attention","confidence":number,"issues":[{"path":string,"reason":string,"expected"?:string,"actual"?:string,"kind"?:"mismatch"|"docs_inconsistency"|"uncertain","severity"?:"error"|"warning"|"info"}],"notes"?:string[]}', + ].join('\n'); + + const userPrompt = [ + `Doc path: ${docPath}`, + 'Compact changed-fields snapshot to validate:', + JSON.stringify(compactSnapshot, null, 2), + 'Relevant markdown sections to validate against:', + relevantDocs || '[no relevant sections extracted]', + ].join('\n\n'); + + const result = await callCopilotJson({ + token, + model, + systemPrompt, + userPrompt, + }); + + return { + review: sanitizeReviewPayload(result.parsed), + usage: result.usage, + }; +} + +function applyInlineEnrichment(component, enrichment, docPath) { + let updated = false; + + if (enrichment.summary && enrichment.summary !== component.summary) { + component.summary = enrichment.summary; + updated = true; + } + + if (Array.isArray(enrichment.args) && Array.isArray(component.args)) { + const argMap = new Map(component.args.map((arg) => [arg.name, arg])); + + for (const enrichedArg of enrichment.args) { + const existingArg = argMap.get(enrichedArg.name); + + if (!existingArg) { + continue; + } + + if (enrichedArg.summary && enrichedArg.summary !== existingArg.summary) { + existingArg.summary = enrichedArg.summary; + updated = true; + } + + if (enrichedArg.default && enrichedArg.default !== existingArg.default) { + existingArg.default = enrichedArg.default; + updated = true; + } + } + } + + if (Array.isArray(enrichment.blocks) && Array.isArray(component.blocks)) { + const blockMap = new Map(component.blocks.map((block) => [block.name, block])); + + for (const enrichedBlock of enrichment.blocks) { + const existingBlock = blockMap.get(enrichedBlock.name); + + if (!existingBlock) { + continue; + } + + if (enrichedBlock.summary && enrichedBlock.summary !== existingBlock.summary) { + existingBlock.summary = enrichedBlock.summary; + updated = true; + } + + if (!Array.isArray(enrichedBlock.yields) || !Array.isArray(existingBlock.yields)) { + continue; + } + + const yieldMap = new Map(existingBlock.yields.map((yieldEntry) => [yieldEntry.name, yieldEntry])); + + for (const enrichedYield of enrichedBlock.yields) { + const existingYield = yieldMap.get(enrichedYield.name); + + if (!existingYield) { + continue; + } + + if (enrichedYield.summary && enrichedYield.summary !== existingYield.summary) { + existingYield.summary = enrichedYield.summary; + updated = true; + } + } + } + } + + if (updated) { + } + + return updated; +} + +async function main() { + const startedAt = Date.now(); + const options = parseCliOptions(process.argv.slice(2)); + const catalog = readCatalog(); + const targets = catalog.components.filter((component) => + componentMatchesFilters(component, options) + ); + const enrichmentModel = process.env.COPILOT_MODEL || 'openai/gpt-4.1-mini'; + const reviewModel = + process.env.COPILOT_REVIEW_MODEL || 'openai/gpt-4.1'; + const enrichmentPricing = getPricing(enrichmentModel); + const reviewPricing = getPricing(reviewModel); + const copilotAuth = resolveCopilotToken(); + + let enrichedCount = 0; + let skippedCount = 0; + let errorCount = 0; + let totalPromptTokens = 0; + let totalCompletionTokens = 0; + let totalTokens = 0; + let totalCostUsd = 0; + let reviewPassCount = 0; + let reviewNeedsAttentionCount = 0; + + console.log(`Catalog path: ${toRepoRelativePath(CATALOG_PATH)}`); + console.log( + `Targets: ${targets.length} component(s)` + ); + console.log( + `Enrichment model=${enrichmentModel} | pricing=${enrichmentPricing.source} input=${enrichmentPricing.input}/1M output=${enrichmentPricing.output}/1M` + ); + console.log( + `Review model=${reviewModel} | pricing=${reviewPricing.source} input=${reviewPricing.input}/1M output=${reviewPricing.output}/1M` + ); + console.log(`Auth token source: ${copilotAuth.source}`); + + for (const component of targets) { + const componentSpinner = startTaskSpinner( + `${component.name}: searching for component-api docs` + ); + const docsSelection = selectDocsFile(component); + + for (const candidate of docsSelection.candidates) { + if (!candidate.exists) { + console.log(`- candidate: ${toRepoRelativePath(candidate.path)} (missing)`); + continue; + } + + console.log( + `- candidate: ${toRepoRelativePath(candidate.path)} | confidence=${candidate.confidence.toFixed( + 2 + )} | ${candidate.signals.join(', ') || 'no signals'}` + ); + } + + const selectedCandidate = docsSelection.selected; + + if (!selectedCandidate) { + skippedCount += 1; + componentSpinner.stopAndPersist({ + symbol: logSymbols.warning, + text: `${component.name}: no component-api docs found`, + }); + console.warn(`Skipping ${component.name}: no component-api markdown found.`); + continue; + } + + const docPath = selectedCandidate.path; + const docsText = selectedCandidate.docsText; + console.log(`- selected: ${toRepoRelativePath(docPath)}`); + console.log(`- confidence: ${selectedCandidate.confidence.toFixed(2)}`); + + if (!selectedCandidate.hasComponentApiHeading) { + skippedCount += 1; + componentSpinner.stopAndPersist({ + symbol: logSymbols.warning, + text: `${component.name}: candidate missing Component API heading`, + }); + console.warn( + `Skipping ${component.name}: docs file does not look like component-api markdown.` + ); + continue; + } + + const confirmed = await confirmDocPath(docPath, component.name, options.yes); + + if (!confirmed) { + skippedCount += 1; + componentSpinner.stopAndPersist({ + symbol: logSymbols.warning, + text: `${component.name}: docs path not confirmed`, + }); + console.warn(`Skipping ${component.name}: docs path not confirmed.`); + continue; + } + + componentSpinner.text = `${component.name}: enriching from docs`; + + let enrichmentResult = null; + const componentBefore = JSON.parse(JSON.stringify(component)); + + try { + enrichmentResult = await enrichWithCopilot({ + component, + docsText, + docPath, + token: copilotAuth.token, + model: enrichmentModel, + }); + } catch (error) { + errorCount += 1; + skippedCount += 1; + componentSpinner.stopAndPersist({ + symbol: logSymbols.error, + text: `${component.name}: enrichment failed`, + }); + console.warn(`Skipping ${component.name}: ${error.message}`); + continue; + } + + const usage = enrichmentResult.usage; + const cost = estimateCostUsd(usage, enrichmentPricing); + + totalPromptTokens += usage.promptTokens; + totalCompletionTokens += usage.completionTokens; + totalTokens += usage.totalTokens; + totalCostUsd += cost.totalCost; + + console.log( + `- usage: prompt=${usage.promptTokens} completion=${usage.completionTokens} total=${usage.totalTokens}` + ); + console.log( + `- estimated cost: ${formatUsd(cost.totalCost)} (input ${formatUsd( + cost.inputCost + )} + output ${formatUsd(cost.outputCost)})` + ); + + const backfilled = backfillContextualYieldSummaries( + component, + enrichmentResult.enrichment, + docsText + ); + + if (backfilled.backfilledCount > 0) { + console.log( + `- heuristics: backfilled ${backfilled.backfilledCount} contextual yield summary field(s)` + ); + } + + const enrichment = backfilled.enrichment; + + if (!enrichment) { + skippedCount += 1; + componentSpinner.stopAndPersist({ + symbol: logSymbols.warning, + text: `${component.name}: no usable enrichment returned`, + }); + console.warn(`Skipping ${component.name}: no usable enrichment returned.`); + continue; + } + + if (applyInlineEnrichment(component, enrichment, docPath)) { + enrichedCount += 1; + componentSpinner.text = `${component.name}: running review pass`; + + let reviewResult = null; + + try { + reviewResult = await reviewEnrichmentWithCopilot({ + componentBefore, + componentAfter: component, + docsText, + docPath, + token: copilotAuth.token, + model: reviewModel, + }); + } catch (error) { + errorCount += 1; + reviewNeedsAttentionCount += 1; + componentSpinner.stopAndPersist({ + symbol: logSymbols.error, + text: `${component.name}: review failed`, + }); + console.warn(`- review error: ${error.message}`); + continue; + } + + const reviewUsage = reviewResult.usage; + const reviewCost = estimateCostUsd(reviewUsage, reviewPricing); + + totalPromptTokens += reviewUsage.promptTokens; + totalCompletionTokens += reviewUsage.completionTokens; + totalTokens += reviewUsage.totalTokens; + totalCostUsd += reviewCost.totalCost; + + const review = reviewResult.review; + + if (!review) { + reviewNeedsAttentionCount += 1; + console.warn( + `${logSymbols.warning} ${chalk.yellow( + 'review: needs_attention (no structured review payload)' + )}` + ); + continue; + } + + const classifiedIssues = classifyReviewIssues(component, review); + + if (classifiedIssues.mismatches.length === 0) { + reviewPassCount += 1; + } else { + reviewNeedsAttentionCount += 1; + } + + if (classifiedIssues.mismatches.length === 0) { + componentSpinner.stopAndPersist({ + symbol: logSymbols.success, + text: `${component.name}: enrichment + review passed (blocking mismatches: 0)`, + }); + } else { + componentSpinner.stopAndPersist({ + symbol: logSymbols.warning, + text: `${component.name}: enrichment complete, review needs attention (${classifiedIssues.mismatches.length} blocking mismatch(es))`, + }); + } + + printReviewReport( + component.name, + review, + classifiedIssues, + reviewUsage, + reviewCost + ); + } else { + skippedCount += 1; + componentSpinner.stopAndPersist({ + symbol: logSymbols.warning, + text: `${component.name}: no matching fields to update`, + }); + console.warn(`Skipping ${component.name}: no matching fields to update.`); + } + } + + catalog.updatedAt = new Date().toISOString(); + writeFileSync(CATALOG_PATH, `${JSON.stringify(catalog, null, 2)}\n`); + + const elapsedMs = Date.now() - startedAt; + + printPanel( + 'Run Summary', + [ + `${logSymbols.success} ${chalk.bold('Done.')} Enriched ${enrichedCount} component(s), skipped ${skippedCount} component(s), errors ${errorCount}.`, + `Review outcomes: ${chalk.green(`pass=${reviewPassCount}`)} ${chalk.yellow( + `needs_attention=${reviewNeedsAttentionCount}` + )}`, + ], + 'cyan' + ); + printTable( + ['Metric', 'Value'], + [ + ['Review pass', `${reviewPassCount}`], + ['Review needs attention', `${reviewNeedsAttentionCount}`], + ['Prompt tokens', `${totalPromptTokens}`], + ['Completion tokens', `${totalCompletionTokens}`], + ['Total tokens', `${totalTokens}`], + ['Estimated cost', `${formatUsd(totalCostUsd)} USD`], + ['Elapsed', `${(elapsedMs / 1000).toFixed(2)}s`], + ] + ); +} + +main().catch((error) => { + console.error(error instanceof Error ? error.message : `${error}`); + process.exit(1); +}); diff --git a/packages/components/scripts/generate-component-catalog.mjs b/packages/components/scripts/generate-component-catalog.mjs new file mode 100644 index 00000000000..600d201e43c --- /dev/null +++ b/packages/components/scripts/generate-component-catalog.mjs @@ -0,0 +1,1328 @@ +/** Copyright IBM Corp. 2021, 2026 SPDX-License-Identifier: MPL-2.0 */ + +import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'; +import { dirname, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { Node, Project, SyntaxKind, TypeFormatFlags } from 'ts-morph'; + +const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url)); +const COMPONENTS_ROOT = resolve(SCRIPT_DIR, '..'); +const ENTRY_FILE_PATH = resolve(COMPONENTS_ROOT, 'src/components.ts'); +const TSCONFIG_PATH = resolve(COMPONENTS_ROOT, 'tsconfig.json'); +const OUTPUT_FILE_PATH = resolve( + COMPONENTS_ROOT, + '../mcp/src/catalogs/components/catalog.json' +); +const SUMMARY_PLACEHOLDER = 'TODO'; + +const TYPE_FORMAT_FLAGS = + TypeFormatFlags.NoTruncation | + TypeFormatFlags.UseSingleQuotesForStringLiteralType; + +function isOptionalDeclaration(declaration) { + if ( + Node.isPropertySignature(declaration) || + Node.isPropertyDeclaration(declaration) || + Node.isParameterDeclaration(declaration) + ) { + return declaration.hasQuestionToken(); + } + + return false; +} + +function normalizeTypeText(typeText) { + return typeText.replace(/\s+/g, ' ').trim(); +} + +function normalizeGroupSlug(groupName) { + return `${groupName || ''}`.toLowerCase().replace(/[^a-z0-9]/g, ''); +} + +function parseCliOptions(argv) { + let group = null; + let component = null; + + for (let index = 0; index < argv.length; index += 1) { + const arg = argv[index]; + + if (arg.startsWith('--group=')) { + group = arg.slice('--group='.length).trim(); + continue; + } + + if (arg === '--group') { + group = `${argv[index + 1] || ''}`.trim(); + index += 1; + continue; + } + + if (arg.startsWith('--component=')) { + component = arg.slice('--component='.length).trim(); + continue; + } + + if (arg === '--component') { + component = `${argv[index + 1] || ''}`.trim(); + index += 1; + continue; + } + + throw new Error(`Unknown argument: ${arg}`); + } + + if (group === '') { + throw new Error('The --group option requires a non-empty value.'); + } + + if (component === '') { + throw new Error('The --component option requires a non-empty value.'); + } + + return { + group, + component, + }; +} + +function getStringLiteralValuesFromEnumDeclaration(enumDeclaration) { + const values = []; + + for (const member of enumDeclaration.getMembers()) { + const initializer = member.getInitializer(); + + if (!initializer || !Node.isStringLiteral(initializer)) { + return undefined; + } + + values.push(initializer.getLiteralText()); + } + + return values.length > 0 ? values : undefined; +} + +function getStringLiteralValuesFromTypeNode( + typeNode, + sourceFile, + resolveRelativeSourceFile, + seen = new Set() +) { + if (!typeNode) { + return undefined; + } + + const visitKey = createNodeVisitKey(sourceFile, typeNode); + + if (seen.has(visitKey)) { + return undefined; + } + + seen.add(visitKey); + + if (Node.isParenthesizedTypeNode(typeNode)) { + return getStringLiteralValuesFromTypeNode( + typeNode.getTypeNode(), + sourceFile, + resolveRelativeSourceFile, + seen + ); + } + + if (Node.isUnionTypeNode(typeNode)) { + const values = []; + + for (const unionTypeNode of typeNode.getTypeNodes()) { + if (!Node.isLiteralTypeNode(unionTypeNode)) { + return undefined; + } + + const literalNode = unionTypeNode.getLiteral(); + + if (!Node.isStringLiteral(literalNode)) { + return undefined; + } + + values.push(literalNode.getLiteralText()); + } + + return values.length > 1 ? values : undefined; + } + + if (Node.isTypeReference(typeNode)) { + const typeName = typeNode.getTypeName().getText(); + + if (typeName.includes('.')) { + return undefined; + } + + const declaration = resolveNamedTypeDeclaration( + sourceFile, + typeName, + resolveRelativeSourceFile + ); + + if (!declaration) { + return undefined; + } + + if (Node.isTypeAliasDeclaration(declaration)) { + return getStringLiteralValuesFromTypeNode( + declaration.getTypeNode(), + declaration.getSourceFile(), + resolveRelativeSourceFile, + seen + ); + } + + if (Node.isEnumDeclaration(declaration)) { + return getStringLiteralValuesFromEnumDeclaration(declaration); + } + + return undefined; + } + + if (Node.isTemplateLiteralTypeNode(typeNode)) { + const fullText = typeNode.getText(); + const match = fullText.match(/^`\$\{([^}]+)\}`$/); + + if (!match) { + return undefined; + } + + const referenceName = match[1].trim(); + + if (referenceName.includes('.') || referenceName.includes('<')) { + return undefined; + } + + const declaration = resolveNamedTypeDeclaration( + sourceFile, + referenceName, + resolveRelativeSourceFile + ); + + if (!declaration) { + return undefined; + } + + if (Node.isEnumDeclaration(declaration)) { + return getStringLiteralValuesFromEnumDeclaration(declaration); + } + + if (Node.isTypeAliasDeclaration(declaration)) { + return getStringLiteralValuesFromTypeNode( + declaration.getTypeNode(), + declaration.getSourceFile(), + resolveRelativeSourceFile, + seen + ); + } + + return undefined; + } + + return undefined; +} + +function expandTypeText(typeNode, sourceFile, resolveRelativeSourceFile) { + const values = getStringLiteralValuesFromTypeNode( + typeNode, + sourceFile, + resolveRelativeSourceFile + ); + + if (!values) { + return null; + } + + return values.map((value) => `'${value}'`).join(' | '); +} + +function findImportForLocalName(sourceFile, localName) { + for (const importDecl of sourceFile.getImportDeclarations()) { + const moduleSpecifier = importDecl.getModuleSpecifierValue(); + const defaultImport = importDecl.getDefaultImport(); + + if (defaultImport && defaultImport.getText() === localName) { + return { + moduleSpecifier, + importedName: 'default', + isDefault: true, + }; + } + + for (const namedImport of importDecl.getNamedImports()) { + const candidateLocalName = + namedImport.getAliasNode()?.getText() || namedImport.getName(); + + if (candidateLocalName !== localName) { + continue; + } + + return { + moduleSpecifier, + importedName: namedImport.getName(), + isDefault: false, + }; + } + } + + return null; +} + +function getContextualComponentTypeQuery(typeNode) { + if (!typeNode) { + return null; + } + + if (Node.isTypeQuery(typeNode)) { + return typeNode; + } + + if ( + Node.isTypeReference(typeNode) && + typeNode.getTypeName().getText() === 'WithBoundArgs' + ) { + const firstTypeArg = typeNode.getTypeArguments()[0]; + + if (firstTypeArg && Node.isTypeQuery(firstTypeArg)) { + return firstTypeArg; + } + } + + return null; +} + +function parseBoundArgNamesFromTypeNode(typeNode) { + if (!typeNode || !Node.isTypeReference(typeNode)) { + return undefined; + } + + if (typeNode.getTypeName().getText() !== 'WithBoundArgs') { + return undefined; + } + + const secondTypeArg = typeNode.getTypeArguments()[1]; + + if (!secondTypeArg || secondTypeArg.getText() === 'never') { + return undefined; + } + + if (Node.isLiteralTypeNode(secondTypeArg)) { + const literalNode = secondTypeArg.getLiteral(); + + if (!Node.isStringLiteral(literalNode)) { + return undefined; + } + + return [literalNode.getLiteralText()]; + } + + if (!Node.isUnionTypeNode(secondTypeArg)) { + return undefined; + } + + const boundArgs = []; + + for (const unionTypeNode of secondTypeArg.getTypeNodes()) { + if (!Node.isLiteralTypeNode(unionTypeNode)) { + return undefined; + } + + const literalNode = unionTypeNode.getLiteral(); + + if (!Node.isStringLiteral(literalNode)) { + return undefined; + } + + boundArgs.push(literalNode.getLiteralText()); + } + + return boundArgs.length > 0 ? boundArgs : undefined; +} + +function createSourceFileResolver(project) { + function resolveRelativeSourceFile(fromSourceFile, moduleSpecifier) { + const resolvedByTs = fromSourceFile + .getImportDeclarations() + .find( + (importDecl) => importDecl.getModuleSpecifierValue() === moduleSpecifier + ) + ?.getModuleSpecifierSourceFile(); + + if (resolvedByTs) { + return resolvedByTs; + } + + if (!moduleSpecifier.startsWith('.')) { + return null; + } + + const fromDir = dirname(fromSourceFile.getFilePath()); + const basePath = resolve(fromDir, moduleSpecifier); + const candidates = [ + basePath, + `${basePath}.ts`, + `${basePath}.gts`, + `${basePath}.d.ts`, + resolve(basePath, 'index.ts'), + resolve(basePath, 'index.gts'), + resolve(basePath, 'index.d.ts'), + ]; + + for (const candidatePath of candidates) { + const sourceFile = project.addSourceFileAtPathIfExists(candidatePath); + + if (sourceFile) { + return sourceFile; + } + } + + return null; + } + + return { + resolveRelativeSourceFile, + }; +} + +function findLocalTypeDeclaration(sourceFile, typeName) { + return ( + sourceFile.getInterface(typeName) || + sourceFile.getTypeAlias(typeName) || + sourceFile.getEnum(typeName) + ); +} + +function resolveNamedTypeDeclaration( + sourceFile, + localTypeName, + resolveRelativeSourceFile +) { + const localDeclaration = findLocalTypeDeclaration(sourceFile, localTypeName); + + if (localDeclaration) { + return localDeclaration; + } + + const importMatch = findImportForLocalName(sourceFile, localTypeName); + + if (!importMatch) { + return null; + } + + const importedSourceFile = resolveRelativeSourceFile( + sourceFile, + importMatch.moduleSpecifier + ); + + if (!importedSourceFile) { + return null; + } + + if (importMatch.isDefault) { + const defaultSymbol = importedSourceFile.getDefaultExportSymbol(); + + return defaultSymbol?.getDeclarations()?.[0] ?? null; + } + + return ( + findLocalTypeDeclaration(importedSourceFile, importMatch.importedName) ?? + null + ); +} + +function resolveSignatureFromClass(sourceFile, resolveRelativeSourceFile) { + const defaultClass = sourceFile + .getClasses() + .find((classDeclaration) => classDeclaration.isDefaultExport()); + + if (!defaultClass) { + return null; + } + + const extendsClause = defaultClass.getHeritageClauseByKind( + SyntaxKind.ExtendsKeyword + ); + const extendsTypes = extendsClause?.getTypeNodes() ?? []; + const firstExtendsType = extendsTypes[0]; + + if ( + !firstExtendsType || + !Node.isExpressionWithTypeArguments(firstExtendsType) + ) { + return null; + } + + const typeArguments = firstExtendsType.getTypeArguments(); + const signatureTypeArgument = typeArguments[0]; + + if (!signatureTypeArgument || !Node.isTypeReference(signatureTypeArgument)) { + return null; + } + + const signatureTypeName = signatureTypeArgument.getTypeName().getText(); + + if (signatureTypeName.includes('.')) { + return null; + } + + const declaration = resolveNamedTypeDeclaration( + sourceFile, + signatureTypeName, + resolveRelativeSourceFile + ); + + if (!declaration) { + return null; + } + + if (Node.isInterfaceDeclaration(declaration)) { + return declaration; + } + + if (Node.isTypeAliasDeclaration(declaration)) { + const typeNode = declaration.getTypeNode(); + + if (!typeNode || !Node.isTypeReference(typeNode)) { + return null; + } + + const aliasName = typeNode.getTypeName().getText(); + + if (aliasName.includes('.')) { + return null; + } + + const aliasDeclaration = resolveNamedTypeDeclaration( + declaration.getSourceFile(), + aliasName, + resolveRelativeSourceFile + ); + + if (aliasDeclaration && Node.isInterfaceDeclaration(aliasDeclaration)) { + return aliasDeclaration; + } + } + + return null; +} + +function resolveSignatureInterface( + sourceFile, + exportedComponentName, + resolveRelativeSourceFile +) { + const exactSignature = sourceFile.getInterface( + `${exportedComponentName}Signature` + ); + + if (exactSignature) { + return exactSignature; + } + + const classDerivedSignature = resolveSignatureFromClass( + sourceFile, + resolveRelativeSourceFile + ); + + if (classDerivedSignature) { + return classDerivedSignature; + } + + const allSignatures = sourceFile + .getInterfaces() + .filter((interfaceDeclaration) => + interfaceDeclaration.getName().endsWith('Signature') + ); + + if (allSignatures.length === 1) { + return allSignatures[0]; + } + + return null; +} + +function createNodeVisitKey(sourceFile, node) { + return `${sourceFile.getFilePath()}:${node.getPos()}:${node.getKindName()}`; +} + +function resolvePropertyTypeNodeByName( + containerNode, + containerSourceFile, + propertyName, + resolveRelativeSourceFile, + seen = new Set() +) { + const visitKey = createNodeVisitKey(containerSourceFile, containerNode); + + if (seen.has(visitKey)) { + return null; + } + + seen.add(visitKey); + + const resolveFrom = (nextNode, nextSourceFile = containerSourceFile) => + resolvePropertyTypeNodeByName( + nextNode, + nextSourceFile, + propertyName, + resolveRelativeSourceFile, + seen + ); + + if (Node.isParenthesizedTypeNode(containerNode)) { + return resolveFrom(containerNode.getTypeNode(), containerSourceFile); + } + + if (Node.isTypeLiteral(containerNode)) { + const property = containerNode.getProperty(propertyName); + + if (!property) { + return null; + } + + const typeNode = property.getTypeNode(); + + return typeNode ? { typeNode, sourceFile: containerSourceFile } : null; + } + + if (Node.isInterfaceDeclaration(containerNode)) { + const property = containerNode.getProperty(propertyName); + + if (property) { + const typeNode = property.getTypeNode(); + + if (typeNode) { + return { typeNode, sourceFile: containerNode.getSourceFile() }; + } + } + + for (const extendsNode of containerNode.getExtends()) { + const resolved = resolveFrom(extendsNode, containerNode.getSourceFile()); + + if (resolved) { + return resolved; + } + } + + return null; + } + + if (Node.isTypeReference(containerNode)) { + const typeName = containerNode.getTypeName().getText(); + + if (typeName.includes('.')) { + return null; + } + + const declaration = resolveNamedTypeDeclaration( + containerSourceFile, + typeName, + resolveRelativeSourceFile + ); + + if (!declaration) { + return null; + } + + if (Node.isInterfaceDeclaration(declaration)) { + return resolveFrom(declaration, declaration.getSourceFile()); + } + + if (Node.isTypeAliasDeclaration(declaration)) { + return resolveFrom(declaration.getTypeNode(), declaration.getSourceFile()); + } + + return null; + } + + if (Node.isIntersectionTypeNode(containerNode)) { + for (const nextTypeNode of containerNode.getTypeNodes()) { + const resolved = resolveFrom(nextTypeNode, containerSourceFile); + + if (resolved) { + return resolved; + } + } + + return null; + } + + if (Node.isIndexedAccessTypeNode(containerNode)) { + const indexTypeNode = containerNode.getIndexTypeNode(); + + if (!Node.isLiteralTypeNode(indexTypeNode)) { + return null; + } + + const literalNode = indexTypeNode.getLiteral(); + + if (!Node.isStringLiteral(literalNode)) { + return null; + } + + const intermediate = resolvePropertyTypeNodeByName( + containerNode.getObjectTypeNode(), + containerSourceFile, + literalNode.getLiteralText(), + resolveRelativeSourceFile, + seen + ); + + if (!intermediate) { + return null; + } + + return resolvePropertyTypeNodeByName( + intermediate.typeNode, + intermediate.sourceFile, + propertyName, + resolveRelativeSourceFile, + seen + ); + } + + return null; +} + +function collectPropertySignaturesFromTypeNode( + typeNode, + sourceFile, + resolveRelativeSourceFile, + seen = new Set() +) { + if (!typeNode) { + return []; + } + + const visitKey = createNodeVisitKey(sourceFile, typeNode); + + if (seen.has(visitKey)) { + return []; + } + + seen.add(visitKey); + + const collect = (nextTypeNode, nextSourceFile = sourceFile) => + collectPropertySignaturesFromTypeNode( + nextTypeNode, + nextSourceFile, + resolveRelativeSourceFile, + seen + ); + + if (Node.isParenthesizedTypeNode(typeNode)) { + return collect(typeNode.getTypeNode(), sourceFile); + } + + if (Node.isTypeLiteral(typeNode)) { + return typeNode + .getMembers() + .filter((member) => Node.isPropertySignature(member)); + } + + if (Node.isIntersectionTypeNode(typeNode)) { + return typeNode + .getTypeNodes() + .flatMap((nextTypeNode) => collect(nextTypeNode, sourceFile)); + } + + if (Node.isTypeReference(typeNode)) { + const typeName = typeNode.getTypeName().getText(); + + if (typeName.includes('.')) { + return []; + } + + const declaration = resolveNamedTypeDeclaration( + sourceFile, + typeName, + resolveRelativeSourceFile + ); + + if (!declaration) { + return []; + } + + if (Node.isInterfaceDeclaration(declaration)) { + const ownProperties = declaration.getProperties(); + const inheritedProperties = declaration + .getExtends() + .flatMap((extendsNode) => collect(extendsNode, declaration.getSourceFile())); + + return [...ownProperties, ...inheritedProperties]; + } + + if (Node.isTypeAliasDeclaration(declaration)) { + return collect(declaration.getTypeNode(), declaration.getSourceFile()); + } + + return []; + } + + if (Node.isIndexedAccessTypeNode(typeNode)) { + const indexTypeNode = typeNode.getIndexTypeNode(); + + if (!Node.isLiteralTypeNode(indexTypeNode)) { + return []; + } + + const literalNode = indexTypeNode.getLiteral(); + + if (!Node.isStringLiteral(literalNode)) { + return []; + } + + const resolvedProperty = resolvePropertyTypeNodeByName( + typeNode.getObjectTypeNode(), + sourceFile, + literalNode.getLiteralText(), + resolveRelativeSourceFile + ); + + if (!resolvedProperty) { + return []; + } + + return collect(resolvedProperty.typeNode, resolvedProperty.sourceFile); + } + + return []; +} + +function parseArgs(signatureInterface, resolveRelativeSourceFile) { + const argsProperty = signatureInterface.getProperty('Args'); + + if (!argsProperty) { + return []; + } + + const argsTypeNode = argsProperty.getTypeNode?.(); + const astPropertySignatures = collectPropertySignaturesFromTypeNode( + argsTypeNode, + signatureInterface.getSourceFile(), + resolveRelativeSourceFile + ); + + const dedupedPropertyMap = new Map(); + + astPropertySignatures.forEach((propertySignature) => { + dedupedPropertyMap.set(propertySignature.getName(), propertySignature); + }); + + const dedupedPropertySignatures = [...dedupedPropertyMap.values()]; + + if (dedupedPropertySignatures.length > 0) { + const args = []; + + for (const propertySignature of dedupedPropertySignatures) { + const typeNode = propertySignature.getTypeNode(); + const expandedTypeText = typeNode + ? expandTypeText( + typeNode, + propertySignature.getSourceFile(), + resolveRelativeSourceFile + ) + : null; + + const parsedArg = { + name: propertySignature.getName(), + type: normalizeTypeText( + expandedTypeText || + (typeNode + ? typeNode.getText() + : propertySignature + .getType() + .getText(propertySignature, TYPE_FORMAT_FLAGS)) + ), + required: !isOptionalDeclaration(propertySignature), + }; + + args.push(parsedArg); + } + + args.sort((a, b) => a.name.localeCompare(b.name)); + + return args; + } + + const argsType = argsProperty.getType().getApparentType(); + const args = []; + + for (const propertySymbol of argsType.getProperties()) { + const declaration = + propertySymbol.getValueDeclaration() || + propertySymbol.getDeclarations()[0]; + + if (!declaration) { + continue; + } + + const type = propertySymbol.getTypeAtLocation(declaration); + const parsedArg = { + name: propertySymbol.getName(), + type: normalizeTypeText(type.getText(declaration, TYPE_FORMAT_FLAGS)), + required: !isOptionalDeclaration(declaration), + }; + + args.push(parsedArg); + } + + args.sort((a, b) => a.name.localeCompare(b.name)); + + return args; +} + +function resolveTupleFirstElementTypeNode( + typeNode, + sourceFile, + resolveRelativeSourceFile, + seen = new Set() +) { + if (!typeNode) { + return null; + } + + const visitKey = createNodeVisitKey(sourceFile, typeNode); + + if (seen.has(visitKey)) { + return null; + } + + seen.add(visitKey); + + if (Node.isParenthesizedTypeNode(typeNode)) { + return resolveTupleFirstElementTypeNode( + typeNode.getTypeNode(), + sourceFile, + resolveRelativeSourceFile, + seen + ); + } + + if (Node.isTupleTypeNode(typeNode)) { + const tupleElements = typeNode.getElements(); + + return tupleElements[0] ?? null; + } + + if (Node.isTypeReference(typeNode)) { + const typeName = typeNode.getTypeName().getText(); + + if (typeName.includes('.')) { + return null; + } + + const declaration = resolveNamedTypeDeclaration( + sourceFile, + typeName, + resolveRelativeSourceFile + ); + + if (!declaration || !Node.isTypeAliasDeclaration(declaration)) { + return null; + } + + return resolveTupleFirstElementTypeNode( + declaration.getTypeNode(), + declaration.getSourceFile(), + resolveRelativeSourceFile, + seen + ); + } + + return null; +} + +function parseBlockYieldsFromPropertySignature( + blockPropertySignature, + resolveRelativeSourceFile +) { + const tupleFirstElementTypeNode = resolveTupleFirstElementTypeNode( + blockPropertySignature.getTypeNode(), + blockPropertySignature.getSourceFile(), + resolveRelativeSourceFile + ); + + if (!tupleFirstElementTypeNode) { + return []; + } + + const yieldPropertySignatures = collectPropertySignaturesFromTypeNode( + tupleFirstElementTypeNode, + blockPropertySignature.getSourceFile(), + resolveRelativeSourceFile + ); + + if (yieldPropertySignatures.length === 0) { + return []; + } + + const dedupedYieldMap = new Map(); + + yieldPropertySignatures.forEach((yieldPropertySignature) => { + dedupedYieldMap.set(yieldPropertySignature.getName(), yieldPropertySignature); + }); + + const yields = [...dedupedYieldMap.values()].map((yieldPropertySignature) => { + const typeNode = yieldPropertySignature.getTypeNode(); + const expandedTypeText = typeNode + ? expandTypeText( + typeNode, + yieldPropertySignature.getSourceFile(), + resolveRelativeSourceFile + ) + : null; + const contextualTypeQuery = typeNode + ? getContextualComponentTypeQuery(typeNode) + : null; + + const parsedYield = { + name: yieldPropertySignature.getName(), + type: normalizeTypeText( + expandedTypeText || + (typeNode + ? typeNode.getText() + : yieldPropertySignature + .getType() + .getText(yieldPropertySignature, TYPE_FORMAT_FLAGS)) + ), + }; + + if (contextualTypeQuery) { + const componentName = contextualTypeQuery.getExprName().getText(); + const importMatch = findImportForLocalName( + yieldPropertySignature.getSourceFile(), + componentName + ); + const boundArgs = typeNode + ? parseBoundArgNamesFromTypeNode(typeNode) + : undefined; + + parsedYield.kind = 'component'; + parsedYield.componentName = componentName; + + if (importMatch?.moduleSpecifier) { + parsedYield.sourcePath = importMatch.moduleSpecifier; + } + + if (boundArgs && boundArgs.length > 0) { + parsedYield.boundArgs = boundArgs; + } + } else if (parsedYield.type.includes('=>')) { + parsedYield.kind = 'function'; + } else { + parsedYield.kind = 'value'; + } + + return parsedYield; + }); + + yields.sort((a, b) => a.name.localeCompare(b.name)); + + return yields; +} + +function parseBlocks(signatureInterface, resolveRelativeSourceFile) { + const blocksProperty = signatureInterface.getProperty('Blocks'); + + if (!blocksProperty) { + return []; + } + + const blocksTypeNode = blocksProperty.getTypeNode?.(); + const astPropertySignatures = collectPropertySignaturesFromTypeNode( + blocksTypeNode, + signatureInterface.getSourceFile(), + resolveRelativeSourceFile + ); + + if (astPropertySignatures.length > 0) { + const blocks = astPropertySignatures.map((propertySignature) => { + const yields = parseBlockYieldsFromPropertySignature( + propertySignature, + resolveRelativeSourceFile + ); + + if (yields.length > 0) { + return { + name: propertySignature.getName(), + yields, + }; + } + + return { + name: propertySignature.getName(), + }; + }); + + blocks.sort((a, b) => a.name.localeCompare(b.name)); + + return blocks; + } + + const blocksType = blocksProperty.getType().getApparentType(); + const blocks = []; + + for (const propertySymbol of blocksType.getProperties()) { + const declaration = + propertySymbol.getValueDeclaration() || propertySymbol.getDeclarations()[0]; + + if (declaration && Node.isPropertySignature(declaration)) { + const yields = parseBlockYieldsFromPropertySignature( + declaration, + resolveRelativeSourceFile + ); + + if (yields.length > 0) { + blocks.push({ + name: propertySymbol.getName(), + yields, + }); + + continue; + } + } + + blocks.push({ name: propertySymbol.getName() }); + } + + blocks.sort((a, b) => a.name.localeCompare(b.name)); + + return blocks; +} + +function isComponentGroupComment(commentText) { + const text = commentText.trim(); + + if (text.length === 0) { + return false; + } + + if (text.startsWith('###')) { + return false; + } + + if (text.includes('---')) { + return false; + } + + return true; +} + +function collectBarrelExports(entryFile, { group = null, component = null } = {}) { + const normalizedGroupFilter = group ? normalizeGroupSlug(group) : null; + const normalizedComponentFilter = component ? `${component}`.trim() : null; + const commentRegex = /^\s*\/\/\s*(.+?)\s*$/; + const exportRegex = + /^\s*export\s+\{\s*default\s+as\s+([A-Za-z0-9_]+)\s*\}\s+from\s+['"]([^'"]+)['"];\s*$/; + + const exportedComponents = []; + let currentGroup = null; + + for (const line of entryFile.getFullText().split(/\r?\n/u)) { + const commentMatch = line.match(commentRegex); + + if (commentMatch) { + const candidateGroup = commentMatch[1].trim(); + + if (isComponentGroupComment(candidateGroup)) { + currentGroup = candidateGroup; + } + + continue; + } + + const exportMatch = line.match(exportRegex); + + if (!exportMatch) { + continue; + } + + const exportedName = exportMatch[1]; + const moduleSpecifier = exportMatch[2]; + + if (!exportedName.startsWith('Hds') || !moduleSpecifier.endsWith('.gts')) { + continue; + } + + if (normalizedComponentFilter && exportedName !== normalizedComponentFilter) { + continue; + } + + if ( + normalizedGroupFilter && + normalizeGroupSlug(currentGroup) !== normalizedGroupFilter + ) { + continue; + } + + exportedComponents.push({ + name: exportedName, + moduleSpecifier, + group: currentGroup, + }); + } + + return exportedComponents; +} + +function readExistingCatalog(filePath) { + if (!existsSync(filePath)) { + return null; + } + + try { + const parsed = JSON.parse(readFileSync(filePath, 'utf8')); + + if (!parsed || !Array.isArray(parsed.components)) { + return null; + } + + return parsed; + } catch { + return null; + } +} + +function mergeComponents(existingComponents, nextComponents) { + const merged = []; + const nextByName = new Map(nextComponents.map((component) => [component.name, component])); + const seen = new Set(); + + for (const existingComponent of existingComponents) { + if (!existingComponent || typeof existingComponent.name !== 'string') { + continue; + } + + if (seen.has(existingComponent.name)) { + continue; + } + + if (nextByName.has(existingComponent.name)) { + merged.push(nextByName.get(existingComponent.name)); + seen.add(existingComponent.name); + continue; + } + + merged.push(existingComponent); + seen.add(existingComponent.name); + } + + for (const nextComponent of nextComponents) { + if (seen.has(nextComponent.name)) { + continue; + } + + merged.push(nextComponent); + seen.add(nextComponent.name); + } + + merged.sort((a, b) => a.name.localeCompare(b.name)); + + return merged; +} + +function main() { + const options = parseCliOptions(process.argv.slice(2)); + const project = new Project({ tsConfigFilePath: TSCONFIG_PATH }); + const entryFile = project.addSourceFileAtPath(ENTRY_FILE_PATH); + const { resolveRelativeSourceFile } = createSourceFileResolver(project); + + const components = []; + const unresolvedComponents = []; + const exportedComponents = collectBarrelExports(entryFile, options); + + for (const exportedComponent of exportedComponents) { + const componentSourceFile = resolveRelativeSourceFile( + entryFile, + exportedComponent.moduleSpecifier + ); + + if (!componentSourceFile) { + unresolvedComponents.push({ + name: exportedComponent.name, + reason: `missing source file for ${exportedComponent.moduleSpecifier}`, + }); + + continue; + } + + const signatureInterface = resolveSignatureInterface( + componentSourceFile, + exportedComponent.name, + resolveRelativeSourceFile + ); + + if (!signatureInterface) { + unresolvedComponents.push({ + name: exportedComponent.name, + reason: 'missing signature interface', + }); + + continue; + } + + const args = parseArgs(signatureInterface, resolveRelativeSourceFile); + const blocks = parseBlocks(signatureInterface, resolveRelativeSourceFile); + + const component = { + name: exportedComponent.name, + sourcePath: exportedComponent.moduleSpecifier, + summary: SUMMARY_PLACEHOLDER, + }; + + if (args.length > 0) { + component.args = args; + } + + if (blocks.length > 0) { + component.blocks = blocks; + } + + components.push(component); + } + + components.sort((a, b) => a.name.localeCompare(b.name)); + + let finalComponents = components; + + if (options.group || options.component) { + const existingCatalog = readExistingCatalog(OUTPUT_FILE_PATH); + + if (existingCatalog) { + finalComponents = mergeComponents(existingCatalog.components, components); + } + } + + const payload = { + updatedAt: new Date().toISOString(), + components: finalComponents, + }; + + mkdirSync(dirname(OUTPUT_FILE_PATH), { recursive: true }); + writeFileSync(`${OUTPUT_FILE_PATH}`, `${JSON.stringify(payload, null, 2)}\n`); + + if (options.group) { + console.log(`Applied group filter: ${options.group}`); + } + + if (options.component) { + console.log(`Applied component filter: ${options.component}`); + } + + console.log( + `Generated ${components.length} components -> ${OUTPUT_FILE_PATH}` + ); + + if (unresolvedComponents.length > 0) { + console.warn(`Skipped ${unresolvedComponents.length} components:`); + + unresolvedComponents.forEach((entry) => { + console.warn(`- ${entry.name}: ${entry.reason}`); + }); + } +} + +main(); diff --git a/packages/components/scripts/parse-docs.mjs b/packages/components/scripts/parse-docs.mjs new file mode 100644 index 00000000000..c41b02ec908 --- /dev/null +++ b/packages/components/scripts/parse-docs.mjs @@ -0,0 +1,77 @@ +/** Copyright IBM Corp. 2021, 2026 SPDX-License-Identifier: MPL-2.0 */ + +/** + * Parse component docs metadata from signature types. + * + * Input: src/components.ts central public exports. Output: + * dist/manifest/components.json consumed by docs tooling. Invoked during `pnpm + * build` in this package. + */ + +import { Project } from 'ts-morph'; +import { existsSync, mkdirSync } from 'node:fs'; +import { dirname } from 'node:path'; + +import { + ENTRY_FILE_PATH, + OUTPUT_FILE_PATH, + TSCONFIG_PATH, + TYPE_TRACE_LIMITS, +} from './parse-docs/config.mjs'; +import { createStats, printStatsSummary } from './parse-docs/stats.mjs'; +import { createSourceFileResolver } from './parse-docs/source-files.mjs'; +import { createTypeResolver } from './parse-docs/type-resolver.mjs'; +import { extractDocData } from './parse-docs/doc-text.mjs'; +import { parseComponentsFromEntry } from './parse-docs/component-parser.mjs'; +import { + printMissingTypesSample, + printSuccess, + sortDocPayloads, + writeManifest, +} from './parse-docs/output.mjs'; + +if (!existsSync(ENTRY_FILE_PATH)) { + console.error(`❌ Central entry file not found at: ${ENTRY_FILE_PATH}`); + + process.exit(1); +} + +const outputDir = dirname(OUTPUT_FILE_PATH); + +if (!existsSync(outputDir)) { + mkdirSync(outputDir, { recursive: true }); +} + +const project = new Project({ tsConfigFilePath: TSCONFIG_PATH }); +const entryFile = project.addSourceFileAtPath(ENTRY_FILE_PATH); +const stats = createStats(); +const missingTypesModules = []; + +const sourceFileResolver = createSourceFileResolver({ project, entryFile }); +const typeResolver = createTypeResolver({ + limits: TYPE_TRACE_LIMITS, + stats, + resolveImportSourceFile: sourceFileResolver.resolveImportSourceFile, +}); + +// walk only from the central components entrypoint so output order and coverage stay deterministic +console.log(`🔍 Crawling entry point via AST: ${ENTRY_FILE_PATH}\n`); + +const allDocPayloads = parseComponentsFromEntry({ + entryFile, + sourceFileResolver, + typeResolver, + extractDocData, + stats, + onMissingTypesModule: (moduleSpecifier) => { + missingTypesModules.push(moduleSpecifier); + }, +}); + +const sortedDocPayloads = sortDocPayloads(allDocPayloads); + +writeManifest(OUTPUT_FILE_PATH, sortedDocPayloads); + +printSuccess(OUTPUT_FILE_PATH); +printStatsSummary(stats); +printMissingTypesSample(missingTypesModules); diff --git a/packages/components/scripts/parse-docs/ast-helpers.mjs b/packages/components/scripts/parse-docs/ast-helpers.mjs new file mode 100644 index 00000000000..b1a0ac84624 --- /dev/null +++ b/packages/components/scripts/parse-docs/ast-helpers.mjs @@ -0,0 +1,61 @@ +/** Copyright IBM Corp. 2021, 2026 SPDX-License-Identifier: MPL-2.0 */ + +import { Node } from 'ts-morph'; + +export function findImportForLocalName(sourceFile, localName) { + for (const importDecl of sourceFile.getImportDeclarations()) { + const moduleSpecifier = importDecl.getModuleSpecifierValue(); + + const defaultImport = importDecl.getDefaultImport(); + + if (defaultImport && defaultImport.getText() === localName) { + return { + importDecl, + moduleSpecifier, + importedName: 'default', + isDefault: true, + }; + } + + for (const namedImport of importDecl.getNamedImports()) { + const candidateLocalName = + namedImport.getAliasNode()?.getText() || namedImport.getName(); + + if (candidateLocalName !== localName) { + continue; + } + + return { + importDecl, + moduleSpecifier, + importedName: namedImport.getName(), + isDefault: false, + }; + } + } + + return null; +} + +export function getContextualComponentTypeQuery(typeNode) { + if (!typeNode) { + return null; + } + + if (Node.isTypeQuery(typeNode)) { + return typeNode; + } + + if ( + Node.isTypeReference(typeNode) && + typeNode.getTypeName().getText() === 'WithBoundArgs' + ) { + const firstTypeArg = typeNode.getTypeArguments()[0]; + + if (firstTypeArg && Node.isTypeQuery(firstTypeArg)) { + return firstTypeArg; + } + } + + return null; +} diff --git a/packages/components/scripts/parse-docs/component-parser.mjs b/packages/components/scripts/parse-docs/component-parser.mjs new file mode 100644 index 00000000000..48098de6018 --- /dev/null +++ b/packages/components/scripts/parse-docs/component-parser.mjs @@ -0,0 +1,254 @@ +/** Copyright IBM Corp. 2021, 2026 SPDX-License-Identifier: MPL-2.0 */ + +import { + PROP_ARGS, + PROP_BLOCKS, + PROP_ELEMENT, + SIGNATURE_SUFFIX, + TYPE_ENUM, + TYPE_UNKNOWN, +} from './constants.mjs'; +import { + findImportForLocalName, + getContextualComponentTypeQuery, +} from './ast-helpers.mjs'; + +export function parseComponentsFromEntry({ + entryFile, + sourceFileResolver, + typeResolver, + extractDocData, + stats, + onMissingTypesModule, +}) { + function getYieldedComponentSourcePath(yieldDeclaration) { + const typeNode = yieldDeclaration.getTypeNode?.(); + const typeQueryNode = getContextualComponentTypeQuery(typeNode); + + if (!typeQueryNode) { + return undefined; + } + + const symbolName = typeQueryNode.getExprName().getText(); + const sourceFile = yieldDeclaration.getSourceFile(); + const importMatch = findImportForLocalName(sourceFile, symbolName); + + if (!importMatch) { + return undefined; + } + + return importMatch.moduleSpecifier; + } + + function parseArgs(signatureInterface) { + const args = []; + const argsProperty = signatureInterface.getProperty(PROP_ARGS); + + if (!argsProperty) { + return args; + } + + const argsType = argsProperty.getType().getApparentType(); + + argsType.getProperties().forEach((prop) => { + const declaration = prop.getValueDeclaration(); + + if (!declaration) { + stats.skippedMissingArgDeclaration += 1; + + return; + } + + const docData = extractDocData(declaration); + const resolvedType = typeResolver.resolveDeclarationType(declaration); + + const parsedArg = { + name: prop.getName(), + type: + resolvedType.enumValues === undefined ? resolvedType.text : TYPE_ENUM, + required: !declaration.hasQuestionToken(), + description: docData.description, + remarks: docData.remarks, + defaultValue: docData.defaultValue, + dependsOn: docData.dependsOn, + }; + + if (resolvedType.enumValues !== undefined) { + parsedArg.values = resolvedType.enumValues; + } + + args.push(parsedArg); + }); + + return args; + } + + function parseBlockYields(declaration) { + const yields = []; + const tupleElements = declaration.getType().getTupleElements(); + + if (tupleElements.length === 0) { + return yields; + } + + tupleElements.forEach((tupleElement, index) => { + const yieldedProps = tupleElement.getProperties(); + + if (yieldedProps.length > 0) { + // object-like tuple members represent named yield values + yieldedProps.forEach((yieldedProp) => { + const yieldDecl = yieldedProp.getValueDeclaration(); + const yieldDocData = yieldDecl + ? extractDocData(yieldDecl) + : { description: '' }; + + if (!yieldDecl) { + stats.skippedMissingYieldDeclaration += 1; + } + + yields.push({ + name: yieldedProp.getName(), + type: yieldDecl + ? typeResolver.resolveYieldTypeText(yieldDecl) + : TYPE_UNKNOWN, + description: yieldDocData.description, + remarks: yieldDocData.remarks, + sourcePath: yieldDecl + ? getYieldedComponentSourcePath(yieldDecl) + : undefined, + }); + }); + + return; + } + + yields.push({ + name: `item${index + 1}`, + type: tupleElement.getText(declaration), + description: '', + }); + }); + + return yields; + } + + function parseBlocks(signatureInterface) { + const blocks = []; + const blocksProperty = signatureInterface.getProperty(PROP_BLOCKS); + + if (!blocksProperty) { + return blocks; + } + + const blocksType = blocksProperty.getType().getApparentType(); + + blocksType.getProperties().forEach((prop) => { + const declaration = prop.getValueDeclaration(); + + if (!declaration) { + stats.skippedMissingBlockDeclaration += 1; + + return; + } + + const docData = extractDocData(declaration); + const yields = parseBlockYields(declaration); + + blocks.push({ + name: prop.getName(), + description: docData.description, + yields, + }); + }); + + return blocks; + } + + function parseElement(signatureInterface) { + const elementProperty = signatureInterface.getProperty(PROP_ELEMENT); + + if (!elementProperty) { + return { + element: null, + splattributes: false, + }; + } + + const docData = extractDocData(elementProperty); + + return { + element: elementProperty.getType().getText(), + splattributes: docData.hasSplattributesTag, + }; + } + + const allDocPayloads = {}; + const exportDeclarations = entryFile.getExportDeclarations(); + + for (const exportDecl of exportDeclarations) { + stats.exportsVisited += 1; + + const moduleSpecifier = exportDecl.getModuleSpecifierValue(); + + if (!moduleSpecifier) { + stats.skippedWithoutModuleSpecifier += 1; + + continue; + } + + const targetFile = + sourceFileResolver.resolveTypesSourceFile(moduleSpecifier); + + if (!targetFile) { + stats.skippedMissingTypesFile += 1; + + onMissingTypesModule(moduleSpecifier); + + continue; + } + + const signatures = targetFile + .getInterfaces() + .filter((i) => i.getName().endsWith(SIGNATURE_SUFFIX)); + + signatures.forEach((signatureInterface) => { + const interfaceName = signatureInterface.getName(); + const componentName = interfaceName.replace(SIGNATURE_SUFFIX, ''); + + if (allDocPayloads[componentName]) { + stats.skippedDuplicateComponent += 1; + return; + } + + console.log(`📦 Generating docs for: ${componentName}`); + + const componentDocs = { + name: componentName, + args: [], + blocks: [], + element: null, + splattributes: false, + }; + + componentDocs.args = parseArgs(signatureInterface); + componentDocs.blocks = parseBlocks(signatureInterface); + + const parsedElement = parseElement(signatureInterface); + componentDocs.element = parsedElement.element; + componentDocs.splattributes = parsedElement.splattributes; + + componentDocs.args.sort((a, b) => a.name.localeCompare(b.name)); + // keep stable ordering in manifest diffs + componentDocs.blocks.forEach((block) => { + block.yields.sort((a, b) => a.name.localeCompare(b.name)); + }); + componentDocs.blocks.sort((a, b) => a.name.localeCompare(b.name)); + + allDocPayloads[componentName] = componentDocs; + + stats.componentsGenerated += 1; + }); + } + + return allDocPayloads; +} diff --git a/packages/components/scripts/parse-docs/config.mjs b/packages/components/scripts/parse-docs/config.mjs new file mode 100644 index 00000000000..c3bfdf8944a --- /dev/null +++ b/packages/components/scripts/parse-docs/config.mjs @@ -0,0 +1,22 @@ +/** Copyright IBM Corp. 2021, 2026 SPDX-License-Identifier: MPL-2.0 */ + +import { dirname, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +export const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url)); +export const ENTRY_FILE_PATH = resolve(SCRIPT_DIR, '../../src/components.ts'); +export const OUTPUT_FILE_PATH = resolve( + SCRIPT_DIR, + '../../dist/manifest/components.json' +); +export const TSCONFIG_PATH = resolve(SCRIPT_DIR, '../../tsconfig.json'); + +/** + * Keep tracing bounded so a single highly-expanded type from local or external + * declarations cannot explode parse time or output size + */ +export const TYPE_TRACE_LIMITS = { + maxDepth: 24, + maxUnionMembers: 80, + maxTemplateExpansions: 120, +}; diff --git a/packages/components/scripts/parse-docs/constants.mjs b/packages/components/scripts/parse-docs/constants.mjs new file mode 100644 index 00000000000..333eeb126e9 --- /dev/null +++ b/packages/components/scripts/parse-docs/constants.mjs @@ -0,0 +1,15 @@ +/** Copyright IBM Corp. 2021, 2026 SPDX-License-Identifier: MPL-2.0 */ + +export const TYPE_COMPONENT = 'component'; +export const TYPE_ENUM = 'enum'; +export const TYPE_FUNCTION = 'function'; +export const TYPE_STRING = 'string'; +export const TYPE_UNKNOWN = 'unknown'; + +// Keep this sentinel in sync with website/app/shared/component-api-manifest.ts. +export const TYPE_YIELDED_COMPONENT = TYPE_COMPONENT; + +export const SIGNATURE_SUFFIX = 'Signature'; +export const PROP_ARGS = 'Args'; +export const PROP_BLOCKS = 'Blocks'; +export const PROP_ELEMENT = 'Element'; diff --git a/packages/components/scripts/parse-docs/doc-text.mjs b/packages/components/scripts/parse-docs/doc-text.mjs new file mode 100644 index 00000000000..074c5b35fc8 --- /dev/null +++ b/packages/components/scripts/parse-docs/doc-text.mjs @@ -0,0 +1,164 @@ +/** Copyright IBM Corp. 2021, 2026 SPDX-License-Identifier: MPL-2.0 */ + +export function normalizeTagText(tag) { + const tagComment = tag.getCommentText(); + + if (typeof tagComment === 'string') { + // ts-morph can return structured tag comment text so normalize line endings here + return tagComment + .split('\n') + .map((line) => line.trimEnd()) + .join('\n'); + } + + return ''; +} + +export function toSingleLineText(value) { + if (typeof value !== 'string') { + return ''; + } + + return value + .replace(/\r\n?/g, '\n') + .replace(/\s*\n\s*/g, ' ') + .replace(/\s{2,}/g, ' ') + .trim(); +} + +export function normalizeMarkdownText(value) { + if (typeof value !== 'string') { + return ''; + } + + const lines = value + .replace(/\r\n?/g, '\n') + .split('\n') + .map((line) => line.trimEnd()); + + while (lines.length > 0 && lines[0].trim() === '') { + lines.shift(); + } + + while (lines.length > 0 && lines[lines.length - 1].trim() === '') { + lines.pop(); + } + + const indents = lines + .filter((line) => line.trim() !== '') + .map((line) => { + const match = line.match(/^\s*/); + return match ? match[0].length : 0; + }); + + const commonIndent = indents.length > 0 ? Math.min(...indents) : 0; + + const deindentedLines = lines.map((line) => line.slice(commonIndent)); + const outputLines = []; + let currentLine = ''; + let currentMode = null; + + function flushCurrentLine() { + if (currentLine) { + outputLines.push(currentLine.trim()); + currentLine = ''; + currentMode = null; + } + } + + function pushBlankLine() { + if (outputLines.length === 0) { + return; + } + + if (outputLines[outputLines.length - 1] !== '') { + outputLines.push(''); + } + } + + for (const rawLine of deindentedLines) { + const line = rawLine.trim(); + + if (line === '') { + flushCurrentLine(); + pushBlankLine(); + continue; + } + + const listMatch = line.match(/^([-*+]|\d+[.)])\s+(.*)$/); + + if (listMatch) { + flushCurrentLine(); + // keep list item boundaries while still collapsing wrapped lines + currentMode = 'list'; + currentLine = `${listMatch[1]} ${listMatch[2]}`; + continue; + } + + if (currentMode === 'list' || currentMode === 'paragraph') { + currentLine = `${currentLine} ${line}`; + continue; + } + + currentMode = 'paragraph'; + currentLine = line; + } + + flushCurrentLine(); + + while (outputLines.length > 0 && outputLines[0] === '') { + outputLines.shift(); + } + + while (outputLines.length > 0 && outputLines[outputLines.length - 1] === '') { + outputLines.pop(); + } + + return outputLines.join('\n'); +} + +export function extractDocData(declarationNode) { + const result = { + description: '', + remarks: '', + defaultValue: null, + dependsOn: null, + splattributes: null, + hasSplattributesTag: false, + }; + + const jsDocs = declarationNode.getJsDocs(); + + if (jsDocs.length === 0) { + return result; + } + + const doc = jsDocs[0]; + // intentionally prefer the first jsdoc block to match current authoring conventions + + result.description = toSingleLineText(doc.getComment()); + + doc.getTags().forEach((tag) => { + const tagName = tag.getTagName(); + const tagText = normalizeTagText(tag); + + if (tagName === 'remarks') { + result.remarks = normalizeMarkdownText(tagText); + } + + if (tagName === 'defaultValue') { + result.defaultValue = toSingleLineText(tagText) || null; + } + + if (tagName === 'dependsOn') { + result.dependsOn = toSingleLineText(tagText) || null; + } + + if (tagName === 'splattributes') { + result.hasSplattributesTag = true; + result.splattributes = toSingleLineText(tagText) || null; + } + }); + + return result; +} diff --git a/packages/components/scripts/parse-docs/literal.mjs b/packages/components/scripts/parse-docs/literal.mjs new file mode 100644 index 00000000000..7353c58a380 --- /dev/null +++ b/packages/components/scripts/parse-docs/literal.mjs @@ -0,0 +1,46 @@ +/** Copyright IBM Corp. 2021, 2026 SPDX-License-Identifier: MPL-2.0 */ + +export function splitUnion(typeText) { + if (typeof typeText !== 'string') { + return []; + } + + return typeText + .split('|') + .map((part) => part.trim()) + .filter(Boolean); +} + +export function isQuotedLiteral(value) { + return typeof value === 'string' && /^(['"]).*\1$/u.test(value); +} + +export function unquoteLiteral(value) { + if (typeof value !== 'string') { + return value; + } + + const match = /^(['"])(.*)\1$/u.exec(value); + + if (match === null) { + return value; + } + + return match[2]; +} + +export function parseStringEnumValues(typeText) { + const values = splitUnion(typeText); + + if (values.length < 2) { + return undefined; + } + + const areAllStringLiterals = values.every((value) => isQuotedLiteral(value)); + + if (areAllStringLiterals === false) { + return undefined; + } + + return values.map((value) => unquoteLiteral(value)); +} diff --git a/packages/components/scripts/parse-docs/output.mjs b/packages/components/scripts/parse-docs/output.mjs new file mode 100644 index 00000000000..51e5b97619d --- /dev/null +++ b/packages/components/scripts/parse-docs/output.mjs @@ -0,0 +1,34 @@ +/** Copyright IBM Corp. 2021, 2026 SPDX-License-Identifier: MPL-2.0 */ + +import { writeFileSync } from 'node:fs'; + +export function sortDocPayloads(allDocPayloads) { + return Object.fromEntries( + Object.entries(allDocPayloads).sort(([a], [b]) => a.localeCompare(b)) + ); +} + +export function writeManifest(outputFilePath, payload) { + writeFileSync(outputFilePath, JSON.stringify(payload, null, 2)); +} + +export function printSuccess(outputFilePath) { + console.log( + `\n🎉 Successfully compiled component documentation to: ${outputFilePath}` + ); +} + +export function printMissingTypesSample(missingTypesModules) { + if (missingTypesModules.length === 0) { + return; + } + + // cap console output so large missing lists do not bury parse stats + const sample = missingTypesModules.slice(0, 10); + + console.log(' Sample exports without a matching types file:'); + + sample.forEach((modulePath) => { + console.log(` - ${modulePath}`); + }); +} diff --git a/packages/components/scripts/parse-docs/source-files.mjs b/packages/components/scripts/parse-docs/source-files.mjs new file mode 100644 index 00000000000..059fa09ee96 --- /dev/null +++ b/packages/components/scripts/parse-docs/source-files.mjs @@ -0,0 +1,75 @@ +/** Copyright IBM Corp. 2021, 2026 SPDX-License-Identifier: MPL-2.0 */ + +import { dirname, resolve } from 'node:path'; + +export function createSourceFileResolver({ project, entryFile }) { + function resolveTypesSourceFile(moduleSpecifier) { + const candidates = []; + + if (moduleSpecifier.endsWith('.types.ts')) { + candidates.push(moduleSpecifier); + } else if (moduleSpecifier.endsWith('.gts')) { + candidates.push(`${moduleSpecifier.slice(0, -4)}.types.ts`); + } else if (moduleSpecifier.endsWith('.ts')) { + candidates.push(`${moduleSpecifier.slice(0, -3)}.types.ts`); + } + + const dedupedCandidates = [...new Set(candidates)]; + + for (const candidate of dedupedCandidates) { + const candidatePath = resolve(entryFile.getDirectoryPath(), candidate); + const candidateFile = project.addSourceFileAtPathIfExists(candidatePath); + + if (candidateFile) { + return candidateFile; + } + } + + return null; + } + + function resolveImportSourceFile(fromSourceFile, moduleSpecifier) { + const resolvedByTs = fromSourceFile + .getImportDeclarations() + .find( + (importDecl) => importDecl.getModuleSpecifierValue() === moduleSpecifier + ) + ?.getModuleSpecifierSourceFile(); + + if (resolvedByTs) { + return resolvedByTs; + } + + if (!moduleSpecifier.startsWith('.')) { + // non-relative imports are intentionally skipped to avoid crawling external packages + return null; + } + + const fromDir = dirname(fromSourceFile.getFilePath()); + const basePath = resolve(fromDir, moduleSpecifier); + const candidates = [ + basePath, + `${basePath}.ts`, + `${basePath}.gts`, + `${basePath}.d.ts`, + resolve(basePath, 'index.ts'), + resolve(basePath, 'index.gts'), + resolve(basePath, 'index.d.ts'), + ]; + + for (const candidatePath of candidates) { + const sourceFile = project.addSourceFileAtPathIfExists(candidatePath); + + if (sourceFile) { + return sourceFile; + } + } + + return null; + } + + return { + resolveTypesSourceFile, + resolveImportSourceFile, + }; +} diff --git a/packages/components/scripts/parse-docs/stats.mjs b/packages/components/scripts/parse-docs/stats.mjs new file mode 100644 index 00000000000..93f7112057f --- /dev/null +++ b/packages/components/scripts/parse-docs/stats.mjs @@ -0,0 +1,46 @@ +/** Copyright IBM Corp. 2021, 2026 SPDX-License-Identifier: MPL-2.0 */ + +const STAT_DEFINITIONS = [ + { key: 'exportsVisited', label: 'Exports visited' }, + { key: 'componentsGenerated', label: 'Components generated' }, + { + key: 'skippedWithoutModuleSpecifier', + label: 'Skipped (no module specifier)', + }, + { key: 'skippedMissingTypesFile', label: 'Skipped (missing types file)' }, + { key: 'skippedDuplicateComponent', label: 'Skipped (duplicate component)' }, + { + key: 'skippedMissingArgDeclaration', + label: 'Skipped (missing arg declaration)', + }, + { + key: 'skippedMissingBlockDeclaration', + label: 'Skipped (missing block declaration)', + }, + { + key: 'skippedMissingYieldDeclaration', + label: 'Skipped (missing yield declaration)', + }, + { + key: 'typeResolvedViaAst', + label: 'Types resolved via AST tracing', + }, + { key: 'typeResolutionFallbacks', label: 'Type resolution fallbacks' }, + { + key: 'typeResolutionCapped', + label: 'Type resolution capped by limits', + }, +]; + +export function createStats() { + return Object.fromEntries( + STAT_DEFINITIONS.map((definition) => [definition.key, 0]) + ); +} + +export function printStatsSummary(stats) { + console.log('\n📊 Docs parse summary:'); + STAT_DEFINITIONS.forEach(({ key, label }) => { + console.log(` ${label}: ${stats[key]}`); + }); +} diff --git a/packages/components/scripts/parse-docs/type-resolver.mjs b/packages/components/scripts/parse-docs/type-resolver.mjs new file mode 100644 index 00000000000..2a3105aaa29 --- /dev/null +++ b/packages/components/scripts/parse-docs/type-resolver.mjs @@ -0,0 +1,621 @@ +/** Copyright IBM Corp. 2021, 2026 SPDX-License-Identifier: MPL-2.0 */ + +import { Node, SyntaxKind } from 'ts-morph'; + +import { + TYPE_FUNCTION, + TYPE_STRING, + TYPE_UNKNOWN, + TYPE_YIELDED_COMPONENT, +} from './constants.mjs'; +import { + findImportForLocalName, + getContextualComponentTypeQuery, +} from './ast-helpers.mjs'; +import { + isQuotedLiteral, + parseStringEnumValues, + splitUnion, + unquoteLiteral, +} from './literal.mjs'; + +export function createTypeResolver({ limits, stats, resolveImportSourceFile }) { + function incrementTypeResolutionCapped() { + stats.typeResolutionCapped += 1; + } + + function isKeywordTypeNode(node) { + return ( + Node.isAnyKeyword(node) || + Node.isBooleanKeyword(node) || + Node.isNumberKeyword(node) || + Node.isStringKeyword(node) || + Node.isSymbolKeyword(node) || + Node.isObjectKeyword(node) || + Node.isUndefinedKeyword(node) || + Node.isNeverKeyword(node) + ); + } + + function findDeclaredTypeByName(sourceFile, typeName) { + return ( + sourceFile.getTypeAlias(typeName) || + sourceFile.getInterface(typeName) || + sourceFile.getEnum(typeName) || + sourceFile.getClass(typeName) + ); + } + + function findImportedTypeDeclaration(sourceFile, localTypeName) { + // resolve both aliased named imports and default imports before falling back to raw text + const importMatch = findImportForLocalName(sourceFile, localTypeName); + + if (!importMatch) { + return null; + } + + const importedFile = resolveImportSourceFile( + sourceFile, + importMatch.moduleSpecifier + ); + + if (!importedFile) { + return null; + } + + if (importMatch.isDefault) { + const defaultExportSymbol = importedFile.getDefaultExportSymbol(); + const declaration = defaultExportSymbol?.getDeclarations()?.[0]; + + if (declaration) { + return declaration; + } + + return null; + } + + const declaration = findDeclaredTypeByName( + importedFile, + importMatch.importedName + ); + + if (declaration) { + return declaration; + } + + return null; + } + + function findTypeDeclarationFromReference(sourceFile, typeName) { + return ( + findDeclaredTypeByName(sourceFile, typeName) || + findImportedTypeDeclaration(sourceFile, typeName) + ); + } + + function createDeclarationKey(declaration, typeName) { + return `${declaration.getSourceFile().getFilePath()}:${typeName}`; + } + + function withDeclarationCycleGuard(seen, declaration, typeName, onResolve) { + const declarationKey = createDeclarationKey(declaration, typeName); + + if (seen.has(declarationKey)) { + // break recursive type cycles instead of recursing indefinitely + incrementTypeResolutionCapped(); + + return null; + } + + seen.add(declarationKey); + const resolved = onResolve(); + seen.delete(declarationKey); + + return resolved; + } + + function resolveTypeFromDeclaration(declaration, seen, depth) { + if (!declaration || depth > limits.maxDepth) { + incrementTypeResolutionCapped(); + + return null; + } + + if (Node.isTypeAliasDeclaration(declaration)) { + return resolveTypeNodeToText( + declaration.getTypeNode(), + declaration.getSourceFile(), + seen, + depth + 1 + ); + } + + if (Node.isEnumDeclaration(declaration)) { + // expand enum members to a literal union when possible for clearer docs output + const members = declaration + .getMembers() + .map((member) => member.getInitializer()?.getText() || member.getName()) + .filter(Boolean); + + if (members.length > 0) { + if (members.length > limits.maxUnionMembers) { + incrementTypeResolutionCapped(); + + return declaration.getName(); + } + + return members.join(' | '); + } + + return declaration.getName(); + } + + if ( + Node.isClassDeclaration(declaration) || + Node.isInterfaceDeclaration(declaration) + ) { + return declaration.getName() || declaration.getText(); + } + + return declaration.getText(); + } + + function resolveTypeReferenceNodeToText(typeNode, sourceFile, seen, depth) { + const typeNameNode = typeNode.getTypeName(); + const typeNameText = typeNameNode.getText(); + + if (typeNameText.includes('.')) { + return typeNode.getText(); + } + + const typeArgs = typeNode.getTypeArguments(); + const resolvedTypeArgs = typeArgs.map((arg) => + resolveTypeNodeToText(arg, sourceFile, seen, depth + 1) + ); + + const declaration = findTypeDeclarationFromReference( + sourceFile, + typeNameText + ); + + if (!declaration) { + if (resolvedTypeArgs.length === 0) { + return typeNameText; + } + + return `${typeNameText}<${resolvedTypeArgs.join(', ')}>`; + } + + const resolved = withDeclarationCycleGuard( + seen, + declaration, + typeNameText, + () => resolveTypeFromDeclaration(declaration, seen, depth + 1) + ); + + const baseType = resolved || typeNameText; + + if (resolvedTypeArgs.length === 0) { + return baseType; + } + + return `${baseType}<${resolvedTypeArgs.join(', ')}>`; + } + + function findPropertyTypeNodeFromContainer(containerNode, propertyName) { + if (!containerNode) { + return null; + } + + if (Node.isTypeLiteral(containerNode)) { + const property = containerNode.getProperty(propertyName); + + return property?.getTypeNode() || null; + } + + if (Node.isInterfaceDeclaration(containerNode)) { + const property = containerNode.getProperty(propertyName); + + return property?.getTypeNode() || null; + } + + // Semantic fallback for containers such as intersection/union/type-reference + // where the property may not be represented as a direct AST child node. + if (typeof containerNode.getType === 'function') { + const containerType = containerNode.getType(); + const propertySymbol = containerType.getProperty(propertyName); + const propertyDeclaration = + propertySymbol?.getValueDeclaration() || + propertySymbol?.getDeclarations()?.[0]; + + if ( + propertyDeclaration && + typeof propertyDeclaration.getTypeNode === 'function' + ) { + return propertyDeclaration.getTypeNode() || null; + } + } + + return null; + } + + function expandTemplateLiteralTypeNode(typeNode, sourceFile, seen, depth) { + const head = typeNode.getHead().getLiteralText(); + const spans = typeNode.getTemplateSpans(); + let combinations = [head]; + + for (const span of spans) { + const spanTypeNode = + span.getFirstChildIfKind(SyntaxKind.TypeReference) || + span.getFirstChildIfKind(SyntaxKind.TemplateLiteralType) || + span.getFirstChildIfKind(SyntaxKind.UnionType) || + span.getFirstChildIfKind(SyntaxKind.LiteralType) || + span.getFirstChild(); + + if (!spanTypeNode || !Node.isTypeNode(spanTypeNode)) { + return TYPE_STRING; + } + + const spanTypeText = resolveTypeNodeToText( + spanTypeNode, + sourceFile, + seen, + depth + 1 + ); + + const spanOptions = splitUnion(spanTypeText) + .filter((option) => isQuotedLiteral(option)) + .map((option) => unquoteLiteral(option)); + + if (spanOptions.length === 0) { + // if any segment is non-literal the cartesian expansion becomes open-ended + return TYPE_STRING; + } + + const tailNode = span.getLastChild(); + const tailText = + tailNode && typeof tailNode.getLiteralText === 'function' + ? tailNode.getLiteralText() + : ''; + + const nextCombinations = []; + + for (const prefix of combinations) { + for (const option of spanOptions) { + nextCombinations.push(`${prefix}${option}${tailText}`); + + if (nextCombinations.length > limits.maxTemplateExpansions) { + incrementTypeResolutionCapped(); + return TYPE_STRING; + } + } + } + + combinations = nextCombinations; + } + + const literalUnion = combinations.map((value) => `'${value}'`); + + if (literalUnion.length > limits.maxUnionMembers) { + incrementTypeResolutionCapped(); + return TYPE_STRING; + } + + return literalUnion.join(' | '); + } + + function resolveIndexedAccessTypeNodeToText( + typeNode, + sourceFile, + seen, + depth + ) { + // unwind nested indexed access nodes so we can walk each key in order + const keys = []; + let currentNode = typeNode; + + while (Node.isIndexedAccessTypeNode(currentNode)) { + const indexTypeNode = currentNode.getIndexTypeNode(); + + if (!Node.isLiteralTypeNode(indexTypeNode)) { + return typeNode.getText(); + } + + const literalNode = indexTypeNode.getLiteral(); + if (!Node.isStringLiteral(literalNode)) { + return typeNode.getText(); + } + + keys.unshift(literalNode.getLiteralText()); + currentNode = currentNode.getObjectTypeNode(); + } + + let rootTypeNode = currentNode; + let rootSourceFile = sourceFile; + + if (Node.isTypeReference(rootTypeNode)) { + const rootName = rootTypeNode.getTypeName().getText(); + const declaration = findTypeDeclarationFromReference( + sourceFile, + rootName + ); + + if (!declaration) { + return typeNode.getText(); + } + + rootSourceFile = declaration.getSourceFile(); + + if (Node.isTypeAliasDeclaration(declaration)) { + rootTypeNode = declaration.getTypeNode(); + } else { + rootTypeNode = declaration; + } + } + + let container = rootTypeNode; + + for (const key of keys) { + let nextTypeNode = findPropertyTypeNodeFromContainer(container, key); + + if (!nextTypeNode && Node.isTypeReference(container)) { + const referencedName = container.getTypeName().getText(); + const declaration = findTypeDeclarationFromReference( + rootSourceFile, + referencedName + ); + + if (!declaration) { + return typeNode.getText(); + } + + rootSourceFile = declaration.getSourceFile(); + container = declaration; + nextTypeNode = findPropertyTypeNodeFromContainer(container, key); + } + + if (!nextTypeNode) { + return typeNode.getText(); + } + + container = nextTypeNode; + } + + if (Node.isTypeNode(container) || isKeywordTypeNode(container)) { + return resolveTypeNodeToText(container, rootSourceFile, seen, depth + 1); + } + + return typeNode.getText(); + } + + function resolveTypeNodeToText( + typeNode, + sourceFile, + seen = new Set(), + depth = 0 + ) { + if (!typeNode || depth > limits.maxDepth) { + incrementTypeResolutionCapped(); + return TYPE_UNKNOWN; + } + + if (Node.isParenthesizedTypeNode(typeNode)) { + return `(${resolveTypeNodeToText( + typeNode.getTypeNode(), + sourceFile, + seen, + depth + 1 + )})`; + } + + if (Node.isUnionTypeNode(typeNode)) { + const nodes = typeNode.getTypeNodes(); + + if (nodes.length > limits.maxUnionMembers) { + incrementTypeResolutionCapped(); + return typeNode.getText(); + } + + return nodes + .map((node) => resolveTypeNodeToText(node, sourceFile, seen, depth + 1)) + .join(' | '); + } + + if (Node.isIntersectionTypeNode(typeNode)) { + return typeNode + .getTypeNodes() + .map((node) => resolveTypeNodeToText(node, sourceFile, seen, depth + 1)) + .join(' & '); + } + + if (Node.isArrayTypeNode(typeNode)) { + return `${resolveTypeNodeToText( + typeNode.getElementTypeNode(), + sourceFile, + seen, + depth + 1 + )}[]`; + } + + if (Node.isTupleTypeNode(typeNode)) { + return `[${typeNode + .getElements() + .map((node) => resolveTypeNodeToText(node, sourceFile, seen, depth + 1)) + .join(', ')}]`; + } + + if (Node.isLiteralTypeNode(typeNode)) { + return typeNode.getText(); + } + + if (isKeywordTypeNode(typeNode)) { + return typeNode.getText(); + } + + if (Node.isFunctionTypeNode(typeNode)) { + return TYPE_FUNCTION; + } + + if (Node.isTemplateLiteralTypeNode(typeNode)) { + return expandTemplateLiteralTypeNode( + typeNode, + sourceFile, + seen, + depth + 1 + ); + } + + if (Node.isTypeReference(typeNode)) { + return resolveTypeReferenceNodeToText( + typeNode, + sourceFile, + seen, + depth + 1 + ); + } + + if (Node.isIndexedAccessTypeNode(typeNode)) { + return resolveIndexedAccessTypeNodeToText( + typeNode, + sourceFile, + seen, + depth + 1 + ); + } + + return typeNode.getText(); + } + + function tryResolveEnumValues(typeNode, sourceFile, seen, depth) { + if (!typeNode || depth > limits.maxDepth) { + return undefined; + } + + if (Node.isTypeReference(typeNode)) { + const typeNameText = typeNode.getTypeName().getText(); + const declaration = findTypeDeclarationFromReference( + sourceFile, + typeNameText + ); + + if (!declaration) { + return undefined; + } + + const resolved = withDeclarationCycleGuard( + seen, + declaration, + typeNameText, + () => { + if (!Node.isTypeAliasDeclaration(declaration)) { + return undefined; + } + + return tryResolveEnumValues( + declaration.getTypeNode(), + declaration.getSourceFile(), + seen, + depth + 1 + ); + } + ); + + return resolved === null ? undefined : resolved; + } + + if (!Node.isUnionTypeNode(typeNode)) { + return undefined; + } + + const values = []; + + for (const node of typeNode.getTypeNodes()) { + if (!Node.isLiteralTypeNode(node)) { + return undefined; + } + + const literalNode = node.getLiteral(); + + if (!Node.isStringLiteral(literalNode)) { + return undefined; + } + + values.push(literalNode.getLiteralText()); + } + + if (values.length < 2) { + return undefined; + } + + return values; + } + + function resolveDeclarationType(declaration) { + const typeNode = declaration.getTypeNode?.(); + + if (typeNode) { + const tracedText = resolveTypeNodeToText( + typeNode, + declaration.getSourceFile() + ); + + if (tracedText && tracedText !== TYPE_UNKNOWN) { + stats.typeResolvedViaAst += 1; + + const enumValuesFromAst = tryResolveEnumValues( + typeNode, + declaration.getSourceFile(), + new Set(), + 0 + ); + + return { + text: tracedText, + enumValues: + enumValuesFromAst === undefined + ? parseStringEnumValues(tracedText) + : enumValuesFromAst, + }; + } + } + + stats.typeResolutionFallbacks += 1; + // semantic type text can be noisy so normalize function signatures for readability + const fallbackTypeText = declaration.getType().getText(declaration); + const normalizedText = fallbackTypeText.includes('=>') + ? TYPE_FUNCTION + : fallbackTypeText; + + return { + text: normalizedText, + enumValues: parseStringEnumValues(normalizedText), + }; + } + + function resolveDeclarationTypeText(declaration) { + return resolveDeclarationType(declaration).text; + } + + function resolveYieldTypeText(declaration) { + const typeNode = declaration.getTypeNode?.(); + + if (!typeNode) { + return resolveDeclarationTypeText(declaration); + } + + // In this codebase, yielded contextual components are authored as either + // `typeof ComponentName` or `WithBoundArgs`. + // For docs readability, normalize both to `component`. + if (getContextualComponentTypeQuery(typeNode)) { + return TYPE_YIELDED_COMPONENT; + } + + return resolveDeclarationTypeText(declaration); + } + + return { + resolveDeclarationType, + resolveDeclarationTypeText, + resolveYieldTypeText, + }; +} diff --git a/packages/components/src/components/hds/advanced-table/th-context-menu.gts b/packages/components/src/components/hds/advanced-table/th-context-menu.gts index dd8dbccfcb4..e0d43c90a8e 100644 --- a/packages/components/src/components/hds/advanced-table/th-context-menu.gts +++ b/packages/components/src/components/hds/advanced-table/th-context-menu.gts @@ -15,7 +15,7 @@ import { on } from '@ember/modifier'; import HdsDropdown from '../dropdown/index.gts'; import hdsT from '../../../helpers/hds-t.ts'; -import type { HdsDropdownSignature } from '../dropdown/index.gts'; +import type { HdsDropdownSignature } from '../dropdown/index.types.ts'; import type { HdsDropdownToggleIconSignature } from '../dropdown/toggle/icon.gts'; import type { HdsAdvancedTableSignature } from './index.gts'; import type { HdsAdvancedTableThReorderHandleSignature } from './th-reorder-handle.gts'; diff --git a/packages/components/src/components/hds/alert/index.gts b/packages/components/src/components/hds/alert/index.gts index 0798204f71f..9056435567e 100644 --- a/packages/components/src/components/hds/alert/index.gts +++ b/packages/components/src/components/hds/alert/index.gts @@ -13,7 +13,6 @@ import { on } from '@ember/modifier'; // eslint-disable-next-line ember/no-at-ember-render-modifiers import didInsert from '@ember/render-modifiers/modifiers/did-insert'; -import type { WithBoundArgs } from '@glint/template'; import type Owner from '@ember/owner'; import { HdsAlertColorValues, HdsAlertTypeValues } from './types.ts'; @@ -25,6 +24,7 @@ import HdsButton from '../button/index.gts'; import HdsLinkStandalone from '../link/standalone.gts'; import HdsYield from '../yield/index.gts'; +import type { HdsAlertSignature } from './index.types'; import type { HdsAlertColors, HdsAlertTypes } from './types.ts'; import type { HdsIconSignature } from '../icon/index.gts'; @@ -44,28 +44,6 @@ const CONTENT_ELEMENT_SELECTOR = '.hds-alert__content'; const TITLE_ELEMENT_SELECTOR = '.hds-alert__title'; const DESCRIPTION_ELEMENT_SELECTOR = '.hds-alert__description'; -export interface HdsAlertSignature { - Args: { - type: HdsAlertTypes; - color?: HdsAlertColors; - icon?: HdsIconSignature['Args']['name'] | false; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - onDismiss?: (event: MouseEvent, ...args: any[]) => void; - }; - Blocks: { - default: [ - { - Title?: typeof HdsAlertTitle; - Description?: typeof HdsAlertDescription; - Generic?: typeof HdsYield; - LinkStandalone?: WithBoundArgs; - Button?: WithBoundArgs; - }, - ]; - }; - Element: HTMLDivElement; -} - export default class HdsAlert extends Component { @tracked private _role?: string; @tracked private _ariaLabelledBy?: string; diff --git a/packages/components/src/components/hds/alert/index.types.ts b/packages/components/src/components/hds/alert/index.types.ts new file mode 100644 index 00000000000..b37e9d71d7f --- /dev/null +++ b/packages/components/src/components/hds/alert/index.types.ts @@ -0,0 +1,59 @@ +import HdsAlertTitle from './title.gts'; +import HdsAlertDescription from './description.gts'; +import HdsLinkStandalone from '../link/standalone.gts'; +import HdsButton from '../button/index.gts'; +import HdsYield from '../yield/index.gts'; + +import type { WithBoundArgs } from '@glint/template'; +import type { HdsAlertColors, HdsAlertTypes } from './types.ts'; +import type { HdsIconSignature } from '../icon/index.gts'; + +export interface HdsAlertSignature { + Args: { + /** Sets the type of alert. */ + type: HdsAlertTypes; + + /** + * Sets the color scheme for `background`, `border`, `title`, and + * `description`, which **cannot** be overridden. + * + * @remarks + * `color` results in a default `icon`, which **can** be overridden.

For the “success”, “warning”, and “critical” colors, either + * `role="alert"` or “success”, “warning”, and “critical” colors, either + * `role="alert"` or `role="alertdialog"` and `aria-live="polite"` will be + * included by default which can be overridden if necessary.

+ * The “neutral” and “highlight” colors do not include a role attribute or + * `aria-live="polite"` by default. + * @defaultValue 'neutral' + */ + color?: HdsAlertColors; + + /** + * Override the default `icon` name, which is determined by the `color` + * argument. + * + * @remarks + * Accepts any [icon](/icons/library) name, or `false`, for no icon. + */ + icon?: HdsIconSignature['Args']['name'] | false; + + /** + * The alert can be dismissed by the user. When a function is passed, the + * "dismiss" button is displayed. + */ + onDismiss?: (event: MouseEvent, ...args: unknown[]) => void; + }; + Blocks: { + default: [ + { + Title?: typeof HdsAlertTitle; + Description?: typeof HdsAlertDescription; + Generic?: typeof HdsYield; + LinkStandalone?: WithBoundArgs; + Button?: WithBoundArgs; + }, + ]; + }; + Element: HTMLDivElement; +} diff --git a/packages/components/src/components/hds/app-header/index.gts b/packages/components/src/components/hds/app-header/index.gts index 0d450f4808b..932c3710ca0 100644 --- a/packages/components/src/components/hds/app-header/index.gts +++ b/packages/components/src/components/hds/app-header/index.gts @@ -14,41 +14,11 @@ import { NavigationNarrator } from 'ember-a11y-refocus'; import focusTrap from 'ember-focus-trap/modifiers/focus-trap'; import type Owner from '@ember/owner'; -import type { NavigationNarratorSignature } from 'ember-a11y-refocus/components/navigation-narrator'; +import type { HdsAppHeaderSignature } from './index.types'; import { hdsBreakpoints } from '../../../utils/hds-breakpoints.ts'; import HdsAppHeaderMenuButton from './menu-button.gts'; -export interface HdsAppHeaderSignature { - Args: { - breakpoint?: string; - hasA11yRefocus?: boolean; - a11yRefocusSkipTo?: string; - a11yRefocusSkipText?: string; - a11yRefocusNavigationText?: string; - a11yRefocusRouteChangeValidator?: NavigationNarratorSignature['Args']['routeChangeValidator']; - a11yRefocusExcludeAllQueryParams?: boolean; - }; - Blocks: { - logo?: [ - { - close: () => void; - }, - ]; - globalActions?: [ - { - close: () => void; - }, - ]; - utilityActions?: [ - { - close: () => void; - }, - ]; - }; - Element: HTMLDivElement; -} - export default class HdsAppHeader extends Component { @tracked private _isOpen = false; @tracked private _isDesktop = true; diff --git a/packages/components/src/components/hds/app-header/index.types.ts b/packages/components/src/components/hds/app-header/index.types.ts new file mode 100644 index 00000000000..fcf166e76e1 --- /dev/null +++ b/packages/components/src/components/hds/app-header/index.types.ts @@ -0,0 +1,120 @@ +import type { NavigationNarratorSignature } from 'ember-a11y-refocus/components/navigation-narrator'; + +export interface HdsAppHeaderSignature { + Args: { + /** + * Set a custom breakpoint to control the page width at which the UI + * switches from displaying the mobile/small view vs. the desktop/large + * view. + * + * @defaultValue '1088px' + */ + breakpoint?: string; + + /** + * Controls whether a "navigator narrator" and a "skip link" are added to + * the navigation (provided by the [`ember-a11y-refocus` Ember + * addon](https://github.com/ember-a11y/ember-a11y-refocus)). It can be + * programmatically turned off by passing `false`. + * + * @remarks + * **Warning:** If it is set to false, then it will fail Bypass Blocks, + * [Success Criteria + * 2.4.1](https://www.w3.org/WAI/WCAG22/Understanding/bypass-blocks.html). + * Since this component appears on every page, the application will not be + * considered conformant.

_For details about the addon + * behavior and functionality, refer to the [official + * documentation](https://github.com/ember-a11y/ember-a11y-refocus#readme)._ + * @defaultValue true + */ + hasA11yRefocus?: boolean; + + /** + * Pass-through property for the `skipTo` argument - The element ID that + * should receive focus on skip. The default value matches the default id + * value on the [`AppFrame::Main` component](/layouts/app-frame#afmain). + * + * @defaultValue '#hds-main' + * @dependsOn hasA11yRefocus + */ + a11yRefocusSkipTo?: string; + + /** + * Pass-through property for the `skipText` argument - The text passed in + * the skip link. + * + * @defaultValue 'Skip to main content' + * @dependsOn hasA11yRefocus + */ + a11yRefocusSkipText?: string; + + /** + * Pass-through property for the `navigationText` argument - The text passed + * in the navigation narrator. + * + * @defaultValue 'The page navigation is complete. You may now navigate the page content as you wish.' + * @dependsOn hasA11yRefocus + */ + a11yRefocusNavigationText?: string; + + /** + * Pass-through property for the `routeChangeValidator` argument - Custom + * function used to define which route changes should trigger the refocusing + * behavior for the navigator narrator. + * + * @remarks + * For details see [Customizing the definition of a route + * change](https://github.com/ember-a11y/ember-a11y-refocus#customizing-the-definition-of-a-route-change). + * @dependsOn hasA11yRefocus + */ + a11yRefocusRouteChangeValidator?: NavigationNarratorSignature['Args']['routeChangeValidator']; + + /** + * Pass-through property for the `excludeAllQueryParams` argument - Can be + * used when you need to completely opt out of all transition focus + * management for all query params. + * + * @remarks + * Use with caution; you'll typically want to reach for a custom route + * change validator function instead. + * @defaultValue false + * @dependsOn hasA11yRefocus + */ + a11yRefocusExcludeAllQueryParams?: boolean; + }; + + Blocks: { + /** + * A named block where the main product logo linked to your app’s home page + * is rendered. The `AppHeader::HomeLink` component should be added here. + */ + logo?: [ + { + close: () => void; + }, + ]; + /** + * A named block where the global actions will be rendered. Typically, a + * “context switcher” (e.g., “org switcher” or “project switcher”) control + * should be added here. + */ + globalActions?: [ + { + close: () => void; + }, + ]; + /** + * A named block where the utility actions will be rendered. Typically, + * `Dropdown` or `Button` components should be added here, such as a help + * menu, user menu, or search button. + */ + utilityActions?: [ + { + close: () => void; + }, + ]; + }; + + /** @splattributes */ + Element: HTMLDivElement; +} diff --git a/packages/components/src/components/hds/dropdown/index.gts b/packages/components/src/components/hds/dropdown/index.gts index b4e2c464472..7530768c3b7 100644 --- a/packages/components/src/components/hds/dropdown/index.gts +++ b/packages/components/src/components/hds/dropdown/index.gts @@ -11,8 +11,6 @@ import style from 'ember-style-modifier'; // eslint-disable-next-line ember/no-at-ember-render-modifiers import didInsert from '@ember/render-modifiers/modifiers/did-insert'; -import type { WithBoundArgs } from '@glint/template'; - import { HdsDropdownPositionToPlacementValues, HdsDropdownPositionValues, @@ -32,8 +30,8 @@ import HdsDropdownListItemSeparator from './list-item/separator.gts'; import HdsDropdownListItemTitle from './list-item/title.gts'; import HdsDropdownFooter from './footer.gts'; -import type { HdsPopoverPrimitiveSignature } from '../popover-primitive/index.gts'; import type { HdsDropdownPositions } from './types.ts'; +import type { HdsDropdownSignature } from './index.types'; import type { HdsAnchoredPositionOptions } from '../../../modifiers/hds-anchored-position.ts'; export const DEFAULT_POSITION = HdsDropdownPositionValues.BottomRight; @@ -41,49 +39,6 @@ export const POSITIONS: HdsDropdownPositions[] = Object.values( HdsDropdownPositionValues ); -export interface HdsDropdownSignature { - Args: { - height?: string; - isInline?: boolean; - isOpen?: HdsPopoverPrimitiveSignature['Args']['isOpen']; - listPosition?: HdsDropdownPositions; - width?: string; - enableCollisionDetection?: HdsAnchoredPositionOptions['enableCollisionDetection']; - preserveContentInDom?: boolean; - matchToggleWidth?: boolean; - onClose?: HdsPopoverPrimitiveSignature['Args']['onClose']; - onFocusOut?: HdsPopoverPrimitiveSignature['Args']['onFocusOut']; - boundary?: HdsAnchoredPositionOptions['boundary']; - }; - Blocks: { - default: [ - { - Footer?: typeof HdsDropdownFooter; - Header?: typeof HdsDropdownHeader; - Checkbox?: typeof HdsDropdownListItemCheckbox; - Checkmark?: typeof HdsDropdownListItemCheckmark; - CopyItem?: typeof HdsDropdownListItemCopyItem; - Description?: typeof HdsDropdownListItemDescription; - Generic?: typeof HdsDropdownListItemGeneric; - Interactive?: typeof HdsDropdownListItemInteractive; - Radio?: typeof HdsDropdownListItemRadio; - Separator?: typeof HdsDropdownListItemSeparator; - Title?: typeof HdsDropdownListItemTitle; - ToggleButton?: WithBoundArgs< - typeof HdsDropdownToggleButton, - 'isOpen' | 'setupPrimitiveToggle' - >; - ToggleIcon?: WithBoundArgs< - typeof HdsDropdownToggleIcon, - 'isOpen' | 'setupPrimitiveToggle' - >; - close: (event?: Event) => void; - }, - ]; - }; - Element: HTMLDivElement; -} - export default class HdsDropdown extends Component { get listPosition(): HdsDropdownPositions { const { listPosition = DEFAULT_POSITION } = this.args; diff --git a/packages/components/src/components/hds/dropdown/index.types.ts b/packages/components/src/components/hds/dropdown/index.types.ts new file mode 100644 index 00000000000..dd8dddd3c33 --- /dev/null +++ b/packages/components/src/components/hds/dropdown/index.types.ts @@ -0,0 +1,170 @@ +import HdsDropdownFooter from './footer.gts'; +import HdsDropdownHeader from './header.gts'; +import HdsDropdownListItemCheckbox from './list-item/checkbox.gts'; +import HdsDropdownListItemCheckmark from './list-item/checkmark.gts'; +import HdsDropdownListItemCopyItem from './list-item/copy-item.gts'; +import HdsDropdownListItemDescription from './list-item/description.gts'; +import HdsDropdownListItemGeneric from './list-item/generic.gts'; +import HdsDropdownListItemInteractive from './list-item/interactive.gts'; +import HdsDropdownListItemRadio from './list-item/radio.gts'; +import HdsDropdownListItemSeparator from './list-item/separator.gts'; +import HdsDropdownListItemTitle from './list-item/title.gts'; +import HdsDropdownToggleButton from './toggle/button.gts'; +import HdsDropdownToggleIcon from './toggle/icon.gts'; + +import type { WithBoundArgs } from '@glint/template'; +import type { HdsDropdownPositions } from './types.ts'; +import type { HdsPopoverPrimitiveSignature } from '../popover-primitive/index.gts'; +import type { HdsAnchoredPositionOptions } from '../../../modifiers/hds-anchored-position.ts'; + +export interface HdsDropdownSignature { + Args: { + /** + * Provides an option to specify a parent or ancestor container element to + * act as the boundary for collision detection vs. the browser window + * boundaries which is the default. The value provided must be either a + * `Boundary` type as specified in the [Floating UI library + * documentation](https://floating-ui.com/docs/detectoverflow#options) or an + * id string for the boundary container element. + * + * @remarks + * Must be used in conjunction with setting `enableCollisionDetection` to + * `true`. + * @dependsOn enableCollisionDetection + */ + boundary?: HdsAnchoredPositionOptions['boundary']; + + /** + * If a `@height` parameter is provided then the list will have a + * max-height. + */ + height?: string; + + /** + * If an `@isInline` parameter is provided, then the element will be + * displayed as `inline-block` (useful to achieve specific layouts like in a + * container with right alignment). Otherwise, it will have a `block` + * layout. + * + * @defaultValue false + */ + isInline?: boolean; + + /** + * Controls if the list should be rendered initially opened. + * + * @defaultValue false + */ + isOpen?: HdsPopoverPrimitiveSignature['Args']['isOpen']; + + /** + * Controls where the dropdown list is positioned relative to the toggle + * button. + * + * @remarks + * _Note: If `@enableCollisionDetection` is set, the list will automatically + * flip position to remain visible when near the edges of the screen + * regardless of the starting placement._ + * @defaultValue 'bottom-right' + */ + listPosition?: HdsDropdownPositions; + + /** + * By default, the Dropdown List has a `min-width` of `200px` and a + * `max-width` of `400px`, so it adapts to the content size. If a `@width` + * parameter is provided then the list will have a fixed width. + * + * @remarks + * We discourage the use of percentage values for this argument. The + * Dropdown list is [a `popover` + * element](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/popover), + * so relative units use `document` as a reference (not the parent + * element), meaning percentage values act similar to `vw`. If + * `@matchToggleWidth` is set, `@width` is overridden. + * @valueNote any valid CSS width (px, rem, etc) + */ + width?: string; + + /** + * Setting it to `true` will automatically flip the list position to remain + * visible when near the edges of the viewport. + * + * @defaultValue false + */ + enableCollisionDetection?: HdsAnchoredPositionOptions['enableCollisionDetection']; + + /** + * Controls if the content is always rendered in the DOM, even when the + * dropdown is closed. + * + * @defaultValue false + */ + preserveContentInDom?: boolean; + + /** + * Sets the Dropdown List’s width to match the width of the Toggle. It + * overrides the `@width` value if set. + * + * @defaultValue false + */ + matchToggleWidth?: boolean; + + /** Callback function invoked when the dropdown is closed (if provided). */ + onClose?: HdsPopoverPrimitiveSignature['Args']['onClose']; + + /** + * A callback function invoked when the dropdown menu loses focus, and focus + * does not move to another element (if provided). + * + * @remarks + * _Notice: Focus can be lost if content inside the dropdown is removed + * dynamically. This callback should be used to set focus to another + * element if this occurs. Without this callback the dropdown will close + * automatically when focus is lost._ + */ + onFocusOut?: HdsPopoverPrimitiveSignature['Args']['onFocusOut']; + }; + Blocks: { + default: [ + { + Footer?: typeof HdsDropdownFooter; + Header?: typeof HdsDropdownHeader; + Checkbox?: typeof HdsDropdownListItemCheckbox; + Checkmark?: typeof HdsDropdownListItemCheckmark; + CopyItem?: typeof HdsDropdownListItemCopyItem; + Description?: typeof HdsDropdownListItemDescription; + Generic?: typeof HdsDropdownListItemGeneric; + Interactive?: typeof HdsDropdownListItemInteractive; + Radio?: typeof HdsDropdownListItemRadio; + Separator?: typeof HdsDropdownListItemSeparator; + Title?: typeof HdsDropdownListItemTitle; + ToggleButton?: WithBoundArgs< + typeof HdsDropdownToggleButton, + 'isOpen' | 'setupPrimitiveToggle' + >; + ToggleIcon?: WithBoundArgs< + typeof HdsDropdownToggleIcon, + 'isOpen' | 'setupPrimitiveToggle' + >; + + /** + * Function to programmatically close the Dropdown yielded to the + * content. + * + * @remarks + * If this function is invoked using an `{{on "click"}}` modifier + * applied to the `ListItem::Interactive` element, there is a quirky + * behavior of the Ember `` component which requires a + * workaround to have the events executed in the right order (this + * happens only if it has a `@route` argument). Read more about the + * issue and a possible solution [in this GitHub + * comment](https://github.com/hashicorp/design-system/pull/399#issuecomment-1171186772). + */ + close: (event?: Event) => void; + }, + ]; + }; + + /** @splattributes */ + Element: HTMLDivElement; +} diff --git a/packages/components/src/components/hds/filter-bar/actions-dropdown.gts b/packages/components/src/components/hds/filter-bar/actions-dropdown.gts index 4f11e3fd791..e56e1d03156 100644 --- a/packages/components/src/components/hds/filter-bar/actions-dropdown.gts +++ b/packages/components/src/components/hds/filter-bar/actions-dropdown.gts @@ -8,7 +8,7 @@ import { service } from '@ember/service'; import HdsDropdown from '../dropdown/index.gts'; -import type { HdsDropdownSignature } from '../dropdown/index.gts'; +import type { HdsDropdownSignature } from '../dropdown/index.types.ts'; import type { HdsDropdownToggleButtonSignature } from '../dropdown/toggle/button.gts'; import type HdsIntlService from '../../../services/hds-intl.ts'; diff --git a/packages/components/src/components/hds/filter-bar/filters-dropdown.gts b/packages/components/src/components/hds/filter-bar/filters-dropdown.gts index 3dc2185ed39..6a28d86e314 100644 --- a/packages/components/src/components/hds/filter-bar/filters-dropdown.gts +++ b/packages/components/src/components/hds/filter-bar/filters-dropdown.gts @@ -20,7 +20,7 @@ import HdsButtonSet from '../button-set/index.gts'; import HdsButton from '../button/index.gts'; import type { HdsFilterBarFilters, HdsFilterBarFilter } from './types.ts'; -import type { HdsDropdownSignature } from '../dropdown/index.gts'; +import type { HdsDropdownSignature } from '../dropdown/index.types.ts'; export const DEFAULT_DROPDOWN_HEIGHT = '600px'; diff --git a/packages/components/src/components/hds/toast/index.gts b/packages/components/src/components/hds/toast/index.gts index ee2aac16bd3..1674d2aa7c9 100644 --- a/packages/components/src/components/hds/toast/index.gts +++ b/packages/components/src/components/hds/toast/index.gts @@ -8,7 +8,7 @@ import { hash } from '@ember/helper'; import HdsAlert from '../alert/index.gts'; -import type { HdsAlertSignature } from '../alert/index.gts'; +import type { HdsAlertSignature } from '../alert/index.types.ts'; export interface HdsToastSignature extends Omit { Args: Omit; diff --git a/packages/components/tsdoc.json b/packages/components/tsdoc.json new file mode 100644 index 00000000000..36ece88024e --- /dev/null +++ b/packages/components/tsdoc.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", + "tagDefinitions": [ + { + "tagName": "@dependsOn", + "syntaxKind": "block" + }, + { + "tagName": "@splattributes", + "syntaxKind": "block" + }, + { + "tagName": "@valueNote", + "syntaxKind": "block" + } + ], + "supportForTags": { + "@dependsOn": true, + "@splattributes": true, + "@valueNote": true + } +} diff --git a/packages/mcp/src/catalogs/components/catalog.json b/packages/mcp/src/catalogs/components/catalog.json new file mode 100644 index 00000000000..71b4909db45 --- /dev/null +++ b/packages/mcp/src/catalogs/components/catalog.json @@ -0,0 +1,9697 @@ +{ + "updatedAt": "2026-06-22T20:46:02.961Z", + "components": [ + { + "name": "HdsAccordion", + "sourcePath": "./components/hds/accordion/index.gts", + "summary": "The `Accordion` component serves as a wrapper to group one or more `Accordion::Item` components.", + "args": [ + { + "name": "forceState", + "type": "'open' | 'close'", + "required": false, + "summary": "Controls the state of all items within a group. Can be used to expand or collapse all items at once." + }, + { + "name": "size", + "type": "'small' | 'medium' | 'large'", + "required": false, + "summary": "Size of the accordion.", + "default": "medium" + }, + { + "name": "titleTag", + "type": "'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'", + "required": false, + "summary": "The HTML tag that wraps the content of each Accordion Item \"toggle\" block.", + "default": "div" + }, + { + "name": "type", + "type": "'card' | 'flush'", + "required": false, + "summary": "Type of the accordion.", + "default": "card" + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Item", + "type": "WithBoundArgs< typeof HdsAccordionItem, 'titleTag' | 'size' | 'type' | 'forceState' >", + "kind": "component", + "componentName": "HdsAccordionItem", + "sourcePath": "./item/index.gts", + "boundArgs": [ + "titleTag", + "size", + "type", + "forceState" + ], + "summary": "The `Accordion::Item` component, yielded as contextual component." + } + ] + } + ], + "docSourcePath": "website/docs/components/accordion/partials/code/component-api.md", + "docEnrichedAt": "2026-06-22T20:46:01.410Z" + }, + { + "name": "HdsAccordionItem", + "sourcePath": "./components/hds/accordion/item/index.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaLabel", + "type": "string", + "required": false + }, + { + "name": "containsInteractive", + "type": "boolean", + "required": false + }, + { + "name": "forceState", + "type": "'open' | 'close'", + "required": false + }, + { + "name": "isOpen", + "type": "boolean", + "required": false + }, + { + "name": "isStatic", + "type": "boolean", + "required": false + }, + { + "name": "onClickToggle", + "type": "(event: MouseEvent, ...args: any[]) => void", + "required": false + }, + { + "name": "size", + "type": "'small' | 'medium' | 'large'", + "required": false + }, + { + "name": "titleTag", + "type": "'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'", + "required": false + }, + { + "name": "type", + "type": "'card' | 'flush'", + "required": false + } + ], + "blocks": [ + { + "name": "content", + "yields": [ + { + "name": "close", + "type": "(...args: any[]) => void", + "kind": "function" + } + ] + }, + { + "name": "toggle" + } + ] + }, + { + "name": "HdsAdvancedTable", + "sourcePath": "./components/hds/advanced-table/index.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'center' | 'left' | 'right'", + "required": false + }, + { + "name": "caption", + "type": "string", + "required": false + }, + { + "name": "childrenKey", + "type": "string", + "required": false + }, + { + "name": "columnOrder", + "type": "string[]", + "required": false + }, + { + "name": "columns", + "type": "HdsAdvancedTableColumn[]", + "required": true + }, + { + "name": "density", + "type": "'default' | 'medium' | 'short' | 'tall'", + "required": false + }, + { + "name": "hasReorderableColumns", + "type": "boolean", + "required": false + }, + { + "name": "hasResizableColumns", + "type": "boolean", + "required": false + }, + { + "name": "hasStickyFirstColumn", + "type": "boolean", + "required": false + }, + { + "name": "hasStickyHeader", + "type": "boolean", + "required": false + }, + { + "name": "identityKey", + "type": "string", + "required": false + }, + { + "name": "isSelectable", + "type": "boolean", + "required": false + }, + { + "name": "isStriped", + "type": "boolean", + "required": false + }, + { + "name": "maxHeight", + "type": "string", + "required": false + }, + { + "name": "model", + "type": "T[]", + "required": true + }, + { + "name": "onColumnReorder", + "type": "HdsAdvancedTableColumnReorderCallback", + "required": false + }, + { + "name": "onColumnResize", + "type": "(columnKey: string, newWidth?: string) => void", + "required": false + }, + { + "name": "onSelectionChange", + "type": "( selection: HdsAdvancedTableOnSelectionChangeSignature ) => void", + "required": false + }, + { + "name": "onSort", + "type": "(sortBy: string, sortOrder: HdsAdvancedTableThSortOrder) => void", + "required": false + }, + { + "name": "reorderedMessageText", + "type": "string", + "required": false + }, + { + "name": "selectableColumnKey", + "type": "string", + "required": false + }, + { + "name": "selectionAriaLabelSuffix", + "type": "string", + "required": false + }, + { + "name": "sortBy", + "type": "string", + "required": false + }, + { + "name": "sortedMessageText", + "type": "string", + "required": false + }, + { + "name": "sortOrder", + "type": "'asc' | 'desc'", + "required": false + }, + { + "name": "valign", + "type": "'baseline' | 'middle' | 'top'", + "required": false + } + ], + "blocks": [ + { + "name": "actions", + "yields": [ + { + "name": "FilterBar", + "type": "ComponentLike", + "kind": "value" + } + ] + }, + { + "name": "body", + "yields": [ + { + "name": "data", + "type": "T", + "kind": "value" + }, + { + "name": "isOpen", + "type": "HdsAdvancedTableExpandState", + "kind": "value" + }, + { + "name": "rowIndex", + "type": "number | string", + "kind": "value" + }, + { + "name": "Td", + "type": "WithBoundArgs< typeof HdsAdvancedTableTd, 'align' | 'compositeItem' | 'isCompositeItemDisabled' >", + "kind": "component", + "componentName": "HdsAdvancedTableTd", + "sourcePath": "./td.gts", + "boundArgs": [ + "align", + "compositeItem", + "isCompositeItemDisabled" + ] + }, + { + "name": "Th", + "type": "WithBoundArgs< typeof HdsAdvancedTableTh, | 'compositeItem' | 'isCompositeItemDisabled' | 'depth' | 'isExpandable' | 'isExpanded' | 'isStickyColumnPinned' | 'newLabel' | 'onClickToggle' | 'parentId' | 'scope' >", + "kind": "component", + "componentName": "HdsAdvancedTableTh", + "sourcePath": "./th.gts", + "boundArgs": [ + "compositeItem", + "isCompositeItemDisabled", + "depth", + "isExpandable", + "isExpanded", + "isStickyColumnPinned", + "newLabel", + "onClickToggle", + "parentId", + "scope" + ] + }, + { + "name": "Tr", + "type": "ComponentLike>", + "kind": "value" + } + ] + }, + { + "name": "emptyState" + } + ] + }, + { + "name": "HdsAdvancedTableTd", + "sourcePath": "./components/hds/advanced-table/td.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'center' | 'left' | 'right'", + "required": false + }, + { + "name": "colspan", + "type": "number", + "required": false + }, + { + "name": "compositeItem", + "type": "HdsCompositeSignature['Blocks']['default'][0]['item']", + "required": false + }, + { + "name": "isCompositeItemDisabled", + "type": "boolean", + "required": false + }, + { + "name": "rowspan", + "type": "number", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAdvancedTableTh", + "sourcePath": "./components/hds/advanced-table/th.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'center' | 'left' | 'right'", + "required": false + }, + { + "name": "colspan", + "type": "number", + "required": false + }, + { + "name": "column", + "type": "HdsAdvancedTableNormalizedColumn", + "required": false + }, + { + "name": "compositeItem", + "type": "HdsCompositeSignature['Blocks']['default'][0]['item']", + "required": false + }, + { + "name": "depth", + "type": "number", + "required": false + }, + { + "name": "didInsertExpandButton", + "type": "(button: HTMLButtonElement) => void", + "required": false + }, + { + "name": "draggedColumnKey", + "type": "HdsAdvancedTableNormalizedColumn['key'] | null", + "required": false + }, + { + "name": "draggedColumnSiblingColumnKeys", + "type": "{ previous?: HdsAdvancedTableNormalizedColumn['key']; next?: HdsAdvancedTableNormalizedColumn['key']; }", + "required": false + }, + { + "name": "firstColumnKey", + "type": "HdsAdvancedTableNormalizedColumn['key']", + "required": false + }, + { + "name": "firstNonStickyColumnKey", + "type": "HdsAdvancedTableNormalizedColumn['key']", + "required": false + }, + { + "name": "hasExpandAllButton", + "type": "boolean", + "required": false + }, + { + "name": "hasReorderableColumns", + "type": "HdsAdvancedTableSignature['Args']['hasReorderableColumns']", + "required": false + }, + { + "name": "hasResizableColumns", + "type": "HdsAdvancedTableSignature['Args']['hasResizableColumns']", + "required": false + }, + { + "name": "hasSelectableRows", + "type": "HdsAdvancedTableSignature['Args']['isSelectable']", + "required": false + }, + { + "name": "hasStickyFirstColumn", + "type": "HdsAdvancedTableSignature['Args']['hasStickyFirstColumn']", + "required": false + }, + { + "name": "isCompositeItemDisabled", + "type": "boolean", + "required": false + }, + { + "name": "isExpandable", + "type": "boolean", + "required": false + }, + { + "name": "isExpanded", + "type": "HdsAdvancedTableExpandState", + "required": false + }, + { + "name": "isStickyColumn", + "type": "boolean", + "required": false + }, + { + "name": "isStickyColumnPinned", + "type": "boolean", + "required": false + }, + { + "name": "lastColumnKey", + "type": "HdsAdvancedTableNormalizedColumn['key']", + "required": false + }, + { + "name": "newLabel", + "type": "string", + "required": false + }, + { + "name": "onApplyTransientWidth", + "type": "( columnKey: HdsAdvancedTableNormalizedColumn['key'] ) => void", + "required": false + }, + { + "name": "onClickSort", + "type": "HdsAdvancedTableThButtonSortSignature['Args']['onClick']", + "required": false + }, + { + "name": "onClickToggle", + "type": "() => void", + "required": false + }, + { + "name": "onColumnResize", + "type": "HdsAdvancedTableSignature['Args']['onColumnResize']", + "required": false + }, + { + "name": "onGetAppliedWidth", + "type": "( columnKey: HdsAdvancedTableNormalizedColumn['key'] ) => HdsAdvancedTableNormalizedColumn['width']", + "required": false + }, + { + "name": "onGetColumnByKey", + "type": "( columnKey: HdsAdvancedTableNormalizedColumn['key'] ) => HdsAdvancedTableNormalizedColumn | undefined", + "required": false + }, + { + "name": "onMoveColumnToTerminalPosition", + "type": "( columnKey: HdsAdvancedTableNormalizedColumn['key'], position: 'start' | 'end' ) => void", + "required": false + }, + { + "name": "onPinFirstColumn", + "type": "() => void", + "required": false + }, + { + "name": "onReorderDrop", + "type": "( columnKey: HdsAdvancedTableNormalizedColumn['key'], side: HdsAdvancedTableColumnReorderSide ) => void", + "required": false + }, + { + "name": "onResetTransientColumnWidths", + "type": "() => void", + "required": false + }, + { + "name": "onRestoreColumnWidth", + "type": "( columnKey: HdsAdvancedTableNormalizedColumn['key'] ) => void", + "required": false + }, + { + "name": "onSetDraggedColumnKey", + "type": "( key: HdsAdvancedTableNormalizedColumn['key'] | null ) => void", + "required": false + }, + { + "name": "onSetReorderHoveredColumnKey", + "type": "( key: HdsAdvancedTableNormalizedColumn['key'] | null ) => void", + "required": false + }, + { + "name": "onSetTransientColumnWidth", + "type": "( columnKey: HdsAdvancedTableNormalizedColumn['key'], width: `${number}px` ) => void", + "required": false + }, + { + "name": "onSetTransientColumnWidths", + "type": "(options: { roundValues?: boolean }) => void", + "required": false + }, + { + "name": "onStepColumn", + "type": "( columnKey: HdsAdvancedTableNormalizedColumn['key'], step: number ) => void", + "required": false + }, + { + "name": "onUpdateResizeDebt", + "type": "( columnKey: HdsAdvancedTableNormalizedColumn['key'], delta: number ) => void", + "required": false + }, + { + "name": "parentId", + "type": "string", + "required": false + }, + { + "name": "reorderHoveredColumnKey", + "type": "HdsAdvancedTableNormalizedColumn['key'] | null", + "required": false + }, + { + "name": "rowspan", + "type": "number", + "required": false + }, + { + "name": "scope", + "type": "'col' | 'row'", + "required": false + }, + { + "name": "siblingColumnKeys", + "type": "{ previous?: HdsAdvancedTableNormalizedColumn['key']; next?: HdsAdvancedTableNormalizedColumn['key']; }", + "required": false + }, + { + "name": "sortOrder", + "type": "'asc' | 'desc'", + "required": false + }, + { + "name": "tableHeight", + "type": "number", + "required": false + }, + { + "name": "tooltip", + "type": "string", + "required": false + }, + { + "name": "willDestroyExpandButton", + "type": "(button: HTMLButtonElement) => void", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAdvancedTableThButtonExpand", + "sourcePath": "./components/hds/advanced-table/th-button-expand.gts", + "summary": "TODO", + "args": [ + { + "name": "isExpandAll", + "type": "boolean", + "required": false + }, + { + "name": "isExpanded", + "type": "HdsAdvancedTableExpandState", + "required": false + }, + { + "name": "labelId", + "type": "string", + "required": false + }, + { + "name": "onToggle", + "type": "() => void", + "required": false + } + ] + }, + { + "name": "HdsAdvancedTableThButtonSort", + "sourcePath": "./components/hds/advanced-table/th-button-sort.gts", + "summary": "TODO", + "args": [ + { + "name": "labelId", + "type": "string", + "required": false + }, + { + "name": "onClick", + "type": "() => void", + "required": false + }, + { + "name": "sortOrder", + "type": "'asc' | 'desc'", + "required": false + } + ] + }, + { + "name": "HdsAdvancedTableThButtonTooltip", + "sourcePath": "./components/hds/advanced-table/th-button-tooltip.gts", + "summary": "TODO", + "args": [ + { + "name": "labelId", + "type": "string", + "required": false + }, + { + "name": "tooltip", + "type": "string", + "required": true + } + ] + }, + { + "name": "HdsAdvancedTableThSelectable", + "sourcePath": "./components/hds/advanced-table/th-selectable.gts", + "summary": "TODO", + "args": [ + { + "name": "compositeItem", + "type": "HdsCompositeSignature['Blocks']['default'][0]['item']", + "required": false + }, + { + "name": "didInsert", + "type": "( checkbox: HdsFormCheckboxBaseSignature['Element'], selectionKey?: string ) => void", + "required": false + }, + { + "name": "isCompositeItemDisabled", + "type": "boolean", + "required": false + }, + { + "name": "isSelected", + "type": "boolean", + "required": false + }, + { + "name": "isStickyColumn", + "type": "boolean", + "required": false + }, + { + "name": "isStickyColumnPinned", + "type": "boolean", + "required": false + }, + { + "name": "onClickSortBySelected", + "type": "() => void", + "required": false + }, + { + "name": "onSelectionChange", + "type": "( target: HdsFormCheckboxBaseSignature['Element'], selectionKey: string | undefined ) => void", + "required": false + }, + { + "name": "selectionAriaLabelSuffix", + "type": "string", + "required": false + }, + { + "name": "selectionKey", + "type": "string", + "required": false + }, + { + "name": "selectionScope", + "type": "'col' | 'row'", + "required": false + }, + { + "name": "sortBySelectedOrder", + "type": "'asc' | 'desc'", + "required": false + }, + { + "name": "willDestroy", + "type": "(selectionKey?: string) => void", + "required": false + } + ] + }, + { + "name": "HdsAdvancedTableTr", + "sourcePath": "./components/hds/advanced-table/tr.gts", + "summary": "TODO", + "args": [ + { + "name": "columnOrder", + "type": "HdsAdvancedTableSignature['Args']['columnOrder']", + "required": false + }, + { + "name": "compositeGroup", + "type": "HdsCompositeDefaultBlock['group']", + "required": false + }, + { + "name": "compositeItem", + "type": "HdsCompositeDefaultBlock['item']", + "required": false + }, + { + "name": "data", + "type": "T", + "required": false + }, + { + "name": "depth", + "type": "number", + "required": false + }, + { + "name": "didInsert", + "type": "( checkbox: HdsFormCheckboxBaseSignature['Element'], selectionKey?: string ) => void", + "required": false + }, + { + "name": "displayRow", + "type": "boolean", + "required": false + }, + { + "name": "hasReorderableColumns", + "type": "HdsAdvancedTableSignature['Args']['hasReorderableColumns']", + "required": false + }, + { + "name": "hasStickyColumn", + "type": "boolean", + "required": false + }, + { + "name": "isCompositeItemDisabled", + "type": "boolean", + "required": false + }, + { + "name": "isLastRow", + "type": "boolean", + "required": false + }, + { + "name": "isParentRow", + "type": "boolean", + "required": false + }, + { + "name": "isSelectable", + "type": "boolean", + "required": false + }, + { + "name": "isSelected", + "type": "boolean", + "required": false + }, + { + "name": "isStickyColumnPinned", + "type": "boolean", + "required": false + }, + { + "name": "onClickSortBySelected", + "type": "HdsAdvancedTableThSelectableSignature['Args']['onClickSortBySelected']", + "required": false + }, + { + "name": "onSelectionChange", + "type": "( checkbox?: HdsFormCheckboxBaseSignature['Element'], selectionKey?: string ) => void", + "required": false + }, + { + "name": "selectableColumnKey", + "type": "HdsAdvancedTableSignature['Args']['selectableColumnKey']", + "required": false + }, + { + "name": "selectionAriaLabelSuffix", + "type": "string", + "required": false + }, + { + "name": "selectionKey", + "type": "string", + "required": false + }, + { + "name": "selectionScope", + "type": "'col' | 'row'", + "required": false + }, + { + "name": "sortBySelectedOrder", + "type": "'asc' | 'desc'", + "required": false + }, + { + "name": "willDestroy", + "type": "() => void", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "orderedCells", + "type": "HdsAdvancedTableCell[]", + "kind": "value" + } + ] + } + ] + }, + { + "name": "HdsAlert", + "sourcePath": "./components/hds/alert/index.gts", + "summary": "TODO", + "args": [ + { + "name": "color", + "type": "'neutral' | 'highlight' | 'success' | 'warning' | 'critical'", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name'] | false", + "required": false + }, + { + "name": "onDismiss", + "type": "(event: MouseEvent, ...args: unknown[]) => void", + "required": false + }, + { + "name": "type", + "type": "'page' | 'inline' | 'compact'", + "required": true + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Button", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsButton", + "sourcePath": "../button/index.gts", + "boundArgs": [ + "size" + ] + }, + { + "name": "Description", + "type": "typeof HdsAlertDescription", + "kind": "component", + "componentName": "HdsAlertDescription", + "sourcePath": "./description.gts" + }, + { + "name": "Generic", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../yield/index.gts" + }, + { + "name": "LinkStandalone", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsLinkStandalone", + "sourcePath": "../link/standalone.gts", + "boundArgs": [ + "size" + ] + }, + { + "name": "Title", + "type": "typeof HdsAlertTitle", + "kind": "component", + "componentName": "HdsAlertTitle", + "sourcePath": "./title.gts" + } + ] + } + ] + }, + { + "name": "HdsAlertDescription", + "sourcePath": "./components/hds/alert/description.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAlertTitle", + "sourcePath": "./components/hds/alert/title.gts", + "summary": "TODO", + "args": [ + { + "name": "tag", + "type": "'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAppFooter", + "sourcePath": "./components/hds/app-footer/index.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaLabel", + "type": "string", + "required": false + }, + { + "name": "copyrightYear", + "type": "string", + "required": false + }, + { + "name": "theme", + "type": "'light' | 'dark'", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "ExtraAfter", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../yield/index.gts" + }, + { + "name": "ExtraBefore", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../yield/index.gts" + }, + { + "name": "Item", + "type": "typeof HdsAppFooterItem", + "kind": "component", + "componentName": "HdsAppFooterItem", + "sourcePath": "./item.gts" + }, + { + "name": "LegalLinks", + "type": "typeof HdsAppFooterLegalLinks", + "kind": "component", + "componentName": "HdsAppFooterLegalLinks", + "sourcePath": "./legal-links.gts" + }, + { + "name": "Link", + "type": "typeof HdsAppFooterLink", + "kind": "component", + "componentName": "HdsAppFooterLink", + "sourcePath": "./link.gts" + }, + { + "name": "StatusLink", + "type": "typeof HdsAppFooterStatusLink", + "kind": "component", + "componentName": "HdsAppFooterStatusLink", + "sourcePath": "./status-link.gts" + } + ] + } + ] + }, + { + "name": "HdsAppFooterCopyright", + "sourcePath": "./components/hds/app-footer/copyright.gts", + "summary": "TODO", + "args": [ + { + "name": "year", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsAppFooterItem", + "sourcePath": "./components/hds/app-footer/item.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAppFooterLegalLinks", + "sourcePath": "./components/hds/app-footer/legal-links.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaLabel", + "type": "string", + "required": false + }, + { + "name": "hrefForAccessibility", + "type": "string", + "required": false + }, + { + "name": "hrefForPrivacy", + "type": "string", + "required": false + }, + { + "name": "hrefForSecurity", + "type": "string", + "required": false + }, + { + "name": "hrefForSupport", + "type": "string", + "required": false + }, + { + "name": "hrefForTerms", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsAppFooterLink", + "sourcePath": "./components/hds/app-footer/link.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string | boolean", + "required": false + }, + { + "name": "color", + "type": "'primary' | 'secondary'", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "iconPosition", + "type": "'leading' | 'trailing'", + "required": false + }, + { + "name": "isHrefExternal", + "type": "boolean", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "model", + "type": "unknown", + "required": false + }, + { + "name": "models", + "type": "unknown[]", + "required": false + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAppFooterStatusLink", + "sourcePath": "./components/hds/app-footer/status-link.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string | boolean", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "isHrefExternal", + "type": "boolean", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "itemStyle", + "type": "SafeString", + "required": false + }, + { + "name": "model", + "type": "unknown", + "required": false + }, + { + "name": "models", + "type": "unknown[]", + "required": false + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + }, + { + "name": "status", + "type": "'operational' | 'degraded' | 'maintenance' | 'outage'", + "required": false + }, + { + "name": "statusIcon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "statusIconColor", + "type": "string", + "required": false + }, + { + "name": "text", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsAppFrame", + "sourcePath": "./components/hds/app-frame/index.gts", + "summary": "TODO", + "args": [ + { + "name": "hasFooter", + "type": "boolean", + "required": false + }, + { + "name": "hasHeader", + "type": "boolean", + "required": false + }, + { + "name": "hasMain", + "type": "boolean", + "required": false + }, + { + "name": "hasModals", + "type": "boolean", + "required": false + }, + { + "name": "hasSidebar", + "type": "boolean", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Footer", + "type": "typeof HdsAppFrameFooter", + "kind": "component", + "componentName": "HdsAppFrameFooter", + "sourcePath": "./parts/footer.gts" + }, + { + "name": "Header", + "type": "typeof HdsAppFrameHeader", + "kind": "component", + "componentName": "HdsAppFrameHeader", + "sourcePath": "./parts/header.gts" + }, + { + "name": "Main", + "type": "typeof HdsAppFrameMain", + "kind": "component", + "componentName": "HdsAppFrameMain", + "sourcePath": "./parts/main.gts" + }, + { + "name": "Modals", + "type": "typeof HdsAppFrameModals", + "kind": "component", + "componentName": "HdsAppFrameModals", + "sourcePath": "./parts/modals.gts" + }, + { + "name": "Sidebar", + "type": "typeof HdsAppFrameSidebar", + "kind": "component", + "componentName": "HdsAppFrameSidebar", + "sourcePath": "./parts/sidebar.gts" + } + ] + } + ] + }, + { + "name": "HdsAppFrameFooter", + "sourcePath": "./components/hds/app-frame/parts/footer.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAppFrameHeader", + "sourcePath": "./components/hds/app-frame/parts/header.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAppFrameMain", + "sourcePath": "./components/hds/app-frame/parts/main.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAppFrameModals", + "sourcePath": "./components/hds/app-frame/parts/modals.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAppFrameSidebar", + "sourcePath": "./components/hds/app-frame/parts/sidebar.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAppHeader", + "sourcePath": "./components/hds/app-header/index.gts", + "summary": "TODO", + "args": [ + { + "name": "a11yRefocusExcludeAllQueryParams", + "type": "boolean", + "required": false + }, + { + "name": "a11yRefocusNavigationText", + "type": "string", + "required": false + }, + { + "name": "a11yRefocusRouteChangeValidator", + "type": "NavigationNarratorSignature['Args']['routeChangeValidator']", + "required": false + }, + { + "name": "a11yRefocusSkipText", + "type": "string", + "required": false + }, + { + "name": "a11yRefocusSkipTo", + "type": "string", + "required": false + }, + { + "name": "breakpoint", + "type": "string", + "required": false + }, + { + "name": "hasA11yRefocus", + "type": "boolean", + "required": false + } + ], + "blocks": [ + { + "name": "globalActions", + "yields": [ + { + "name": "close", + "type": "() => void", + "kind": "function" + } + ] + }, + { + "name": "logo", + "yields": [ + { + "name": "close", + "type": "() => void", + "kind": "function" + } + ] + }, + { + "name": "utilityActions", + "yields": [ + { + "name": "close", + "type": "() => void", + "kind": "function" + } + ] + } + ] + }, + { + "name": "HdsAppHeaderHomeLink", + "sourcePath": "./components/hds/app-header/home-link.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string | boolean", + "required": false + }, + { + "name": "color", + "type": "string", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": true + }, + { + "name": "isHrefExternal", + "type": "boolean", + "required": false + }, + { + "name": "isIconOnly", + "type": "boolean", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "model", + "type": "unknown", + "required": false + }, + { + "name": "models", + "type": "unknown[]", + "required": false + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + }, + { + "name": "text", + "type": "string", + "required": true + } + ] + }, + { + "name": "HdsAppHeaderMenuButton", + "sourcePath": "./components/hds/app-header/menu-button.gts", + "summary": "TODO", + "args": [ + { + "name": "isOpen", + "type": "boolean", + "required": false + }, + { + "name": "menuContentId", + "type": "string", + "required": true + }, + { + "name": "onClickToggle", + "type": "() => void", + "required": false + } + ] + }, + { + "name": "HdsApplicationState", + "sourcePath": "./components/hds/application-state/index.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'left' | 'center'", + "required": false + }, + { + "name": "isAutoCentered", + "type": "boolean", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Body", + "type": "typeof HdsApplicationStateBody", + "kind": "component", + "componentName": "HdsApplicationStateBody", + "sourcePath": "./body.gts" + }, + { + "name": "Footer", + "type": "typeof HdsApplicationStateFooter", + "kind": "component", + "componentName": "HdsApplicationStateFooter", + "sourcePath": "./footer.gts" + }, + { + "name": "Header", + "type": "typeof HdsApplicationStateHeader", + "kind": "component", + "componentName": "HdsApplicationStateHeader", + "sourcePath": "./header.gts" + }, + { + "name": "Media", + "type": "typeof HdsApplicationStateMedia", + "kind": "component", + "componentName": "HdsApplicationStateMedia", + "sourcePath": "./media.gts" + } + ] + } + ] + }, + { + "name": "HdsApplicationStateBody", + "sourcePath": "./components/hds/application-state/body.gts", + "summary": "TODO", + "args": [ + { + "name": "text", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsApplicationStateFooter", + "sourcePath": "./components/hds/application-state/footer.gts", + "summary": "TODO", + "args": [ + { + "name": "hasDivider", + "type": "boolean", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Button", + "type": "typeof HdsButton", + "kind": "component", + "componentName": "HdsButton", + "sourcePath": "../button/index.gts" + }, + { + "name": "Dropdown", + "type": "typeof HdsDropdown", + "kind": "component", + "componentName": "HdsDropdown", + "sourcePath": "../dropdown/index.gts" + }, + { + "name": "LinkStandalone", + "type": "typeof HdsLinkStandalone", + "kind": "component", + "componentName": "HdsLinkStandalone", + "sourcePath": "../link/standalone.gts" + } + ] + } + ] + }, + { + "name": "HdsApplicationStateHeader", + "sourcePath": "./components/hds/application-state/header.gts", + "summary": "TODO", + "args": [ + { + "name": "errorCode", + "type": "string", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "title", + "type": "string", + "required": false + }, + { + "name": "titleTag", + "type": "'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'", + "required": false + } + ] + }, + { + "name": "HdsApplicationStateMedia", + "sourcePath": "./components/hds/application-state/media.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAppSideNav", + "sourcePath": "./components/hds/app-side-nav/index.gts", + "summary": "TODO", + "args": [ + { + "name": "breakpoint", + "type": "string", + "required": false + }, + { + "name": "isCollapsible", + "type": "boolean", + "required": false + }, + { + "name": "isMinimized", + "type": "boolean", + "required": false + }, + { + "name": "isResponsive", + "type": "boolean", + "required": false + }, + { + "name": "onDesktopViewportChange", + "type": "(arg: boolean) => void", + "required": false + }, + { + "name": "onToggleMinimizedStatus", + "type": "(arg: boolean) => void", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAppSideNavList", + "sourcePath": "./components/hds/app-side-nav/list/index.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "BackLink", + "type": "typeof HdsAppSideNavListBackLink", + "kind": "component", + "componentName": "HdsAppSideNavListBackLink", + "sourcePath": "./back-link.gts" + }, + { + "name": "ExtraAfter", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../../yield/index.gts" + }, + { + "name": "ExtraBefore", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../../yield/index.gts" + }, + { + "name": "Item", + "type": "typeof HdsAppSideNavListItem", + "kind": "component", + "componentName": "HdsAppSideNavListItem", + "sourcePath": "./item.gts" + }, + { + "name": "Link", + "type": "typeof HdsAppSideNavListLink", + "kind": "component", + "componentName": "HdsAppSideNavListLink", + "sourcePath": "./link.gts" + }, + { + "name": "Title", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsAppSideNavListTitle", + "sourcePath": "./title.gts", + "boundArgs": [ + "didInsertTitle" + ] + } + ] + } + ] + }, + { + "name": "HdsAppSideNavListBackLink", + "sourcePath": "./components/hds/app-side-nav/list/back-link.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string | boolean", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "isHrefExternal", + "type": "boolean", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "model", + "type": "unknown", + "required": false + }, + { + "name": "models", + "type": "unknown[]", + "required": false + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + }, + { + "name": "text", + "type": "string", + "required": true + } + ] + }, + { + "name": "HdsAppSideNavListItem", + "sourcePath": "./components/hds/app-side-nav/list/item.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAppSideNavListLink", + "sourcePath": "./components/hds/app-side-nav/list/link.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string | boolean", + "required": false + }, + { + "name": "badge", + "type": "string", + "required": false + }, + { + "name": "count", + "type": "string", + "required": false + }, + { + "name": "hasSubItems", + "type": "boolean", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "isActive", + "type": "boolean", + "required": false + }, + { + "name": "isHrefExternal", + "type": "boolean", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "model", + "type": "unknown", + "required": false + }, + { + "name": "models", + "type": "unknown[]", + "required": false + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + }, + { + "name": "text", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAppSideNavListTitle", + "sourcePath": "./components/hds/app-side-nav/list/title.gts", + "summary": "TODO", + "args": [ + { + "name": "didInsertTitle", + "type": "(titleId: string) => void", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsAppSideNavPortal", + "sourcePath": "./components/hds/app-side-nav/portal/index.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaLabel", + "type": "string", + "required": false + }, + { + "name": "targetName", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "BackLink", + "type": "typeof HdsAppSideNavListBackLink", + "kind": "component", + "componentName": "HdsAppSideNavListBackLink", + "sourcePath": "./back-link.gts" + }, + { + "name": "ExtraAfter", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../../yield/index.gts" + }, + { + "name": "ExtraBefore", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../../yield/index.gts" + }, + { + "name": "Item", + "type": "typeof HdsAppSideNavListItem", + "kind": "component", + "componentName": "HdsAppSideNavListItem", + "sourcePath": "./item.gts" + }, + { + "name": "Link", + "type": "typeof HdsAppSideNavListLink", + "kind": "component", + "componentName": "HdsAppSideNavListLink", + "sourcePath": "./link.gts" + }, + { + "name": "Title", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsAppSideNavListTitle", + "sourcePath": "./title.gts", + "boundArgs": [ + "didInsertTitle" + ] + } + ] + } + ] + }, + { + "name": "HdsAppSideNavPortalTarget", + "sourcePath": "./components/hds/app-side-nav/portal/target.gts", + "summary": "TODO", + "args": [ + { + "name": "targetName", + "type": "HdsAppSideNavPortalSignature['Args']['targetName']", + "required": false + } + ] + }, + { + "name": "HdsAppSideNavToggleButton", + "sourcePath": "./components/hds/app-side-nav/toggle-button.gts", + "summary": "TODO", + "args": [ + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": true + } + ] + }, + { + "name": "HdsBadge", + "sourcePath": "./components/hds/badge/index.gts", + "summary": "TODO", + "args": [ + { + "name": "color", + "type": "'neutral' | 'neutral-dark-mode' | 'highlight' | 'success' | 'warning' | 'critical'", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "isIconOnly", + "type": "boolean", + "required": false + }, + { + "name": "size", + "type": "'small' | 'medium' | 'large'", + "required": false + }, + { + "name": "text", + "type": "string | number", + "required": true + }, + { + "name": "type", + "type": "'filled' | 'inverted' | 'outlined'", + "required": false + } + ] + }, + { + "name": "HdsBadgeCount", + "sourcePath": "./components/hds/badge-count/index.gts", + "summary": "TODO", + "args": [ + { + "name": "color", + "type": "'neutral' | 'neutral-dark-mode'", + "required": false + }, + { + "name": "size", + "type": "'small' | 'medium' | 'large'", + "required": false + }, + { + "name": "text", + "type": "string | number", + "required": true + }, + { + "name": "type", + "type": "'filled' | 'inverted' | 'outlined'", + "required": false + } + ] + }, + { + "name": "HdsBreadcrumb", + "sourcePath": "./components/hds/breadcrumb/index.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaLabel", + "type": "string", + "required": false + }, + { + "name": "didInsert", + "type": "() => void", + "required": false + }, + { + "name": "itemsCanWrap", + "type": "boolean", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsBreadcrumbItem", + "sourcePath": "./components/hds/breadcrumb/item.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string", + "required": false + }, + { + "name": "current", + "type": "boolean", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "maxWidth", + "type": "string", + "required": false + }, + { + "name": "model", + "type": "string | number", + "required": false + }, + { + "name": "models", + "type": "Array", + "required": false + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + }, + { + "name": "text", + "type": "string", + "required": true + } + ] + }, + { + "name": "HdsBreadcrumbTruncation", + "sourcePath": "./components/hds/breadcrumb/truncation.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaLabel", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsButton", + "sourcePath": "./components/hds/button/index.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string | boolean", + "required": false + }, + { + "name": "color", + "type": "'primary' | 'secondary' | 'tertiary' | 'critical'", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "iconPosition", + "type": "'leading' | 'trailing'", + "required": false + }, + { + "name": "isFullWidth", + "type": "boolean", + "required": false + }, + { + "name": "isHrefExternal", + "type": "boolean", + "required": false + }, + { + "name": "isIconOnly", + "type": "boolean", + "required": false + }, + { + "name": "isInline", + "type": "boolean", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "model", + "type": "unknown", + "required": false + }, + { + "name": "models", + "type": "unknown[]", + "required": false + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + }, + { + "name": "size", + "type": "'small' | 'medium' | 'large'", + "required": false + }, + { + "name": "text", + "type": "string", + "required": true + } + ] + }, + { + "name": "HdsButtonSet", + "sourcePath": "./components/hds/button-set/index.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsCardContainer", + "sourcePath": "./components/hds/card/container.gts", + "summary": "TODO", + "args": [ + { + "name": "background", + "type": "'neutral-primary' | 'neutral-secondary'", + "required": false + }, + { + "name": "hasBorder", + "type": "boolean", + "required": false + }, + { + "name": "level", + "type": "'base' | 'mid' | 'high'", + "required": false + }, + { + "name": "levelActive", + "type": "'base' | 'mid' | 'high'", + "required": false + }, + { + "name": "levelHover", + "type": "'base' | 'mid' | 'high'", + "required": false + }, + { + "name": "overflow", + "type": "'hidden' | 'visible'", + "required": false + }, + { + "name": "tag", + "type": "'div' | 'li'", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsCodeBlock", + "sourcePath": "./components/hds/code-block/index.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "ariaLabel", + "type": "string", + "required": false + }, + { + "name": "ariaLabelledBy", + "type": "string", + "required": false + }, + { + "name": "copyButtonText", + "type": "HdsCopyButtonSignature['Args']['text']", + "required": false + }, + { + "name": "copySuccessMessageText", + "type": "HdsCopyButtonSignature['Args']['ariaMessageText']", + "required": false + }, + { + "name": "hasCopyButton", + "type": "boolean", + "required": false + }, + { + "name": "hasLineNumbers", + "type": "boolean", + "required": false + }, + { + "name": "hasLineWrapping", + "type": "boolean", + "required": false + }, + { + "name": "highlightLines", + "type": "string", + "required": false + }, + { + "name": "isStandalone", + "type": "boolean", + "required": false + }, + { + "name": "language", + "type": "'bash' | 'go' | 'hcl' | 'json' | 'log' | 'ruby' | 'shell-session' | 'yaml'", + "required": false + }, + { + "name": "lineNumberStart", + "type": "number", + "required": false + }, + { + "name": "maxHeight", + "type": "string", + "required": false + }, + { + "name": "onCopy", + "type": "HdsCopyButtonSignature['Args']['onSuccess']", + "required": false + }, + { + "name": "value", + "type": "string", + "required": true + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Description", + "type": "WithBoundArgs< typeof HdsCodeBlockDescription, 'didInsertNode' >", + "kind": "component", + "componentName": "HdsCodeBlockDescription", + "sourcePath": "./description.gts", + "boundArgs": [ + "didInsertNode" + ] + }, + { + "name": "Title", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsCodeBlockTitle", + "sourcePath": "./title.gts", + "boundArgs": [ + "didInsertNode" + ] + } + ] + } + ] + }, + { + "name": "HdsCodeBlockCopyButton", + "sourcePath": "./components/hds/code-block/copy-button.gts", + "summary": "TODO", + "args": [ + { + "name": "copySuccessMessageText", + "type": "HdsCopyButtonSignature['Args']['ariaMessageText']", + "required": false + }, + { + "name": "onCopy", + "type": "HdsCopyButtonSignature['Args']['onSuccess']", + "required": false + }, + { + "name": "targetToCopy", + "type": "HdsCopyButtonSignature['Args']['targetToCopy']", + "required": false + }, + { + "name": "text", + "type": "HdsCopyButtonSignature['Args']['text']", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsCodeBlockDescription", + "sourcePath": "./components/hds/code-block/description.gts", + "summary": "TODO", + "args": [ + { + "name": "didInsertNode", + "type": "(element: HdsCodeBlockDescriptionElement) => void", + "required": true + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsCodeBlockTitle", + "sourcePath": "./components/hds/code-block/title.gts", + "summary": "TODO", + "args": [ + { + "name": "didInsertNode", + "type": "(element: HdsCodeBlockTitleElement) => void", + "required": true + }, + { + "name": "tag", + "type": "'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsCodeEditor", + "sourcePath": "./components/hds/code-editor/index.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "ariaLabel", + "type": "string", + "required": false + }, + { + "name": "ariaLabelledBy", + "type": "string", + "required": false + }, + { + "name": "copyButtonText", + "type": "HdsCopyButtonSignature['Args']['text']", + "required": false + }, + { + "name": "cspNonce", + "type": "string", + "required": false + }, + { + "name": "customExtensions", + "type": "Extension[]", + "required": false + }, + { + "name": "extraKeys", + "type": "HdsCodeEditorExtraKeys", + "required": false + }, + { + "name": "hasCopyButton", + "type": "boolean", + "required": false + }, + { + "name": "hasFullScreenButton", + "type": "boolean", + "required": false + }, + { + "name": "hasLineWrapping", + "type": "boolean", + "required": false + }, + { + "name": "isLintingEnabled", + "type": "boolean", + "required": false + }, + { + "name": "isStandalone", + "type": "boolean", + "required": false + }, + { + "name": "language", + "type": "'rego' | 'ruby' | 'shell' | 'go' | 'hcl' | 'javascript' | 'json' | 'markdown' | 'sentinel' | 'sql' | 'yaml'", + "required": false + }, + { + "name": "onBlur", + "type": "HdsCodeEditorBlurHandler", + "required": false + }, + { + "name": "onInput", + "type": "(newValue: string, editor: EditorViewType) => void", + "required": false + }, + { + "name": "onLint", + "type": "( diagnostics: DiagnosticType[], newValue: string, editor: EditorViewType ) => void", + "required": false + }, + { + "name": "onSetup", + "type": "(editor: EditorViewType) => unknown", + "required": false + }, + { + "name": "value", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Description", + "type": "WithBoundArgs< typeof HdsCodeEditorDescription, 'onInsert' | 'editorId' >", + "kind": "component", + "componentName": "HdsCodeEditorDescription", + "sourcePath": "./description.gts", + "boundArgs": [ + "onInsert", + "editorId" + ] + }, + { + "name": "Generic", + "type": "typeof HdsCodeEditorGeneric", + "kind": "component", + "componentName": "HdsCodeEditorGeneric", + "sourcePath": "./generic.gts" + }, + { + "name": "Title", + "type": "WithBoundArgs< typeof HdsCodeEditorTitle, 'onInsert' | 'editorId' >", + "kind": "component", + "componentName": "HdsCodeEditorTitle", + "sourcePath": "./title.gts", + "boundArgs": [ + "onInsert", + "editorId" + ] + } + ] + } + ] + }, + { + "name": "HdsCodeEditorDescription", + "sourcePath": "./components/hds/code-editor/description.gts", + "summary": "TODO", + "args": [ + { + "name": "editorId", + "type": "string", + "required": true + }, + { + "name": "onInsert", + "type": "(element: HdsCodeEditorDescriptionElement) => void", + "required": true + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsCodeEditorFullScreenButton", + "sourcePath": "./components/hds/code-editor/full-screen-button.gts", + "summary": "TODO", + "args": [ + { + "name": "isFullScreen", + "type": "boolean", + "required": true + }, + { + "name": "onToggleFullScreen", + "type": "() => void", + "required": true + } + ] + }, + { + "name": "HdsCodeEditorTitle", + "sourcePath": "./components/hds/code-editor/title.gts", + "summary": "TODO", + "args": [ + { + "name": "editorId", + "type": "string", + "required": true + }, + { + "name": "onInsert", + "type": "(element: HdsCodeEditorTitleElement) => void", + "required": true + }, + { + "name": "tag", + "type": "HdsTextBodySignature['Args']['tag']", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsComposite", + "sourcePath": "./components/hds/composite/index.gts", + "summary": "TODO", + "args": [ + { + "name": "defaultCurrentId", + "type": "string | null", + "required": false + }, + { + "name": "loop", + "type": "boolean | HdsCompositeOrientations", + "required": false + }, + { + "name": "orientation", + "type": "'horizontal' | 'vertical'", + "required": false + }, + { + "name": "wrap", + "type": "boolean | HdsCompositeOrientations", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "composite", + "type": "ModifierLike", + "kind": "value" + }, + { + "name": "group", + "type": "ModifierLike", + "kind": "value" + }, + { + "name": "item", + "type": "ModifierLike", + "kind": "value" + } + ] + } + ] + }, + { + "name": "HdsCopyButton", + "sourcePath": "./components/hds/copy/button/index.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string | boolean", + "required": false + }, + { + "name": "ariaMessageText", + "type": "string", + "required": false + }, + { + "name": "color", + "type": "'primary' | 'secondary' | 'tertiary' | 'critical'", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "iconPosition", + "type": "'leading' | 'trailing'", + "required": false + }, + { + "name": "isFullWidth", + "type": "boolean", + "required": false + }, + { + "name": "isHrefExternal", + "type": "boolean", + "required": false + }, + { + "name": "isIconOnly", + "type": "boolean", + "required": false + }, + { + "name": "isInline", + "type": "boolean", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "model", + "type": "unknown", + "required": false + }, + { + "name": "models", + "type": "unknown[]", + "required": false + }, + { + "name": "onError", + "type": "HdsClipboardModifierSignature['Args']['Named']['onError']", + "required": false + }, + { + "name": "onSuccess", + "type": "HdsClipboardModifierSignature['Args']['Named']['onSuccess']", + "required": false + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + }, + { + "name": "size", + "type": "'small' | 'medium'", + "required": false + }, + { + "name": "targetToCopy", + "type": "HdsClipboardModifierSignature['Args']['Named']['target']", + "required": false + }, + { + "name": "text", + "type": "string", + "required": true + }, + { + "name": "textToCopy", + "type": "HdsClipboardModifierSignature['Args']['Named']['text']", + "required": false + } + ] + }, + { + "name": "HdsCopySnippet", + "sourcePath": "./components/hds/copy/snippet/index.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaMessageText", + "type": "string", + "required": false + }, + { + "name": "color", + "type": "'primary' | 'secondary'", + "required": false + }, + { + "name": "isFullWidth", + "type": "boolean", + "required": false + }, + { + "name": "isTruncated", + "type": "boolean", + "required": false + }, + { + "name": "onError", + "type": "HdsClipboardModifierSignature['Args']['Named']['onError']", + "required": false + }, + { + "name": "onSuccess", + "type": "HdsClipboardModifierSignature['Args']['Named']['onSuccess']", + "required": false + }, + { + "name": "textToCopy", + "type": "HdsClipboardModifierSignature['Args']['Named']['text']", + "required": true + } + ] + }, + { + "name": "HdsDialogPrimitiveBody", + "sourcePath": "./components/hds/dialog-primitive/body.gts", + "summary": "TODO", + "args": [ + { + "name": "contextualClass", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsDialogPrimitiveDescription", + "sourcePath": "./components/hds/dialog-primitive/description.gts", + "summary": "TODO", + "args": [ + { + "name": "contextualClass", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsDialogPrimitiveFooter", + "sourcePath": "./components/hds/dialog-primitive/footer.gts", + "summary": "TODO", + "args": [ + { + "name": "contextualClass", + "type": "string", + "required": false + }, + { + "name": "onDismiss", + "type": "(event: MouseEvent, ...args: any[]) => void", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "close", + "type": "(event: MouseEvent, ...args: any[]) => void", + "kind": "function" + } + ] + } + ] + }, + { + "name": "HdsDialogPrimitiveHeader", + "sourcePath": "./components/hds/dialog-primitive/header.gts", + "summary": "TODO", + "args": [ + { + "name": "contextualClassPrefix", + "type": "string", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "onDismiss", + "type": "(event: MouseEvent, ...args: any[]) => void", + "required": false + }, + { + "name": "tagline", + "type": "string", + "required": false + }, + { + "name": "titleTag", + "type": "'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsDialogPrimitiveOverlay", + "sourcePath": "./components/hds/dialog-primitive/overlay.gts", + "summary": "TODO", + "args": [ + { + "name": "contextualClass", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsDialogPrimitiveWrapper", + "sourcePath": "./components/hds/dialog-primitive/wrapper.gts", + "summary": "TODO", + "blocks": [ + { + "name": "body" + }, + { + "name": "footer" + }, + { + "name": "header" + } + ] + }, + { + "name": "HdsDisclosurePrimitive", + "sourcePath": "./components/hds/disclosure-primitive/index.gts", + "summary": "TODO", + "args": [ + { + "name": "isOpen", + "type": "boolean", + "required": false + }, + { + "name": "onClickToggle", + "type": "(...args: any[]) => void", + "required": false + }, + { + "name": "onClose", + "type": "(...args: any[]) => void", + "required": false + } + ], + "blocks": [ + { + "name": "content", + "yields": [ + { + "name": "close", + "type": "(...args: any[]) => void", + "kind": "function" + } + ] + }, + { + "name": "toggle", + "yields": [ + { + "name": "contentId", + "type": "string", + "kind": "value" + }, + { + "name": "isOpen", + "type": "boolean", + "kind": "value" + }, + { + "name": "onClickToggle", + "type": "(...args: any[]) => void", + "kind": "function" + } + ] + } + ] + }, + { + "name": "HdsDismissButton", + "sourcePath": "./components/hds/dismiss-button/index.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaLabel", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsDropdown", + "sourcePath": "./components/hds/dropdown/index.gts", + "summary": "TODO", + "args": [ + { + "name": "boundary", + "type": "HdsAnchoredPositionOptions['boundary']", + "required": false + }, + { + "name": "enableCollisionDetection", + "type": "HdsAnchoredPositionOptions['enableCollisionDetection']", + "required": false + }, + { + "name": "height", + "type": "string", + "required": false + }, + { + "name": "isInline", + "type": "boolean", + "required": false + }, + { + "name": "isOpen", + "type": "HdsPopoverPrimitiveSignature['Args']['isOpen']", + "required": false + }, + { + "name": "listPosition", + "type": "'bottom-left' | 'bottom-right' | 'top-left' | 'top-right'", + "required": false + }, + { + "name": "matchToggleWidth", + "type": "boolean", + "required": false + }, + { + "name": "onClose", + "type": "HdsPopoverPrimitiveSignature['Args']['onClose']", + "required": false + }, + { + "name": "onFocusOut", + "type": "HdsPopoverPrimitiveSignature['Args']['onFocusOut']", + "required": false + }, + { + "name": "preserveContentInDom", + "type": "boolean", + "required": false + }, + { + "name": "width", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Checkbox", + "type": "typeof HdsDropdownListItemCheckbox", + "kind": "component", + "componentName": "HdsDropdownListItemCheckbox", + "sourcePath": "./list-item/checkbox.gts" + }, + { + "name": "Checkmark", + "type": "typeof HdsDropdownListItemCheckmark", + "kind": "component", + "componentName": "HdsDropdownListItemCheckmark", + "sourcePath": "./list-item/checkmark.gts" + }, + { + "name": "close", + "type": "(event?: Event) => void", + "kind": "function" + }, + { + "name": "CopyItem", + "type": "typeof HdsDropdownListItemCopyItem", + "kind": "component", + "componentName": "HdsDropdownListItemCopyItem", + "sourcePath": "./list-item/copy-item.gts" + }, + { + "name": "Description", + "type": "typeof HdsDropdownListItemDescription", + "kind": "component", + "componentName": "HdsDropdownListItemDescription", + "sourcePath": "./list-item/description.gts" + }, + { + "name": "Footer", + "type": "typeof HdsDropdownFooter", + "kind": "component", + "componentName": "HdsDropdownFooter", + "sourcePath": "./footer.gts" + }, + { + "name": "Generic", + "type": "typeof HdsDropdownListItemGeneric", + "kind": "component", + "componentName": "HdsDropdownListItemGeneric", + "sourcePath": "./list-item/generic.gts" + }, + { + "name": "Header", + "type": "typeof HdsDropdownHeader", + "kind": "component", + "componentName": "HdsDropdownHeader", + "sourcePath": "./header.gts" + }, + { + "name": "Interactive", + "type": "typeof HdsDropdownListItemInteractive", + "kind": "component", + "componentName": "HdsDropdownListItemInteractive", + "sourcePath": "./list-item/interactive.gts" + }, + { + "name": "Radio", + "type": "typeof HdsDropdownListItemRadio", + "kind": "component", + "componentName": "HdsDropdownListItemRadio", + "sourcePath": "./list-item/radio.gts" + }, + { + "name": "Separator", + "type": "typeof HdsDropdownListItemSeparator", + "kind": "component", + "componentName": "HdsDropdownListItemSeparator", + "sourcePath": "./list-item/separator.gts" + }, + { + "name": "Title", + "type": "typeof HdsDropdownListItemTitle", + "kind": "component", + "componentName": "HdsDropdownListItemTitle", + "sourcePath": "./list-item/title.gts" + }, + { + "name": "ToggleButton", + "type": "WithBoundArgs< typeof HdsDropdownToggleButton, 'isOpen' | 'setupPrimitiveToggle' >", + "kind": "component", + "componentName": "HdsDropdownToggleButton", + "sourcePath": "./toggle/button.gts", + "boundArgs": [ + "isOpen", + "setupPrimitiveToggle" + ] + }, + { + "name": "ToggleIcon", + "type": "WithBoundArgs< typeof HdsDropdownToggleIcon, 'isOpen' | 'setupPrimitiveToggle' >", + "kind": "component", + "componentName": "HdsDropdownToggleIcon", + "sourcePath": "./toggle/icon.gts", + "boundArgs": [ + "isOpen", + "setupPrimitiveToggle" + ] + } + ] + } + ] + }, + { + "name": "HdsDropdownFooter", + "sourcePath": "./components/hds/dropdown/footer.gts", + "summary": "TODO", + "args": [ + { + "name": "hasDivider", + "type": "boolean", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsDropdownHeader", + "sourcePath": "./components/hds/dropdown/header.gts", + "summary": "TODO", + "args": [ + { + "name": "hasDivider", + "type": "boolean", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsDropdownListItemCheckbox", + "sourcePath": "./components/hds/dropdown/list-item/checkbox.gts", + "summary": "TODO", + "args": [ + { + "name": "count", + "type": "string | number", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "value", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsDropdownListItemCheckmark", + "sourcePath": "./components/hds/dropdown/list-item/checkmark.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string | boolean", + "required": false + }, + { + "name": "count", + "type": "string | number", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "isHrefExternal", + "type": "boolean", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "model", + "type": "unknown", + "required": false + }, + { + "name": "models", + "type": "unknown[]", + "required": false + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + }, + { + "name": "selected", + "type": "boolean", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsDropdownListItemCopyItem", + "sourcePath": "./components/hds/dropdown/list-item/copy-item.gts", + "summary": "TODO", + "args": [ + { + "name": "copyItemTitle", + "type": "string", + "required": false + }, + { + "name": "isTruncated", + "type": "HdsCopySnippetSignature['Args']['isTruncated']", + "required": false + }, + { + "name": "text", + "type": "HdsCopySnippetSignature['Args']['textToCopy']", + "required": true + } + ] + }, + { + "name": "HdsDropdownListItemDescription", + "sourcePath": "./components/hds/dropdown/list-item/description.gts", + "summary": "TODO", + "args": [ + { + "name": "text", + "type": "string", + "required": true + } + ] + }, + { + "name": "HdsDropdownListItemGeneric", + "sourcePath": "./components/hds/dropdown/list-item/generic.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsDropdownListItemInteractive", + "sourcePath": "./components/hds/dropdown/list-item/interactive.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string | boolean", + "required": false + }, + { + "name": "color", + "type": "'action' | 'critical'", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "isHrefExternal", + "type": "boolean", + "required": false + }, + { + "name": "isLoading", + "type": "boolean", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "model", + "type": "unknown", + "required": false + }, + { + "name": "models", + "type": "unknown[]", + "required": false + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + }, + { + "name": "trailingIcon", + "type": "HdsIconSignature['Args']['name']", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Badge", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsBadge", + "sourcePath": "../../badge/index.gts", + "boundArgs": [ + "size" + ] + } + ] + } + ] + }, + { + "name": "HdsDropdownListItemRadio", + "sourcePath": "./components/hds/dropdown/list-item/radio.gts", + "summary": "TODO", + "args": [ + { + "name": "count", + "type": "string | number", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "value", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsDropdownListItemSeparator", + "sourcePath": "./components/hds/dropdown/list-item/separator.gts", + "summary": "TODO" + }, + { + "name": "HdsDropdownListItemTitle", + "sourcePath": "./components/hds/dropdown/list-item/title.gts", + "summary": "TODO", + "args": [ + { + "name": "text", + "type": "string", + "required": true + } + ] + }, + { + "name": "HdsDropdownToggleButton", + "sourcePath": "./components/hds/dropdown/toggle/button.gts", + "summary": "TODO", + "args": [ + { + "name": "badge", + "type": "HdsBadgeSignature['Args']['text']", + "required": false + }, + { + "name": "badgeIcon", + "type": "HdsBadgeSignature['Args']['icon']", + "required": false + }, + { + "name": "color", + "type": "'primary' | 'secondary'", + "required": false + }, + { + "name": "count", + "type": "HdsBadgeCountSignature['Args']['text']", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "isFullWidth", + "type": "boolean", + "required": false + }, + { + "name": "isOpen", + "type": "boolean", + "required": false + }, + { + "name": "setupPrimitiveToggle", + "type": "ModifierLike", + "required": false + }, + { + "name": "size", + "type": "'small' | 'medium'", + "required": false + }, + { + "name": "text", + "type": "string", + "required": true + } + ] + }, + { + "name": "HdsDropdownToggleIcon", + "sourcePath": "./components/hds/dropdown/toggle/icon.gts", + "summary": "TODO", + "args": [ + { + "name": "hasChevron", + "type": "boolean", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "imageSrc", + "type": "string", + "required": false + }, + { + "name": "isOpen", + "type": "boolean", + "required": false + }, + { + "name": "setupPrimitiveToggle", + "type": "ModifierLike", + "required": false + }, + { + "name": "size", + "type": "'small' | 'medium'", + "required": false + }, + { + "name": "text", + "type": "string", + "required": true + } + ] + }, + { + "name": "HdsFilterBar", + "sourcePath": "./components/hds/filter-bar/index.gts", + "summary": "TODO", + "args": [ + { + "name": "filters", + "type": "HdsFilterBarFilters", + "required": true + }, + { + "name": "hasSearch", + "type": "boolean", + "required": false + }, + { + "name": "isLiveFilter", + "type": "boolean", + "required": false + }, + { + "name": "onFilter", + "type": "(filters: HdsFilterBarFilters) => void", + "required": false + }, + { + "name": "searchPlaceholder", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "ActionsDropdown", + "type": "WithBoundArgs< typeof HdsFilterBarActionsDropdown, never >", + "kind": "component", + "componentName": "HdsFilterBarActionsDropdown", + "sourcePath": "./actions-dropdown.gts" + }, + { + "name": "ActionsGeneric", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../yield/index.gts" + }, + { + "name": "FiltersDropdown", + "type": "WithBoundArgs< typeof HdsFilterBarFiltersDropdown, 'filters' | 'isLiveFilter' | 'onFilter' >", + "kind": "component", + "componentName": "HdsFilterBarFiltersDropdown", + "sourcePath": "./filters-dropdown.gts", + "boundArgs": [ + "filters", + "isLiveFilter", + "onFilter" + ] + } + ] + } + ] + }, + { + "name": "HdsFilterBarActionsDropdown", + "sourcePath": "./components/hds/filter-bar/actions-dropdown.gts", + "summary": "TODO", + "args": [ + { + "name": "toggleButtonIcon", + "type": "HdsDropdownToggleButtonSignature['Args']['icon']", + "required": false + }, + { + "name": "toggleButtonText", + "type": "HdsDropdownToggleButtonSignature['Args']['text']", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFilterBarAppliedFilters", + "sourcePath": "./components/hds/filter-bar/applied-filters.gts", + "summary": "TODO", + "args": [ + { + "name": "filters", + "type": "HdsFilterBarFilters", + "required": true + }, + { + "name": "onFilterDismiss", + "type": "(key: string, filterValue?: unknown) => void", + "required": false + } + ] + }, + { + "name": "HdsFilterBarFilterGroup", + "sourcePath": "./components/hds/filter-bar/filter-group/index.gts", + "summary": "TODO", + "args": [ + { + "name": "filters", + "type": "HdsFilterBarFilters", + "required": true + }, + { + "name": "key", + "type": "string", + "required": true + }, + { + "name": "onChange", + "type": "(key: string, keyFilter?: HdsFilterBarFilter) => void", + "required": true + }, + { + "name": "onClear", + "type": "(key: string) => void", + "required": false + }, + { + "name": "panel", + "type": "WithBoundArgs", + "required": false + }, + { + "name": "searchEnabled", + "type": "boolean", + "required": false + }, + { + "name": "tab", + "type": "WithBoundArgs", + "required": false + }, + { + "name": "text", + "type": "string", + "required": true + }, + { + "name": "type", + "type": "'multi-select' | 'single-select' | 'numerical' | 'date' | 'time' | 'datetime' | 'generic' | 'search'", + "required": true + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Checkbox", + "type": "WithBoundArgs< typeof HdsFilterBarFilterGroupCheckbox, 'keyFilter' | 'name' | 'searchValue' | 'onChange' >", + "kind": "component", + "componentName": "HdsFilterBarFilterGroupCheckbox", + "sourcePath": "./checkbox.gts", + "boundArgs": [ + "keyFilter", + "name", + "searchValue", + "onChange" + ] + }, + { + "name": "Generic", + "type": "WithBoundArgs< typeof HdsFilterBarFilterGroupGeneric, 'onChange' >", + "kind": "component", + "componentName": "HdsFilterBarFilterGroupGeneric", + "sourcePath": "./generic.gts", + "boundArgs": [ + "onChange" + ] + }, + { + "name": "Radio", + "type": "WithBoundArgs< typeof HdsFilterBarFilterGroupRadio, 'keyFilter' | 'name' | 'searchValue' | 'onChange' >", + "kind": "component", + "componentName": "HdsFilterBarFilterGroupRadio", + "sourcePath": "./radio.gts", + "boundArgs": [ + "keyFilter", + "name", + "searchValue", + "onChange" + ] + } + ] + } + ] + }, + { + "name": "HdsFilterBarFilterGroupCheckbox", + "sourcePath": "./components/hds/filter-bar/filter-group/checkbox.gts", + "summary": "TODO", + "args": [ + { + "name": "keyFilter", + "type": "HdsFilterBarFilter", + "required": false + }, + { + "name": "label", + "type": "string", + "required": true + }, + { + "name": "name", + "type": "string", + "required": true + }, + { + "name": "onChange", + "type": "(event: Event, label?: string) => void", + "required": false + }, + { + "name": "searchValue", + "type": "string", + "required": false + }, + { + "name": "value", + "type": "string", + "required": true + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFilterBarFilterGroupClearButton", + "sourcePath": "./components/hds/filter-bar/filter-group/clear-button.gts", + "summary": "TODO", + "args": [ + { + "name": "text", + "type": "string", + "required": true + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFilterBarFilterGroupDate", + "sourcePath": "./components/hds/filter-bar/filter-group/date.gts", + "summary": "TODO", + "args": [ + { + "name": "key", + "type": "string", + "required": true + }, + { + "name": "keyFilter", + "type": "HdsFilterBarFilter", + "required": false + }, + { + "name": "onChange", + "type": "(filter: HdsFilterBarFilter) => void", + "required": false + }, + { + "name": "text", + "type": "string", + "required": false + }, + { + "name": "type", + "type": "'date' | 'time' | 'datetime'", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFilterBarFilterGroupGeneric", + "sourcePath": "./components/hds/filter-bar/filter-group/generic.gts", + "summary": "TODO", + "args": [ + { + "name": "onChange", + "type": "(filter: HdsFilterBarFilter) => void", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "updateFilter", + "type": "(filter: HdsFilterBarFilter) => void", + "kind": "function" + } + ] + } + ] + }, + { + "name": "HdsFilterBarFilterGroupNumerical", + "sourcePath": "./components/hds/filter-bar/filter-group/numerical.gts", + "summary": "TODO", + "args": [ + { + "name": "key", + "type": "string", + "required": true + }, + { + "name": "keyFilter", + "type": "HdsFilterBarFilter", + "required": false + }, + { + "name": "onChange", + "type": "(filter: HdsFilterBarFilter) => void", + "required": false + }, + { + "name": "text", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFilterBarFilterGroupRadio", + "sourcePath": "./components/hds/filter-bar/filter-group/radio.gts", + "summary": "TODO", + "args": [ + { + "name": "keyFilter", + "type": "HdsFilterBarFilter", + "required": false + }, + { + "name": "label", + "type": "string", + "required": true + }, + { + "name": "name", + "type": "string", + "required": true + }, + { + "name": "onChange", + "type": "(event: Event, label?: string) => void", + "required": false + }, + { + "name": "searchValue", + "type": "string", + "required": false + }, + { + "name": "value", + "type": "string", + "required": true + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFilterBarFiltersDropdown", + "sourcePath": "./components/hds/filter-bar/filters-dropdown.gts", + "summary": "TODO", + "args": [ + { + "name": "filters", + "type": "HdsFilterBarFilters", + "required": true + }, + { + "name": "height", + "type": "string", + "required": false + }, + { + "name": "isLiveFilter", + "type": "boolean", + "required": false + }, + { + "name": "onFilter", + "type": "(filters: HdsFilterBarFilters) => void", + "required": false + }, + { + "name": "onFocusOut", + "type": "HdsDropdownSignature['Args']['onFocusOut']", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "close", + "type": "HdsDropdownSignature['Blocks']['default'][0]['close']", + "kind": "value" + }, + { + "name": "FilterGroup", + "type": "WithBoundArgs< typeof HdsFilterBarFilterGroup, 'tab' | 'panel' | 'filters' | 'onChange' >", + "kind": "component", + "componentName": "HdsFilterBarFilterGroup", + "sourcePath": "./filter-group/index.gts", + "boundArgs": [ + "tab", + "panel", + "filters", + "onChange" + ] + } + ] + } + ] + }, + { + "name": "HdsFilterBarTabs", + "sourcePath": "./components/hds/filter-bar/tabs/index.gts", + "summary": "TODO", + "args": [ + { + "name": "selectedTabIndex", + "type": "number", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Panel", + "type": "WithBoundArgs< typeof HdsFilterBarTabsPanel, | 'selectedTabIndex' | 'tabIds' | 'panelIds' | 'didInsertNode' | 'willDestroyNode' >", + "kind": "component", + "componentName": "HdsFilterBarTabsPanel", + "sourcePath": "./panel.gts", + "boundArgs": [ + "selectedTabIndex", + "tabIds", + "panelIds", + "didInsertNode", + "willDestroyNode" + ] + }, + { + "name": "Tab", + "type": "WithBoundArgs< typeof HdsFilterBarTabsTab, | 'selectedTabIndex' | 'tabIds' | 'panelIds' | 'didInsertNode' | 'willDestroyNode' | 'onClick' | 'onKeydown' >", + "kind": "component", + "componentName": "HdsFilterBarTabsTab", + "sourcePath": "./tab.gts", + "boundArgs": [ + "selectedTabIndex", + "tabIds", + "panelIds", + "didInsertNode", + "willDestroyNode", + "onClick", + "onKeydown" + ] + } + ] + } + ] + }, + { + "name": "HdsFilterBarTabsPanel", + "sourcePath": "./components/hds/filter-bar/tabs/panel.gts", + "summary": "TODO", + "args": [ + { + "name": "didInsertNode", + "type": "(element: HTMLElement, panelId: string) => void", + "required": false + }, + { + "name": "panelIds", + "type": "string[]", + "required": false + }, + { + "name": "selectedTabIndex", + "type": "number", + "required": false + }, + { + "name": "tabIds", + "type": "string[]", + "required": false + }, + { + "name": "willDestroyNode", + "type": "(element: HTMLElement) => void", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFilterBarTabsTab", + "sourcePath": "./components/hds/filter-bar/tabs/tab.gts", + "summary": "TODO", + "args": [ + { + "name": "didInsertNode", + "type": "(element: HTMLElement, tabId: string) => void", + "required": false + }, + { + "name": "numFilters", + "type": "number", + "required": false + }, + { + "name": "onClick", + "type": "(event: MouseEvent, nodeIndex: number) => void", + "required": false + }, + { + "name": "onKeydown", + "type": "(event: KeyboardEvent, nodeIndex: number) => void", + "required": false + }, + { + "name": "panelIds", + "type": "string[]", + "required": false + }, + { + "name": "selectedTabIndex", + "type": "number", + "required": false + }, + { + "name": "tabIds", + "type": "string[]", + "required": false + }, + { + "name": "willDestroyNode", + "type": "(element: HTMLButtonElement) => void", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFlyout", + "sourcePath": "./components/hds/flyout/index.gts", + "summary": "TODO", + "args": [ + { + "name": "onClose", + "type": "(event: Event) => void", + "required": false + }, + { + "name": "onOpen", + "type": "() => void", + "required": false + }, + { + "name": "returnFocusTo", + "type": "string", + "required": false + }, + { + "name": "size", + "type": "'medium' | 'large'", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Body", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsDialogPrimitiveBody", + "sourcePath": "../dialog-primitive/body.gts", + "boundArgs": [ + "contextualClass" + ] + }, + { + "name": "Description", + "type": "WithBoundArgs< typeof HdsDialogPrimitiveDescription, 'contextualClass' >", + "kind": "component", + "componentName": "HdsDialogPrimitiveDescription", + "sourcePath": "../dialog-primitive/description.gts", + "boundArgs": [ + "contextualClass" + ] + }, + { + "name": "Footer", + "type": "WithBoundArgs< typeof HdsDialogPrimitiveFooter, 'onDismiss' | 'contextualClass' >", + "kind": "component", + "componentName": "HdsDialogPrimitiveFooter", + "sourcePath": "../dialog-primitive/footer.gts", + "boundArgs": [ + "onDismiss", + "contextualClass" + ] + }, + { + "name": "Header", + "type": "WithBoundArgs< typeof HdsDialogPrimitiveHeader, 'id' | 'onDismiss' | 'contextualClassPrefix' >", + "kind": "component", + "componentName": "HdsDialogPrimitiveHeader", + "sourcePath": "../dialog-primitive/header.gts", + "boundArgs": [ + "id", + "onDismiss", + "contextualClassPrefix" + ] + } + ] + } + ] + }, + { + "name": "HdsForm", + "sourcePath": "./components/hds/form/index.gts", + "summary": "TODO", + "args": [ + { + "name": "sectionMaxWidth", + "type": "string", + "required": false + }, + { + "name": "tag", + "type": "'form' | 'div'", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Footer", + "type": "typeof HdsFormFooter", + "kind": "component", + "componentName": "HdsFormFooter", + "sourcePath": "./footer/index.gts" + }, + { + "name": "Header", + "type": "typeof HdsFormHeader", + "kind": "component", + "componentName": "HdsFormHeader", + "sourcePath": "./header/index.gts" + }, + { + "name": "HeaderDescription", + "type": "typeof HdsFormHeaderDescription", + "kind": "component", + "componentName": "HdsFormHeaderDescription", + "sourcePath": "./header/description.gts" + }, + { + "name": "HeaderTitle", + "type": "typeof HdsFormHeaderTitle", + "kind": "component", + "componentName": "HdsFormHeaderTitle", + "sourcePath": "./header/title.gts" + }, + { + "name": "Section", + "type": "typeof HdsFormSection", + "kind": "component", + "componentName": "HdsFormSection", + "sourcePath": "./section/index.gts" + }, + { + "name": "SectionHeader", + "type": "typeof HdsFormSectionHeader", + "kind": "component", + "componentName": "HdsFormSectionHeader", + "sourcePath": "./section/header.gts" + }, + { + "name": "SectionHeaderDescription", + "type": "typeof HdsFormHeaderDescription", + "kind": "component", + "componentName": "HdsFormHeaderDescription", + "sourcePath": "./header/description.gts" + }, + { + "name": "SectionHeaderTitle", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsFormHeaderTitle", + "sourcePath": "./header/title.gts", + "boundArgs": [ + "size" + ] + }, + { + "name": "SectionMultiFieldGroup", + "type": "typeof HdsFormSectionMultiFieldGroup", + "kind": "component", + "componentName": "HdsFormSectionMultiFieldGroup", + "sourcePath": "./section/multi-field-group/index.gts" + }, + { + "name": "SectionMultiFieldGroupItem", + "type": "typeof HdsFormSectionMultiFieldGroupItem", + "kind": "component", + "componentName": "HdsFormSectionMultiFieldGroupItem", + "sourcePath": "./section/multi-field-group/item.gts" + }, + { + "name": "Separator", + "type": "typeof HdsFormSeparator", + "kind": "component", + "componentName": "HdsFormSeparator", + "sourcePath": "./separator/index.gts" + } + ] + } + ] + }, + { + "name": "HdsFormCharacterCount", + "sourcePath": "./components/hds/form/character-count/index.gts", + "summary": "TODO", + "args": [ + { + "name": "contextualClass", + "type": "string", + "required": false + }, + { + "name": "controlId", + "type": "string", + "required": false + }, + { + "name": "maxLength", + "type": "number | string", + "required": false + }, + { + "name": "minLength", + "type": "number | string", + "required": false + }, + { + "name": "onInsert", + "type": "(element: HTMLElement, ...args: any[]) => void", + "required": false + }, + { + "name": "value", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "currentLength", + "type": "number", + "kind": "value" + }, + { + "name": "maxLength", + "type": "number", + "kind": "value" + }, + { + "name": "minLength", + "type": "number", + "kind": "value" + }, + { + "name": "remaining", + "type": "number", + "kind": "value" + }, + { + "name": "shortfall", + "type": "number", + "kind": "value" + } + ] + } + ] + }, + { + "name": "HdsFormCheckboxBase", + "sourcePath": "./components/hds/form/checkbox/base.gts", + "summary": "TODO", + "args": [ + { + "name": "value", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsFormCheckboxField", + "sourcePath": "./components/hds/form/checkbox/field.gts", + "summary": "TODO", + "args": [ + { + "name": "name", + "type": "string", + "required": false + }, + { + "name": "value", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Error", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Error']", + "kind": "value" + }, + { + "name": "HelperText", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['HelperText']", + "kind": "value" + }, + { + "name": "Label", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Label']", + "kind": "value" + } + ] + } + ] + }, + { + "name": "HdsFormCheckboxGroup", + "sourcePath": "./components/hds/form/checkbox/group.gts", + "summary": "TODO", + "args": [ + { + "name": "extraAriaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "isOptional", + "type": "boolean", + "required": false + }, + { + "name": "isRequired", + "type": "boolean", + "required": false + }, + { + "name": "layout", + "type": "'vertical' | 'horizontal'", + "required": false + }, + { + "name": "name", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "CheckboxField", + "type": "WithBoundArgs< typeof HdsFormCheckboxField, 'isRequired' | 'name' | 'extraAriaDescribedBy' | 'contextualClass' >", + "kind": "component", + "componentName": "HdsFormCheckboxField", + "sourcePath": "./field.gts", + "boundArgs": [ + "isRequired", + "name", + "extraAriaDescribedBy", + "contextualClass" + ] + }, + { + "name": "Error", + "type": "HdsFormFieldsetSignature['Blocks']['default'][0]['Error']", + "kind": "value" + }, + { + "name": "HelperText", + "type": "HdsFormFieldsetSignature['Blocks']['default'][0]['HelperText']", + "kind": "value" + }, + { + "name": "Legend", + "type": "HdsFormFieldsetSignature['Blocks']['default'][0]['Legend']", + "kind": "value" + } + ] + } + ] + }, + { + "name": "HdsFormError", + "sourcePath": "./components/hds/form/error/index.gts", + "summary": "TODO", + "args": [ + { + "name": "contextualClass", + "type": "string", + "required": false + }, + { + "name": "controlId", + "type": "string", + "required": false + }, + { + "name": "onInsert", + "type": "(element: HTMLElement, ...args: any[]) => void", + "required": false + }, + { + "name": "onRemove", + "type": "(element: HTMLElement, ...args: any[]) => void", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Message", + "type": "typeof HdsFormErrorMessage", + "kind": "component", + "componentName": "HdsFormErrorMessage", + "sourcePath": "./message.gts" + } + ] + } + ] + }, + { + "name": "HdsFormErrorMessage", + "sourcePath": "./components/hds/form/error/message.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFormField", + "sourcePath": "./components/hds/form/field/index.gts", + "summary": "TODO", + "args": [ + { + "name": "contextualClass", + "type": "string", + "required": false + }, + { + "name": "extraAriaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "isOptional", + "type": "boolean", + "required": false + }, + { + "name": "isRequired", + "type": "boolean", + "required": false + }, + { + "name": "layout", + "type": "'vertical' | 'flag'", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "ariaDescribedBy", + "type": "string", + "kind": "value" + }, + { + "name": "CharacterCount", + "type": "WithBoundArgs< typeof HdsFormCharacterCount, 'contextualClass' | 'controlId' | 'onInsert' >", + "kind": "component", + "componentName": "HdsFormCharacterCount", + "sourcePath": "../character-count/index.gts", + "boundArgs": [ + "contextualClass", + "controlId", + "onInsert" + ] + }, + { + "name": "Control", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../../yield/index.gts" + }, + { + "name": "Error", + "type": "WithBoundArgs< typeof HdsFormError, 'contextualClass' | 'controlId' | 'onInsert' | 'onRemove' >", + "kind": "component", + "componentName": "HdsFormError", + "sourcePath": "../error/index.gts", + "boundArgs": [ + "contextualClass", + "controlId", + "onInsert", + "onRemove" + ] + }, + { + "name": "HelperText", + "type": "WithBoundArgs< typeof HdsFormHelperText, 'contextualClass' | 'controlId' | 'onInsert' >", + "kind": "component", + "componentName": "HdsFormHelperText", + "sourcePath": "../helper-text/index.gts", + "boundArgs": [ + "contextualClass", + "controlId", + "onInsert" + ] + }, + { + "name": "id", + "type": "string", + "kind": "value" + }, + { + "name": "Label", + "type": "WithBoundArgs< typeof HdsFormLabel, 'contextualClass' | 'controlId' | 'isRequired' | 'isOptional' >", + "kind": "component", + "componentName": "HdsFormLabel", + "sourcePath": "../label/index.gts", + "boundArgs": [ + "contextualClass", + "controlId", + "isRequired", + "isOptional" + ] + } + ] + } + ] + }, + { + "name": "HdsFormFieldset", + "sourcePath": "./components/hds/form/fieldset/index.gts", + "summary": "TODO", + "args": [ + { + "name": "extraAriaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "isOptional", + "type": "boolean", + "required": false + }, + { + "name": "isRequired", + "type": "boolean", + "required": false + }, + { + "name": "layout", + "type": "'vertical' | 'horizontal'", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "ariaDescribedBy", + "type": "string", + "kind": "value" + }, + { + "name": "Control", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../../yield/index.gts" + }, + { + "name": "Error", + "type": "WithBoundArgs< typeof HdsFormError, 'contextualClass' | 'controlId' | 'onInsert' | 'onRemove' >", + "kind": "component", + "componentName": "HdsFormError", + "sourcePath": "../error/index.gts", + "boundArgs": [ + "contextualClass", + "controlId", + "onInsert", + "onRemove" + ] + }, + { + "name": "HelperText", + "type": "WithBoundArgs< typeof HdsFormHelperText, 'contextualClass' | 'controlId' | 'onInsert' >", + "kind": "component", + "componentName": "HdsFormHelperText", + "sourcePath": "../helper-text/index.gts", + "boundArgs": [ + "contextualClass", + "controlId", + "onInsert" + ] + }, + { + "name": "id", + "type": "string", + "kind": "value" + }, + { + "name": "Legend", + "type": "WithBoundArgs< typeof HdsFormLegend, 'contextualClass' | 'isRequired' | 'isOptional' >", + "kind": "component", + "componentName": "HdsFormLegend", + "sourcePath": "../legend/index.gts", + "boundArgs": [ + "contextualClass", + "isRequired", + "isOptional" + ] + } + ] + } + ] + }, + { + "name": "HdsFormFileInputBase", + "sourcePath": "./components/hds/form/file-input/base.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsFormFileInputField", + "sourcePath": "./components/hds/form/file-input/field.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Error", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Error']", + "kind": "value" + }, + { + "name": "HelperText", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['HelperText']", + "kind": "value" + }, + { + "name": "Label", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Label']", + "kind": "value" + } + ] + } + ] + }, + { + "name": "HdsFormFooter", + "sourcePath": "./components/hds/form/footer/index.gts", + "summary": "TODO", + "args": [ + { + "name": "isFullWidth", + "type": "boolean", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "ButtonSet", + "type": "typeof HdsButtonSet", + "kind": "component", + "componentName": "HdsButtonSet", + "sourcePath": "../../button-set/index.gts" + } + ] + } + ] + }, + { + "name": "HdsFormHeader", + "sourcePath": "./components/hds/form/header/index.gts", + "summary": "TODO", + "args": [ + { + "name": "isFullWidth", + "type": "boolean", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Description", + "type": "typeof HdsFormHeaderDescription", + "kind": "component", + "componentName": "HdsFormHeaderDescription", + "sourcePath": "./description.gts" + }, + { + "name": "Title", + "type": "typeof HdsFormHeaderTitle", + "kind": "component", + "componentName": "HdsFormHeaderTitle", + "sourcePath": "./title.gts" + } + ] + } + ] + }, + { + "name": "HdsFormHeaderDescription", + "sourcePath": "./components/hds/form/header/description.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFormHeaderTitle", + "sourcePath": "./components/hds/form/header/title.gts", + "summary": "TODO", + "args": [ + { + "name": "size", + "type": "HdsTextDisplaySignature['Args']['size']", + "required": false + }, + { + "name": "tag", + "type": "'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFormHelperText", + "sourcePath": "./components/hds/form/helper-text/index.gts", + "summary": "TODO", + "args": [ + { + "name": "contextualClass", + "type": "string", + "required": false + }, + { + "name": "controlId", + "type": "string", + "required": false + }, + { + "name": "onInsert", + "type": "(element: HTMLElement, ...args: any[]) => void", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFormIndicator", + "sourcePath": "./components/hds/form/indicator/index.gts", + "summary": "TODO", + "args": [ + { + "name": "isOptional", + "type": "boolean", + "required": false + }, + { + "name": "isRequired", + "type": "boolean", + "required": false + } + ] + }, + { + "name": "HdsFormKeyValueInputs", + "sourcePath": "./components/hds/form/key-value-inputs/index.gts", + "summary": "TODO", + "args": [ + { + "name": "data", + "type": "Array", + "required": true + }, + { + "name": "extraAriaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "isOptional", + "type": "boolean", + "required": false + }, + { + "name": "isRequired", + "type": "boolean", + "required": false + } + ], + "blocks": [ + { + "name": "footer", + "yields": [ + { + "name": "AddRowButton", + "type": "typeof HdsFormKeyValueInputsAddRowButton", + "kind": "component", + "componentName": "HdsFormKeyValueInputsAddRowButton", + "sourcePath": "./add-row-button.gts" + }, + { + "name": "Alert", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsAlert", + "sourcePath": "../../alert/index.gts", + "boundArgs": [ + "color", + "type" + ] + }, + { + "name": "Error", + "type": "WithBoundArgs< typeof HdsFormError, 'contextualClass' | 'controlId' | 'onInsert' | 'onRemove' >", + "kind": "component", + "componentName": "HdsFormError", + "sourcePath": "../error/index.gts", + "boundArgs": [ + "contextualClass", + "controlId", + "onInsert", + "onRemove" + ] + } + ] + }, + { + "name": "header", + "yields": [ + { + "name": "Generic", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../../yield/index.gts" + }, + { + "name": "HelperText", + "type": "WithBoundArgs< typeof HdsFormHelperText, 'contextualClass' | 'controlId' | 'onInsert' >", + "kind": "component", + "componentName": "HdsFormHelperText", + "sourcePath": "../helper-text/index.gts", + "boundArgs": [ + "contextualClass", + "controlId", + "onInsert" + ] + }, + { + "name": "Legend", + "type": "WithBoundArgs< typeof HdsFormLegend, 'contextualClass' | 'id' | 'isOptional' | 'isRequired' >", + "kind": "component", + "componentName": "HdsFormLegend", + "sourcePath": "../legend/index.gts", + "boundArgs": [ + "contextualClass", + "id", + "isOptional", + "isRequired" + ] + } + ] + }, + { + "name": "row", + "yields": [ + { + "name": "DeleteRowButton", + "type": "WithBoundArgs< typeof HdsFormKeyValueInputsDeleteRowButton, 'onInsert' | 'onRemove' | 'returnFocusTo' | 'rowData' | 'rowIndex' >", + "kind": "component", + "componentName": "HdsFormKeyValueInputsDeleteRowButton", + "sourcePath": "./delete-row-button.gts", + "boundArgs": [ + "onInsert", + "onRemove", + "returnFocusTo", + "rowData", + "rowIndex" + ] + }, + { + "name": "Field", + "type": "WithBoundArgs< typeof HdsFormKeyValueInputsField, 'onInsert' | 'onRemove' | 'rowIndex' >", + "kind": "component", + "componentName": "HdsFormKeyValueInputsField", + "sourcePath": "./field.gts", + "boundArgs": [ + "onInsert", + "onRemove", + "rowIndex" + ] + }, + { + "name": "Generic", + "type": "WithBoundArgs< typeof HdsFormKeyValueInputsGeneric, 'onInsert' | 'onRemove' >", + "kind": "component", + "componentName": "HdsFormKeyValueInputsGeneric", + "sourcePath": "./generic.gts", + "boundArgs": [ + "onInsert", + "onRemove" + ] + }, + { + "name": "rowData", + "type": "T", + "kind": "value" + }, + { + "name": "rowIndex", + "type": "number", + "kind": "value" + } + ] + } + ] + }, + { + "name": "HdsFormKeyValueInputsAddRowButton", + "sourcePath": "./components/hds/form/key-value-inputs/add-row-button.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaLabel", + "type": "string", + "required": false + }, + { + "name": "onClick", + "type": "() => void", + "required": false + }, + { + "name": "text", + "type": "HdsButtonSignature['Args']['text']", + "required": false + } + ] + }, + { + "name": "HdsFormKeyValueInputsDeleteRowButton", + "sourcePath": "./components/hds/form/key-value-inputs/delete-row-button.gts", + "summary": "TODO", + "args": [ + { + "name": "onClick", + "type": "(rowData: unknown, rowIndex: number) => void", + "required": false + }, + { + "name": "onInsert", + "type": "() => void", + "required": false + }, + { + "name": "onRemove", + "type": "() => void", + "required": false + }, + { + "name": "returnFocusTo", + "type": "HTMLFieldSetElement", + "required": false + }, + { + "name": "rowData", + "type": "unknown", + "required": true + }, + { + "name": "rowIndex", + "type": "number", + "required": true + }, + { + "name": "text", + "type": "HdsButtonSignature['Args']['text']", + "required": false + } + ] + }, + { + "name": "HdsFormKeyValueInputsField", + "sourcePath": "./components/hds/form/key-value-inputs/field.gts", + "summary": "TODO", + "args": [ + { + "name": "extraAriaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "isInvalid", + "type": "boolean", + "required": false + }, + { + "name": "isOptional", + "type": "boolean", + "required": false + }, + { + "name": "isRequired", + "type": "boolean", + "required": false + }, + { + "name": "onInsert", + "type": "() => void", + "required": false + }, + { + "name": "onRemove", + "type": "() => void", + "required": false + }, + { + "name": "rowIndex", + "type": "number", + "required": true + }, + { + "name": "width", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Error", + "type": "WithBoundArgs< typeof HdsFormError, 'contextualClass' | 'controlId' | 'onInsert' | 'onRemove' >", + "kind": "component", + "componentName": "HdsFormError", + "sourcePath": "../error/index.gts", + "boundArgs": [ + "contextualClass", + "controlId", + "onInsert", + "onRemove" + ] + }, + { + "name": "FileInput", + "type": "WithBoundArgs< typeof HdsFormFileInputBase, 'ariaDescribedBy' | 'id' >", + "kind": "component", + "componentName": "HdsFormFileInputBase", + "sourcePath": "../file-input/base.gts", + "boundArgs": [ + "ariaDescribedBy", + "id" + ] + }, + { + "name": "HelperText", + "type": "WithBoundArgs< typeof HdsFormHelperText, 'contextualClass' | 'controlId' | 'onInsert' >", + "kind": "component", + "componentName": "HdsFormHelperText", + "sourcePath": "../helper-text/index.gts", + "boundArgs": [ + "contextualClass", + "controlId", + "onInsert" + ] + }, + { + "name": "Label", + "type": "WithBoundArgs< typeof HdsFormLabel, | 'contextualClass' | 'controlId' | 'hiddenText' | 'isOptional' | 'isRequired' >", + "kind": "component", + "componentName": "HdsFormLabel", + "sourcePath": "../label/index.gts", + "boundArgs": [ + "contextualClass", + "controlId", + "hiddenText", + "isOptional", + "isRequired" + ] + }, + { + "name": "MaskedInput", + "type": "WithBoundArgs< typeof HdsFormMaskedInputBase, 'ariaDescribedBy' | 'id' | 'isInvalid' >", + "kind": "component", + "componentName": "HdsFormMaskedInputBase", + "sourcePath": "../masked-input/base.gts", + "boundArgs": [ + "ariaDescribedBy", + "id", + "isInvalid" + ] + }, + { + "name": "Select", + "type": "WithBoundArgs< typeof HdsFormSelectBase, 'ariaDescribedBy' | 'id' | 'isInvalid' >", + "kind": "component", + "componentName": "HdsFormSelectBase", + "sourcePath": "../select/base.gts", + "boundArgs": [ + "ariaDescribedBy", + "id", + "isInvalid" + ] + }, + { + "name": "SuperSelectMultiple", + "type": "WithBoundArgs< typeof HdsFormSuperSelectMultipleBase, 'ariaDescribedBy' | 'ariaLabelledBy' | 'isInvalid' | 'triggerId' >", + "kind": "component", + "componentName": "HdsFormSuperSelectMultipleBase", + "sourcePath": "../super-select/multiple/base.gts", + "boundArgs": [ + "ariaDescribedBy", + "ariaLabelledBy", + "isInvalid", + "triggerId" + ] + }, + { + "name": "SuperSelectSingle", + "type": "WithBoundArgs< typeof HdsFormSuperSelectSingleBase, 'ariaDescribedBy' | 'ariaLabelledBy' | 'isInvalid' | 'triggerId' >", + "kind": "component", + "componentName": "HdsFormSuperSelectSingleBase", + "sourcePath": "../super-select/single/base.gts", + "boundArgs": [ + "ariaDescribedBy", + "ariaLabelledBy", + "isInvalid", + "triggerId" + ] + }, + { + "name": "Textarea", + "type": "WithBoundArgs< typeof HdsFormTextareaBase, 'ariaDescribedBy' | 'id' | 'isInvalid' >", + "kind": "component", + "componentName": "HdsFormTextareaBase", + "sourcePath": "../textarea/base.gts", + "boundArgs": [ + "ariaDescribedBy", + "id", + "isInvalid" + ] + }, + { + "name": "TextInput", + "type": "WithBoundArgs< typeof HdsFormTextInputBase, 'ariaDescribedBy' | 'id' | 'isInvalid' >", + "kind": "component", + "componentName": "HdsFormTextInputBase", + "sourcePath": "../text-input/base.gts", + "boundArgs": [ + "ariaDescribedBy", + "id", + "isInvalid" + ] + } + ] + } + ] + }, + { + "name": "HdsFormKeyValueInputsGeneric", + "sourcePath": "./components/hds/form/key-value-inputs/generic.gts", + "summary": "TODO", + "args": [ + { + "name": "onInsert", + "type": "() => void", + "required": false + }, + { + "name": "onRemove", + "type": "() => void", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFormLabel", + "sourcePath": "./components/hds/form/label/index.gts", + "summary": "TODO", + "args": [ + { + "name": "contextualClass", + "type": "string", + "required": false + }, + { + "name": "controlId", + "type": "string", + "required": false + }, + { + "name": "hiddenText", + "type": "string", + "required": false + }, + { + "name": "isOptional", + "type": "HdsFormIndicatorSignature['Args']['isOptional']", + "required": false + }, + { + "name": "isRequired", + "type": "HdsFormIndicatorSignature['Args']['isRequired']", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFormLegend", + "sourcePath": "./components/hds/form/legend/index.gts", + "summary": "TODO", + "args": [ + { + "name": "contextualClass", + "type": "string", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "isOptional", + "type": "HdsFormIndicatorSignature['Args']['isOptional']", + "required": false + }, + { + "name": "isRequired", + "type": "HdsFormIndicatorSignature['Args']['isRequired']", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFormMaskedInputBase", + "sourcePath": "./components/hds/form/masked-input/base.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "copyButtonText", + "type": "HdsCopyButtonSignature['Args']['text']", + "required": false + }, + { + "name": "hasCopyButton", + "type": "boolean", + "required": false + }, + { + "name": "height", + "type": "string", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "isContentMasked", + "type": "boolean", + "required": false + }, + { + "name": "isInvalid", + "type": "boolean", + "required": false + }, + { + "name": "isMultiline", + "type": "boolean", + "required": false + }, + { + "name": "value", + "type": "string", + "required": false + }, + { + "name": "visibilityToggleAriaLabel", + "type": "HdsFormVisibilityToggleSignature['Args']['ariaLabel']", + "required": false + }, + { + "name": "visibilityToggleAriaMessageText", + "type": "HdsFormVisibilityToggleSignature['Args']['ariaMessageText']", + "required": false + }, + { + "name": "width", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsFormMaskedInputField", + "sourcePath": "./components/hds/form/masked-input/field.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "copyButtonText", + "type": "HdsCopyButtonSignature['Args']['text']", + "required": false + }, + { + "name": "hasCopyButton", + "type": "boolean", + "required": false + }, + { + "name": "height", + "type": "string", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "isContentMasked", + "type": "boolean", + "required": false + }, + { + "name": "isInvalid", + "type": "boolean", + "required": false + }, + { + "name": "isMultiline", + "type": "boolean", + "required": false + }, + { + "name": "value", + "type": "string", + "required": false + }, + { + "name": "visibilityToggleAriaLabel", + "type": "HdsFormVisibilityToggleSignature['Args']['ariaLabel']", + "required": false + }, + { + "name": "visibilityToggleAriaMessageText", + "type": "HdsFormVisibilityToggleSignature['Args']['ariaMessageText']", + "required": false + }, + { + "name": "width", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "CharacterCount", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsFormCharacterCount", + "sourcePath": "../character-count/index.gts", + "boundArgs": [ + "value" + ] + }, + { + "name": "Error", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Error']", + "kind": "value" + }, + { + "name": "HelperText", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['HelperText']", + "kind": "value" + }, + { + "name": "Label", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Label']", + "kind": "value" + } + ] + } + ] + }, + { + "name": "HdsFormRadioBase", + "sourcePath": "./components/hds/form/radio/base.gts", + "summary": "TODO", + "args": [ + { + "name": "value", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsFormRadioCard", + "sourcePath": "./components/hds/form/radio-card/index.gts", + "summary": "TODO", + "args": [ + { + "name": "alignment", + "type": "'left' | 'center'", + "required": false + }, + { + "name": "checked", + "type": "boolean", + "required": false + }, + { + "name": "controlPosition", + "type": "'bottom' | 'left'", + "required": false + }, + { + "name": "disabled", + "type": "boolean", + "required": false + }, + { + "name": "extraAriaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "maxWidth", + "type": "string", + "required": false + }, + { + "name": "name", + "type": "string", + "required": false + }, + { + "name": "value", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Badge", + "type": "typeof HdsBadge", + "kind": "component", + "componentName": "HdsBadge", + "sourcePath": "../../badge/index.gts" + }, + { + "name": "Description", + "type": "typeof HdsFormRadioCardDescription", + "kind": "component", + "componentName": "HdsFormRadioCardDescription", + "sourcePath": "./description.gts" + }, + { + "name": "Generic", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../../yield/index.gts" + }, + { + "name": "Icon", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsIcon", + "sourcePath": "../../icon/index.gts", + "boundArgs": [ + "size" + ] + }, + { + "name": "Label", + "type": "typeof HdsFormRadioCardLabel", + "kind": "component", + "componentName": "HdsFormRadioCardLabel", + "sourcePath": "./label.gts" + } + ] + } + ] + }, + { + "name": "HdsFormRadioCardDescription", + "sourcePath": "./components/hds/form/radio-card/description.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFormRadioCardGroup", + "sourcePath": "./components/hds/form/radio-card/group.gts", + "summary": "TODO", + "args": [ + { + "name": "alignment", + "type": "'left' | 'center'", + "required": false + }, + { + "name": "controlPosition", + "type": "'bottom' | 'left'", + "required": false + }, + { + "name": "extraAriaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "isOptional", + "type": "boolean", + "required": false + }, + { + "name": "isRequired", + "type": "boolean", + "required": false + }, + { + "name": "layout", + "type": "'vertical' | 'horizontal'", + "required": false + }, + { + "name": "name", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Error", + "type": "HdsFormFieldsetSignature['Blocks']['default'][0]['Error']", + "kind": "value" + }, + { + "name": "HelperText", + "type": "HdsFormFieldsetSignature['Blocks']['default'][0]['HelperText']", + "kind": "value" + }, + { + "name": "Legend", + "type": "HdsFormFieldsetSignature['Blocks']['default'][0]['Legend']", + "kind": "value" + }, + { + "name": "RadioCard", + "type": "WithBoundArgs< typeof HdsFormRadioCard, 'name' | 'alignment' | 'controlPosition' | 'extraAriaDescribedBy' >", + "kind": "component", + "componentName": "HdsFormRadioCard", + "sourcePath": "./index.gts", + "boundArgs": [ + "name", + "alignment", + "controlPosition", + "extraAriaDescribedBy" + ] + } + ] + } + ] + }, + { + "name": "HdsFormRadioCardLabel", + "sourcePath": "./components/hds/form/radio-card/label.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFormRadioField", + "sourcePath": "./components/hds/form/radio/field.gts", + "summary": "TODO", + "args": [ + { + "name": "name", + "type": "string", + "required": false + }, + { + "name": "value", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Error", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Error']", + "kind": "value" + }, + { + "name": "HelperText", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['HelperText']", + "kind": "value" + }, + { + "name": "Label", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Label']", + "kind": "value" + } + ] + } + ] + }, + { + "name": "HdsFormRadioGroup", + "sourcePath": "./components/hds/form/radio/group.gts", + "summary": "TODO", + "args": [ + { + "name": "extraAriaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "isOptional", + "type": "boolean", + "required": false + }, + { + "name": "isRequired", + "type": "boolean", + "required": false + }, + { + "name": "layout", + "type": "'vertical' | 'horizontal'", + "required": false + }, + { + "name": "name", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Error", + "type": "HdsFormFieldsetSignature['Blocks']['default'][0]['Error']", + "kind": "value" + }, + { + "name": "HelperText", + "type": "HdsFormFieldsetSignature['Blocks']['default'][0]['HelperText']", + "kind": "value" + }, + { + "name": "Legend", + "type": "HdsFormFieldsetSignature['Blocks']['default'][0]['Legend']", + "kind": "value" + }, + { + "name": "RadioField", + "type": "WithBoundArgs< typeof HdsFormRadioField, 'name' | 'isRequired' | 'extraAriaDescribedBy' | 'contextualClass' >", + "kind": "component", + "componentName": "HdsFormRadioField", + "sourcePath": "./field.gts", + "boundArgs": [ + "name", + "isRequired", + "extraAriaDescribedBy", + "contextualClass" + ] + } + ] + } + ] + }, + { + "name": "HdsFormSection", + "sourcePath": "./components/hds/form/section/index.gts", + "summary": "TODO", + "args": [ + { + "name": "isFullWidth", + "type": "boolean", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Header", + "type": "typeof HdsFormSectionHeader", + "kind": "component", + "componentName": "HdsFormSectionHeader", + "sourcePath": "./header.gts" + }, + { + "name": "HeaderDescription", + "type": "typeof HdsFormHeaderDescription", + "kind": "component", + "componentName": "HdsFormHeaderDescription", + "sourcePath": "../header/description.gts" + }, + { + "name": "HeaderTitle", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsFormHeaderTitle", + "sourcePath": "../header/title.gts", + "boundArgs": [ + "size" + ] + }, + { + "name": "MultiFieldGroup", + "type": "typeof HdsFormSectionMultiFieldGroup", + "kind": "component", + "componentName": "HdsFormSectionMultiFieldGroup", + "sourcePath": "./multi-field-group/index.gts" + }, + { + "name": "MultiFieldGroupItem", + "type": "typeof HdsFormSectionMultiFieldGroupItem", + "kind": "component", + "componentName": "HdsFormSectionMultiFieldGroupItem", + "sourcePath": "./multi-field-group/item.gts" + }, + { + "name": "Section", + "type": "typeof HdsFormSection", + "kind": "component", + "componentName": "HdsFormSection" + } + ] + } + ] + }, + { + "name": "HdsFormSectionHeader", + "sourcePath": "./components/hds/form/section/header.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Description", + "type": "typeof HdsFormHeaderDescription", + "kind": "component", + "componentName": "HdsFormHeaderDescription", + "sourcePath": "../header/description.gts" + }, + { + "name": "Title", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsFormHeaderTitle", + "sourcePath": "../header/title.gts", + "boundArgs": [ + "size" + ] + } + ] + } + ] + }, + { + "name": "HdsFormSectionMultiFieldGroup", + "sourcePath": "./components/hds/form/section/multi-field-group/index.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Item", + "type": "typeof HdsFormSectionMultiFieldGroupItem", + "kind": "component", + "componentName": "HdsFormSectionMultiFieldGroupItem", + "sourcePath": "./item.gts" + } + ] + } + ] + }, + { + "name": "HdsFormSectionMultiFieldGroupItem", + "sourcePath": "./components/hds/form/section/multi-field-group/item.gts", + "summary": "TODO", + "args": [ + { + "name": "width", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFormSelectBase", + "sourcePath": "./components/hds/form/select/base.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "isInvalid", + "type": "boolean", + "required": false + }, + { + "name": "width", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Options", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../../yield/index.gts" + } + ] + } + ] + }, + { + "name": "HdsFormSelectField", + "sourcePath": "./components/hds/form/select/field.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "isInvalid", + "type": "boolean", + "required": false + }, + { + "name": "width", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Error", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Error']", + "kind": "value" + }, + { + "name": "HelperText", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['HelperText']", + "kind": "value" + }, + { + "name": "Label", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Label']", + "kind": "value" + }, + { + "name": "Options", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../../yield/index.gts" + } + ] + } + ] + }, + { + "name": "HdsFormSeparator", + "sourcePath": "./components/hds/form/separator/index.gts", + "summary": "TODO", + "args": [ + { + "name": "isFullWidth", + "type": "boolean", + "required": false + } + ] + }, + { + "name": "HdsFormSuperSelectAfterOptions", + "sourcePath": "./components/hds/form/super-select/after-options.gts", + "summary": "TODO", + "args": [ + { + "name": "clearSelected", + "type": "() => void", + "required": true + }, + { + "name": "content", + "type": "string", + "required": false + }, + { + "name": "resultCountMessage", + "type": "string", + "required": false + }, + { + "name": "selectedCount", + "type": "string", + "required": false + }, + { + "name": "showAll", + "type": "() => void", + "required": true + }, + { + "name": "showNoSelectedMessage", + "type": "boolean", + "required": false + }, + { + "name": "showOnlySelected", + "type": "boolean", + "required": false + }, + { + "name": "showSelected", + "type": "() => void", + "required": true + } + ] + }, + { + "name": "HdsFormSuperSelectMultipleBase", + "sourcePath": "./components/hds/form/super-select/multiple/base.gts", + "summary": "TODO", + "args": [ + { + "name": "afterOptionsContent", + "type": "string", + "required": false + }, + { + "name": "dropdownMaxWidth", + "type": "string", + "required": false + }, + { + "name": "isInvalid", + "type": "boolean", + "required": false + }, + { + "name": "matchTriggerWidth", + "type": "boolean", + "required": false + }, + { + "name": "resultCountMessage", + "type": "| string | PowerSelectSignature['Args']['resultCountMessage']", + "required": false + }, + { + "name": "showAfterOptions", + "type": "boolean", + "required": false + } + ] + }, + { + "name": "HdsFormSuperSelectMultipleField", + "sourcePath": "./components/hds/form/super-select/multiple/field.gts", + "summary": "TODO", + "args": [ + { + "name": "afterOptionsContent", + "type": "string", + "required": false + }, + { + "name": "contextualClass", + "type": "string", + "required": false + }, + { + "name": "dropdownMaxWidth", + "type": "string", + "required": false + }, + { + "name": "extraAriaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "isInvalid", + "type": "boolean", + "required": false + }, + { + "name": "isOptional", + "type": "boolean", + "required": false + }, + { + "name": "isRequired", + "type": "boolean", + "required": false + }, + { + "name": "layout", + "type": "'vertical' | 'flag'", + "required": false + }, + { + "name": "matchTriggerWidth", + "type": "boolean", + "required": false + }, + { + "name": "resultCountMessage", + "type": "| string | PowerSelectSignature['Args']['resultCountMessage']", + "required": false + }, + { + "name": "showAfterOptions", + "type": "boolean", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Error", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Error']", + "kind": "value" + }, + { + "name": "HelperText", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['HelperText']", + "kind": "value" + }, + { + "name": "Label", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Label']", + "kind": "value" + }, + { + "name": "options", + "type": "unknown", + "kind": "value" + }, + { + "name": "Options", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../../../yield/index.gts" + }, + { + "name": "select", + "type": "PowerSelect", + "kind": "value" + } + ] + } + ] + }, + { + "name": "HdsFormSuperSelectOptionGroup", + "sourcePath": "./components/hds/form/super-select/option-group.gts", + "summary": "TODO", + "args": [ + { + "name": "group", + "type": "{ groupName?: string; }", + "required": true + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsFormSuperSelectPlaceholder", + "sourcePath": "./components/hds/form/super-select/placeholder.gts", + "summary": "TODO", + "args": [ + { + "name": "placeholder", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsFormSuperSelectSingleBase", + "sourcePath": "./components/hds/form/super-select/single/base.gts", + "summary": "TODO", + "args": [ + { + "name": "afterOptionsContent", + "type": "string", + "required": false + }, + { + "name": "dropdownMaxWidth", + "type": "string", + "required": false + }, + { + "name": "isInvalid", + "type": "boolean", + "required": false + }, + { + "name": "matchTriggerWidth", + "type": "boolean", + "required": false + }, + { + "name": "resultCountMessage", + "type": "| string | PowerSelectSignature['Args']['resultCountMessage']", + "required": false + }, + { + "name": "showAfterOptions", + "type": "boolean", + "required": false + } + ] + }, + { + "name": "HdsFormSuperSelectSingleField", + "sourcePath": "./components/hds/form/super-select/single/field.gts", + "summary": "TODO", + "args": [ + { + "name": "afterOptionsContent", + "type": "string", + "required": false + }, + { + "name": "contextualClass", + "type": "string", + "required": false + }, + { + "name": "dropdownMaxWidth", + "type": "string", + "required": false + }, + { + "name": "extraAriaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "isInvalid", + "type": "boolean", + "required": false + }, + { + "name": "isOptional", + "type": "boolean", + "required": false + }, + { + "name": "isRequired", + "type": "boolean", + "required": false + }, + { + "name": "layout", + "type": "'vertical' | 'flag'", + "required": false + }, + { + "name": "matchTriggerWidth", + "type": "boolean", + "required": false + }, + { + "name": "resultCountMessage", + "type": "| string | PowerSelectSignature['Args']['resultCountMessage']", + "required": false + }, + { + "name": "showAfterOptions", + "type": "boolean", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Error", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Error']", + "kind": "value" + }, + { + "name": "HelperText", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['HelperText']", + "kind": "value" + }, + { + "name": "Label", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Label']", + "kind": "value" + }, + { + "name": "options", + "type": "unknown", + "kind": "value" + }, + { + "name": "Options", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../../../yield/index.gts" + }, + { + "name": "select", + "type": "Select", + "kind": "value" + } + ] + } + ] + }, + { + "name": "HdsFormTextareaBase", + "sourcePath": "./components/hds/form/textarea/base.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "height", + "type": "string", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "isInvalid", + "type": "boolean", + "required": false + }, + { + "name": "value", + "type": "string", + "required": false + }, + { + "name": "width", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsFormTextareaField", + "sourcePath": "./components/hds/form/textarea/field.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "height", + "type": "string", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "isInvalid", + "type": "boolean", + "required": false + }, + { + "name": "value", + "type": "string", + "required": false + }, + { + "name": "width", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "CharacterCount", + "type": "WithBoundArgs< typeof HdsFormCharacterCountComponent, 'value' >", + "kind": "component", + "componentName": "HdsFormCharacterCountComponent", + "sourcePath": "../character-count/index.gts", + "boundArgs": [ + "value" + ] + }, + { + "name": "Error", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Error']", + "kind": "value" + }, + { + "name": "HelperText", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['HelperText']", + "kind": "value" + }, + { + "name": "Label", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Label']", + "kind": "value" + } + ] + } + ] + }, + { + "name": "HdsFormTextInputBase", + "sourcePath": "./components/hds/form/text-input/base.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "hasVisibilityToggle", + "type": "boolean", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "isInvalid", + "type": "boolean", + "required": false + }, + { + "name": "isLoading", + "type": "boolean", + "required": false + }, + { + "name": "type", + "type": "'text' | 'email' | 'password' | 'url' | 'date' | 'time' | 'datetime-local' | 'search' | 'month' | 'week' | 'tel'", + "required": false + }, + { + "name": "value", + "type": "string", + "required": false + }, + { + "name": "width", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsFormTextInputField", + "sourcePath": "./components/hds/form/text-input/field.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "hasVisibilityToggle", + "type": "boolean", + "required": false + }, + { + "name": "id", + "type": "string", + "required": false + }, + { + "name": "isInvalid", + "type": "boolean", + "required": false + }, + { + "name": "isLoading", + "type": "boolean", + "required": false + }, + { + "name": "type", + "type": "'text' | 'email' | 'password' | 'url' | 'date' | 'time' | 'datetime-local' | 'search' | 'month' | 'week' | 'tel'", + "required": false + }, + { + "name": "value", + "type": "string", + "required": false + }, + { + "name": "visibilityToggleAriaLabel", + "type": "HdsFormVisibilityToggleSignature['Args']['ariaLabel']", + "required": false + }, + { + "name": "visibilityToggleAriaMessageText", + "type": "HdsFormVisibilityToggleSignature['Args']['ariaMessageText']", + "required": false + }, + { + "name": "width", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "CharacterCount", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsFormCharacterCount", + "sourcePath": "../character-count/index.gts", + "boundArgs": [ + "value" + ] + }, + { + "name": "Error", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Error']", + "kind": "value" + }, + { + "name": "HelperText", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['HelperText']", + "kind": "value" + }, + { + "name": "Label", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Label']", + "kind": "value" + } + ] + } + ] + }, + { + "name": "HdsFormToggleBase", + "sourcePath": "./components/hds/form/toggle/base.gts", + "summary": "TODO", + "args": [ + { + "name": "value", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsFormToggleField", + "sourcePath": "./components/hds/form/toggle/field.gts", + "summary": "TODO", + "args": [ + { + "name": "value", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Error", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Error']", + "kind": "value" + }, + { + "name": "HelperText", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['HelperText']", + "kind": "value" + }, + { + "name": "Label", + "type": "HdsFormFieldSignature['Blocks']['default'][0]['Label']", + "kind": "value" + } + ] + } + ] + }, + { + "name": "HdsFormToggleGroup", + "sourcePath": "./components/hds/form/toggle/group.gts", + "summary": "TODO", + "args": [ + { + "name": "extraAriaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "isOptional", + "type": "boolean", + "required": false + }, + { + "name": "isRequired", + "type": "boolean", + "required": false + }, + { + "name": "layout", + "type": "'vertical' | 'horizontal'", + "required": false + }, + { + "name": "name", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Error", + "type": "HdsFormFieldsetSignature['Blocks']['default'][0]['Error']", + "kind": "value" + }, + { + "name": "HelperText", + "type": "HdsFormFieldsetSignature['Blocks']['default'][0]['HelperText']", + "kind": "value" + }, + { + "name": "Legend", + "type": "HdsFormFieldsetSignature['Blocks']['default'][0]['Legend']", + "kind": "value" + }, + { + "name": "ToggleField", + "type": "WithBoundArgs< typeof HdsFormToggleField, 'contextualClass' | 'isRequired' | 'extraAriaDescribedBy' >", + "kind": "component", + "componentName": "HdsFormToggleField", + "sourcePath": "./field.gts", + "boundArgs": [ + "contextualClass", + "isRequired", + "extraAriaDescribedBy" + ] + } + ] + } + ] + }, + { + "name": "HdsFormVisibilityToggle", + "sourcePath": "./components/hds/form/visibility-toggle/index.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaLabel", + "type": "string", + "required": false + }, + { + "name": "ariaMessageText", + "type": "string", + "required": false + }, + { + "name": "isVisible", + "type": "boolean", + "required": false + } + ] + }, + { + "name": "HdsIcon", + "sourcePath": "./components/hds/icon/index.gts", + "summary": "TODO", + "args": [ + { + "name": "color", + "type": "HdsIconColors | string | undefined", + "required": false + }, + { + "name": "isInline", + "type": "boolean", + "required": false + }, + { + "name": "name", + "type": "IconName", + "required": true + }, + { + "name": "size", + "type": "'16' | '24'", + "required": false + }, + { + "name": "stretched", + "type": "boolean", + "required": false + }, + { + "name": "title", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsIconTile", + "sourcePath": "./components/hds/icon-tile/index.gts", + "summary": "TODO", + "args": [ + { + "name": "color", + "type": "HdsIconTileColors", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "iconSecondary", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "logo", + "type": "'boundary' | 'consul' | 'hcp' | 'nomad' | 'packer' | 'terraform' | 'vagrant' | 'vault' | 'vault-secrets' | 'vault-radar' | 'waypoint'", + "required": false + }, + { + "name": "size", + "type": "'small' | 'medium' | 'large'", + "required": false + } + ] + }, + { + "name": "HdsInteractive", + "sourcePath": "./components/hds/interactive/index.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string | boolean", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "isHrefExternal", + "type": "boolean", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "model", + "type": "unknown", + "required": false + }, + { + "name": "models", + "type": "unknown[]", + "required": false + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsLayoutFlex", + "sourcePath": "./components/hds/layout/flex/index.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'start' | 'center' | 'end' | 'stretch'", + "required": false + }, + { + "name": "direction", + "type": "'row' | 'column'", + "required": false + }, + { + "name": "gap", + "type": "HdsLayoutFlexGaps | [HdsLayoutFlexGaps, HdsLayoutFlexGaps]", + "required": false + }, + { + "name": "isInline", + "type": "boolean", + "required": false + }, + { + "name": "justify", + "type": "'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly'", + "required": false + }, + { + "name": "tag", + "type": "AvailableTagNames", + "required": false + }, + { + "name": "wrap", + "type": "boolean", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Item", + "type": "typeof HdsLayoutFlexItem", + "kind": "component", + "componentName": "HdsLayoutFlexItem", + "sourcePath": "./item.gts" + } + ] + } + ] + }, + { + "name": "HdsLayoutFlexItem", + "sourcePath": "./components/hds/layout/flex/item.gts", + "summary": "TODO", + "args": [ + { + "name": "basis", + "type": "string | 0", + "required": false + }, + { + "name": "enableCollapseBelowContentSize", + "type": "boolean", + "required": false + }, + { + "name": "grow", + "type": "boolean | number | string", + "required": false + }, + { + "name": "shrink", + "type": "boolean | number | string", + "required": false + }, + { + "name": "tag", + "type": "AvailableTagNames", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsLayoutGrid", + "sourcePath": "./components/hds/layout/grid/index.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'start' | 'center' | 'end' | 'stretch'", + "required": false + }, + { + "name": "columnMinWidth", + "type": "string", + "required": false + }, + { + "name": "columnWidth", + "type": "string | ResponsiveColumnWidths", + "required": false + }, + { + "name": "gap", + "type": "HdsLayoutGridGaps | [HdsLayoutGridGaps, HdsLayoutGridGaps]", + "required": false + }, + { + "name": "tag", + "type": "AvailableTagNames", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Item", + "type": "typeof HdsLayoutGridItem", + "kind": "component", + "componentName": "HdsLayoutGridItem", + "sourcePath": "./item.gts" + } + ] + } + ] + }, + { + "name": "HdsLayoutGridItem", + "sourcePath": "./components/hds/layout/grid/item.gts", + "summary": "TODO", + "args": [ + { + "name": "colspan", + "type": "number | ResponsiveSpan", + "required": false + }, + { + "name": "rowspan", + "type": "number | ResponsiveSpan", + "required": false + }, + { + "name": "tag", + "type": "AvailableTagNames", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsLinkInline", + "sourcePath": "./components/hds/link/inline.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string | boolean", + "required": false + }, + { + "name": "color", + "type": "'primary' | 'secondary'", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "iconPosition", + "type": "'leading' | 'trailing'", + "required": false + }, + { + "name": "isHrefExternal", + "type": "boolean", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "model", + "type": "unknown", + "required": false + }, + { + "name": "models", + "type": "unknown[]", + "required": false + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsLinkStandalone", + "sourcePath": "./components/hds/link/standalone.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string | boolean", + "required": false + }, + { + "name": "color", + "type": "'primary' | 'secondary'", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": true + }, + { + "name": "iconPosition", + "type": "'leading' | 'trailing'", + "required": false + }, + { + "name": "isHrefExternal", + "type": "boolean", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "model", + "type": "unknown", + "required": false + }, + { + "name": "models", + "type": "unknown[]", + "required": false + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + }, + { + "name": "size", + "type": "'small' | 'medium' | 'large'", + "required": false + }, + { + "name": "text", + "type": "string", + "required": true + } + ] + }, + { + "name": "HdsModal", + "sourcePath": "./components/hds/modal/index.gts", + "summary": "TODO", + "args": [ + { + "name": "color", + "type": "'neutral' | 'warning' | 'critical'", + "required": false + }, + { + "name": "isDismissDisabled", + "type": "boolean", + "required": false + }, + { + "name": "onClose", + "type": "(event: Event) => void", + "required": false + }, + { + "name": "onOpen", + "type": "() => void", + "required": false + }, + { + "name": "returnFocusTo", + "type": "string", + "required": false + }, + { + "name": "size", + "type": "'small' | 'medium' | 'large'", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Body", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsDialogPrimitiveBody", + "sourcePath": "../dialog-primitive/body.gts", + "boundArgs": [ + "contextualClass" + ] + }, + { + "name": "Footer", + "type": "WithBoundArgs< typeof HdsDialogPrimitiveFooter, 'onDismiss' | 'contextualClass' >", + "kind": "component", + "componentName": "HdsDialogPrimitiveFooter", + "sourcePath": "../dialog-primitive/footer.gts", + "boundArgs": [ + "onDismiss", + "contextualClass" + ] + }, + { + "name": "Header", + "type": "WithBoundArgs< typeof HdsDialogPrimitiveHeader, 'id' | 'onDismiss' | 'contextualClassPrefix' >", + "kind": "component", + "componentName": "HdsDialogPrimitiveHeader", + "sourcePath": "../dialog-primitive/header.gts", + "boundArgs": [ + "id", + "onDismiss", + "contextualClassPrefix" + ] + } + ] + } + ] + }, + { + "name": "HdsPageHeader", + "sourcePath": "./components/hds/page-header/index.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Actions", + "type": "typeof HdsPageHeaderActions", + "kind": "component", + "componentName": "HdsPageHeaderActions", + "sourcePath": "./actions.gts" + }, + { + "name": "Badges", + "type": "typeof HdsPageHeaderBadges", + "kind": "component", + "componentName": "HdsPageHeaderBadges", + "sourcePath": "./badges.gts" + }, + { + "name": "Breadcrumb", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../yield/index.gts" + }, + { + "name": "Description", + "type": "typeof HdsPageHeaderDescription", + "kind": "component", + "componentName": "HdsPageHeaderDescription", + "sourcePath": "./description.gts" + }, + { + "name": "Generic", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../yield/index.gts" + }, + { + "name": "IconTile", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsIconTile", + "sourcePath": "../icon-tile/index.gts", + "boundArgs": [ + "size" + ] + }, + { + "name": "Subtitle", + "type": "typeof HdsPageHeaderSubtitle", + "kind": "component", + "componentName": "HdsPageHeaderSubtitle", + "sourcePath": "./subtitle.gts" + }, + { + "name": "Title", + "type": "typeof HdsPageHeaderTitle", + "kind": "component", + "componentName": "HdsPageHeaderTitle", + "sourcePath": "./title.gts" + } + ] + } + ] + }, + { + "name": "HdsPageHeaderActions", + "sourcePath": "./components/hds/page-header/actions.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsPageHeaderBadges", + "sourcePath": "./components/hds/page-header/badges.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsPageHeaderDescription", + "sourcePath": "./components/hds/page-header/description.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'left' | 'center' | 'right'", + "required": false + }, + { + "name": "color", + "type": "string | HdsTextColors", + "required": false + }, + { + "name": "size", + "type": "HdsTextBodySizes", + "required": false + }, + { + "name": "tag", + "type": "HdsTextTags", + "required": false + }, + { + "name": "weight", + "type": "HdsTextBodyWeight", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsPageHeaderSubtitle", + "sourcePath": "./components/hds/page-header/subtitle.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'left' | 'center' | 'right'", + "required": false + }, + { + "name": "color", + "type": "string | HdsTextColors", + "required": false + }, + { + "name": "size", + "type": "HdsTextBodySizes", + "required": false + }, + { + "name": "tag", + "type": "HdsTextTags", + "required": false + }, + { + "name": "weight", + "type": "HdsTextBodyWeight", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsPageHeaderTitle", + "sourcePath": "./components/hds/page-header/title.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'left' | 'center' | 'right'", + "required": false + }, + { + "name": "color", + "type": "string | HdsTextColors", + "required": false + }, + { + "name": "size", + "type": "HdsTextSizes", + "required": false + }, + { + "name": "tag", + "type": "HdsTextTags", + "required": false + }, + { + "name": "weight", + "type": "HdsTextDisplayWeight", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsPaginationCompact", + "sourcePath": "./components/hds/pagination/compact/index.gts", + "summary": "TODO" + }, + { + "name": "HdsPaginationInfo", + "sourcePath": "./components/hds/pagination/info/index.gts", + "summary": "TODO", + "args": [ + { + "name": "itemsRangeEnd", + "type": "number", + "required": true + }, + { + "name": "itemsRangeStart", + "type": "number", + "required": true + }, + { + "name": "showTotalItems", + "type": "HdsPaginationNumberedSignature['Args']['showTotalItems']", + "required": false + }, + { + "name": "totalItems", + "type": "HdsPaginationNumberedSignature['Args']['totalItems']", + "required": true + } + ] + }, + { + "name": "HdsPaginationNavArrow", + "sourcePath": "./components/hds/pagination/nav/arrow.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string | boolean", + "required": false + }, + { + "name": "direction", + "type": "'next' | 'prev'", + "required": true + }, + { + "name": "disabled", + "type": "boolean", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "isHrefExternal", + "type": "boolean", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "model", + "type": "unknown", + "required": false + }, + { + "name": "models", + "type": "unknown[]", + "required": false + }, + { + "name": "onClick", + "type": "(direction: HdsPaginationDirections) => void", + "required": false + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + }, + { + "name": "showLabel", + "type": "boolean", + "required": false + } + ] + }, + { + "name": "HdsPaginationNavEllipsis", + "sourcePath": "./components/hds/pagination/nav/ellipsis.gts", + "summary": "TODO" + }, + { + "name": "HdsPaginationNavNumber", + "sourcePath": "./components/hds/pagination/nav/number.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string | boolean", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "isHrefExternal", + "type": "boolean", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "isSelected", + "type": "boolean", + "required": true + }, + { + "name": "model", + "type": "unknown", + "required": false + }, + { + "name": "models", + "type": "unknown[]", + "required": false + }, + { + "name": "onClick", + "type": "(page: number) => void", + "required": true + }, + { + "name": "page", + "type": "number", + "required": true + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsPaginationNumbered", + "sourcePath": "./components/hds/pagination/numbered/index.gts", + "summary": "TODO" + }, + { + "name": "HdsPaginationSizeSelector", + "sourcePath": "./components/hds/pagination/size-selector/index.gts", + "summary": "TODO", + "args": [ + { + "name": "label", + "type": "string", + "required": false + }, + { + "name": "onChange", + "type": "(size: number) => void", + "required": false + }, + { + "name": "pageSizes", + "type": "number[]", + "required": true + }, + { + "name": "selectedSize", + "type": "number", + "required": false + } + ] + }, + { + "name": "HdsPopoverPrimitive", + "sourcePath": "./components/hds/popover-primitive/index.gts", + "summary": "TODO", + "args": [ + { + "name": "boundary", + "type": "HdsAnchoredPositionOptions['boundary']", + "required": false + }, + { + "name": "enableClickEvents", + "type": "boolean", + "required": false + }, + { + "name": "enableSoftEvents", + "type": "boolean", + "required": false + }, + { + "name": "isOpen", + "type": "boolean", + "required": false + }, + { + "name": "onClose", + "type": "() => void", + "required": false + }, + { + "name": "onFocusOut", + "type": "() => void", + "required": false + }, + { + "name": "onOpen", + "type": "() => void", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "boundary", + "type": "HdsAnchoredPositionOptions['boundary']", + "kind": "value" + }, + { + "name": "hidePopover", + "type": "(event?: Event) => void", + "kind": "function" + }, + { + "name": "isOpen", + "type": "boolean", + "kind": "value" + }, + { + "name": "popoverElement", + "type": "HTMLElement", + "kind": "value" + }, + { + "name": "setupPrimitiveContainer", + "type": "ModifierLike", + "kind": "value" + }, + { + "name": "setupPrimitivePopover", + "type": "ModifierLike", + "kind": "value" + }, + { + "name": "setupPrimitiveToggle", + "type": "ModifierLike", + "kind": "value" + }, + { + "name": "showPopover", + "type": "() => void", + "kind": "function" + }, + { + "name": "toggleElement", + "type": "HTMLButtonElement", + "kind": "value" + }, + { + "name": "togglePopover", + "type": "() => void", + "kind": "function" + } + ] + } + ] + }, + { + "name": "HdsReveal", + "sourcePath": "./components/hds/reveal/index.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaDescribedBy", + "type": "string", + "required": false + }, + { + "name": "isOpen", + "type": "HdsRevealToggleButtonSignature['Args']['isOpen']", + "required": false + }, + { + "name": "text", + "type": "HdsRevealToggleButtonSignature['Args']['text']", + "required": true + }, + { + "name": "textWhenOpen", + "type": "HdsRevealToggleButtonSignature['Args']['text']", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsRevealToggleButton", + "sourcePath": "./components/hds/reveal/toggle/button.gts", + "summary": "TODO", + "args": [ + { + "name": "isOpen", + "type": "boolean", + "required": false + }, + { + "name": "text", + "type": "string", + "required": true + } + ] + }, + { + "name": "HdsRichTooltip", + "sourcePath": "./components/hds/rich-tooltip/index.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Bubble", + "type": "WithBoundArgs< typeof HdsRichTooltipBubble, 'arrowId' | 'popoverId' | 'setupPrimitivePopover' | 'isOpen' >", + "kind": "component", + "componentName": "HdsRichTooltipBubble", + "sourcePath": "./bubble.gts", + "boundArgs": [ + "arrowId", + "popoverId", + "setupPrimitivePopover", + "isOpen" + ] + }, + { + "name": "close", + "type": "(event?: Event) => void", + "kind": "function" + }, + { + "name": "isOpen", + "type": "boolean", + "kind": "value" + }, + { + "name": "Toggle", + "type": "WithBoundArgs< typeof HdsRichTooltipToggle, 'popoverId' | 'setupPrimitiveToggle' | 'isOpen' >", + "kind": "component", + "componentName": "HdsRichTooltipToggle", + "sourcePath": "./toggle.gts", + "boundArgs": [ + "popoverId", + "setupPrimitiveToggle", + "isOpen" + ] + } + ] + } + ] + }, + { + "name": "HdsRichTooltipBubble", + "sourcePath": "./components/hds/rich-tooltip/bubble.gts", + "summary": "TODO", + "args": [ + { + "name": "arrowId", + "type": "string", + "required": true + }, + { + "name": "boundary", + "type": "HdsAnchoredPositionOptions['boundary']", + "required": false + }, + { + "name": "enableCollisionDetection", + "type": "HdsAnchoredPositionOptions['enableCollisionDetection']", + "required": false + }, + { + "name": "height", + "type": "string", + "required": false + }, + { + "name": "isOpen", + "type": "boolean", + "required": false + }, + { + "name": "offset", + "type": "HdsAnchoredPositionOptions['offsetOptions']", + "required": false + }, + { + "name": "placement", + "type": "HdsAnchoredPositionOptions['placement']", + "required": false + }, + { + "name": "popoverId", + "type": "string", + "required": true + }, + { + "name": "setupPrimitivePopover", + "type": "ModifierLike", + "required": true + }, + { + "name": "width", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsRichTooltipToggle", + "sourcePath": "./components/hds/rich-tooltip/toggle.gts", + "summary": "TODO", + "args": [ + { + "name": "icon", + "type": "HdsIconSignature['Args']['name']", + "required": false + }, + { + "name": "iconPosition", + "type": "'leading' | 'trailing'", + "required": false + }, + { + "name": "isInline", + "type": "boolean", + "required": false + }, + { + "name": "isOpen", + "type": "boolean", + "required": false + }, + { + "name": "popoverId", + "type": "string", + "required": true + }, + { + "name": "setupPrimitiveToggle", + "type": "ModifierLike", + "required": true + }, + { + "name": "size", + "type": "undefined | HdsRichTooltipToggleSizes", + "required": false + }, + { + "name": "text", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsSegmentedGroup", + "sourcePath": "./components/hds/segmented-group/index.gts", + "summary": "TODO", + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Button", + "type": "typeof HdsButton", + "kind": "component", + "componentName": "HdsButton", + "sourcePath": "../button/index.gts" + }, + { + "name": "Dropdown", + "type": "typeof HdsDropdown", + "kind": "component", + "componentName": "HdsDropdown", + "sourcePath": "../dropdown/index.gts" + }, + { + "name": "Generic", + "type": "typeof HdsYield", + "kind": "component", + "componentName": "HdsYield", + "sourcePath": "../yield/index.gts" + }, + { + "name": "Select", + "type": "typeof HdsFormSelectBase", + "kind": "component", + "componentName": "HdsFormSelectBase", + "sourcePath": "../form/select/base.gts" + }, + { + "name": "TextInput", + "type": "typeof HdsFormTextInputBase", + "kind": "component", + "componentName": "HdsFormTextInputBase", + "sourcePath": "../form/text-input/base.gts" + } + ] + } + ] + }, + { + "name": "HdsSeparator", + "sourcePath": "./components/hds/separator/index.gts", + "summary": "TODO", + "args": [ + { + "name": "spacing", + "type": "'0' | '24'", + "required": false + } + ] + }, + { + "name": "HdsStepperList", + "sourcePath": "./components/hds/stepper/list/index.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaLabel", + "type": "string", + "required": true + }, + { + "name": "titleTag", + "type": "'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Step", + "type": "WithBoundArgs< typeof HdsStepperListStep, 'titleTag' | 'stepIds' | 'didInsertNode' | 'willDestroyNode' >", + "kind": "component", + "componentName": "HdsStepperListStep", + "sourcePath": "./step.gts", + "boundArgs": [ + "titleTag", + "stepIds", + "didInsertNode", + "willDestroyNode" + ] + } + ] + } + ] + }, + { + "name": "HdsStepperListStep", + "sourcePath": "./components/hds/stepper/list/step.gts", + "summary": "TODO", + "args": [ + { + "name": "didInsertNode", + "type": "(element: HTMLElement) => void", + "required": false + }, + { + "name": "status", + "type": "'incomplete' | 'progress' | 'processing' | 'complete'", + "required": false + }, + { + "name": "stepIds", + "type": "HdsStepperListStepIds", + "required": false + }, + { + "name": "titleTag", + "type": "'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'", + "required": false + }, + { + "name": "willDestroyNode", + "type": "(element: HTMLElement) => void", + "required": false + } + ], + "blocks": [ + { + "name": "content" + }, + { + "name": "description" + }, + { + "name": "title" + } + ] + }, + { + "name": "HdsStepperNav", + "sourcePath": "./components/hds/stepper/nav/index.gts", + "summary": "TODO", + "args": [ + { + "name": "ariaLabel", + "type": "string", + "required": true + }, + { + "name": "currentStep", + "type": "number", + "required": false + }, + { + "name": "isInteractive", + "type": "boolean", + "required": false + }, + { + "name": "onStepChange", + "type": "(event: MouseEvent, stepNumber: number) => void", + "required": false + }, + { + "name": "steps", + "type": "HdsStepperNavStepType[]", + "required": false + }, + { + "name": "titleTag", + "type": "'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'", + "required": false + } + ], + "blocks": [ + { + "name": "body" + }, + { + "name": "default", + "yields": [ + { + "name": "Panel", + "type": "WithBoundArgs< typeof HdsStepperNavPanel, | 'currentStep' | 'isNavInteractive' | 'stepIds' | 'panelIds' | 'didInsertNode' | 'willDestroyNode' >", + "kind": "component", + "componentName": "HdsStepperNavPanel", + "sourcePath": "./panel.gts", + "boundArgs": [ + "currentStep", + "isNavInteractive", + "stepIds", + "panelIds", + "didInsertNode", + "willDestroyNode" + ] + }, + { + "name": "Step", + "type": "WithBoundArgs< typeof HdsStepperNavStep, | 'currentStep' | 'isNavInteractive' | 'titleTag' | 'stepIds' | 'panelIds' | 'didInsertNode' | 'willDestroyNode' | 'onStepChange' | 'onKeyUp' >", + "kind": "component", + "componentName": "HdsStepperNavStep", + "sourcePath": "./step.gts", + "boundArgs": [ + "currentStep", + "isNavInteractive", + "titleTag", + "stepIds", + "panelIds", + "didInsertNode", + "willDestroyNode", + "onStepChange", + "onKeyUp" + ] + } + ] + } + ] + }, + { + "name": "HdsStepperNavPanel", + "sourcePath": "./components/hds/stepper/nav/panel.gts", + "summary": "TODO", + "args": [ + { + "name": "currentStep", + "type": "number", + "required": true + }, + { + "name": "didInsertNode", + "type": "() => void", + "required": false + }, + { + "name": "isNavInteractive", + "type": "boolean", + "required": false + }, + { + "name": "panelIds", + "type": "HdsStepperNavPanelIds", + "required": false + }, + { + "name": "stepIds", + "type": "HdsStepperNavStepIds", + "required": false + }, + { + "name": "willDestroyNode", + "type": "(element: HTMLElement) => void", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsStepperNavStep", + "sourcePath": "./components/hds/stepper/nav/step.gts", + "summary": "TODO", + "args": [ + { + "name": "currentStep", + "type": "number", + "required": true + }, + { + "name": "didInsertNode", + "type": "() => void", + "required": false + }, + { + "name": "isNavInteractive", + "type": "boolean", + "required": false + }, + { + "name": "onKeyUp", + "type": "(nodeIndex: number, event: KeyboardEvent) => void", + "required": false + }, + { + "name": "onStepChange", + "type": "(event: MouseEvent, nodeIndex: number) => void", + "required": false + }, + { + "name": "panelIds", + "type": "HdsStepperNavPanelIds", + "required": false + }, + { + "name": "stepIds", + "type": "HdsStepperNavStepIds", + "required": false + }, + { + "name": "titleTag", + "type": "'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'", + "required": false + }, + { + "name": "willDestroyNode", + "type": "(element: HTMLButtonElement) => void", + "required": false + } + ], + "blocks": [ + { + "name": "description" + }, + { + "name": "title" + } + ] + }, + { + "name": "HdsStepperStepIndicator", + "sourcePath": "./components/hds/stepper/step/indicator.gts", + "summary": "TODO", + "args": [ + { + "name": "isInteractive", + "type": "boolean", + "required": false + }, + { + "name": "status", + "type": "'incomplete' | 'progress' | 'processing' | 'complete'", + "required": false + }, + { + "name": "text", + "type": "string", + "required": false + } + ] + }, + { + "name": "HdsStepperTaskIndicator", + "sourcePath": "./components/hds/stepper/task/indicator.gts", + "summary": "TODO", + "args": [ + { + "name": "isInteractive", + "type": "boolean", + "required": false + }, + { + "name": "status", + "type": "'incomplete' | 'progress' | 'processing' | 'complete'", + "required": false + } + ] + }, + { + "name": "HdsTable", + "sourcePath": "./components/hds/table/index.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'center' | 'left' | 'right'", + "required": false + }, + { + "name": "caption", + "type": "string", + "required": false + }, + { + "name": "columns", + "type": "HdsTableColumn[]", + "required": false + }, + { + "name": "density", + "type": "'default' | 'medium' | 'short' | 'tall'", + "required": false + }, + { + "name": "identityKey", + "type": "string", + "required": false + }, + { + "name": "isFixedLayout", + "type": "boolean", + "required": false + }, + { + "name": "isSelectable", + "type": "boolean", + "required": false + }, + { + "name": "isStriped", + "type": "boolean", + "required": false + }, + { + "name": "model", + "type": "T[]", + "required": false + }, + { + "name": "onSelectionChange", + "type": "(selection: HdsTableOnSelectionChangeSignature) => void", + "required": false + }, + { + "name": "onSort", + "type": "(sortBy: string, sortOrder: HdsTableThSortOrder) => void", + "required": false + }, + { + "name": "selectableColumnKey", + "type": "string", + "required": false + }, + { + "name": "selectionAriaLabelSuffix", + "type": "string", + "required": false + }, + { + "name": "sortBy", + "type": "string", + "required": false + }, + { + "name": "sortedMessageText", + "type": "string", + "required": false + }, + { + "name": "sortOrder", + "type": "'asc' | 'desc'", + "required": false + }, + { + "name": "valign", + "type": "'baseline' | 'middle' | 'top'", + "required": false + } + ], + "blocks": [ + { + "name": "body", + "yields": [ + { + "name": "data", + "type": "T", + "kind": "value" + }, + { + "name": "rowIndex", + "type": "number", + "kind": "value" + }, + { + "name": "sortBy", + "type": "string", + "kind": "value" + }, + { + "name": "sortOrder", + "type": "'asc' | 'desc'", + "kind": "value" + }, + { + "name": "Td", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsTableTd", + "sourcePath": "./td.gts", + "boundArgs": [ + "align" + ] + }, + { + "name": "Th", + "type": "WithBoundArgs", + "kind": "component", + "componentName": "HdsTableTh", + "sourcePath": "./th.gts", + "boundArgs": [ + "scope" + ] + }, + { + "name": "Tr", + "type": "WithBoundArgs< typeof HdsTableTr, | 'selectionScope' | 'isSelectable' | 'onSelectionChange' | 'didInsert' | 'willDestroy' | 'selectionAriaLabelSuffix' >", + "kind": "component", + "componentName": "HdsTableTr", + "sourcePath": "./tr.gts", + "boundArgs": [ + "selectionScope", + "isSelectable", + "onSelectionChange", + "didInsert", + "willDestroy", + "selectionAriaLabelSuffix" + ] + } + ] + }, + { + "name": "head", + "yields": [ + { + "name": "setSortBy", + "type": "(column: string) => void", + "kind": "function" + }, + { + "name": "sortBy", + "type": "string", + "kind": "value" + }, + { + "name": "sortOrder", + "type": "'asc' | 'desc'", + "kind": "value" + }, + { + "name": "Th", + "type": "typeof HdsTableTh", + "kind": "component", + "componentName": "HdsTableTh", + "sourcePath": "./th.gts" + }, + { + "name": "ThSort", + "type": "typeof HdsTableThSort", + "kind": "component", + "componentName": "HdsTableThSort", + "sourcePath": "./th-sort.gts" + }, + { + "name": "Tr", + "type": "WithBoundArgs< typeof HdsTableTr, | 'selectionScope' | 'isSelectable' | 'onSelectionChange' | 'didInsert' | 'willDestroy' | 'selectionAriaLabelSuffix' | 'onClickSortBySelected' | 'sortBySelectedOrder' >", + "kind": "component", + "componentName": "HdsTableTr", + "sourcePath": "./tr.gts", + "boundArgs": [ + "selectionScope", + "isSelectable", + "onSelectionChange", + "didInsert", + "willDestroy", + "selectionAriaLabelSuffix", + "onClickSortBySelected", + "sortBySelectedOrder" + ] + } + ] + } + ] + }, + { + "name": "HdsTableTd", + "sourcePath": "./components/hds/table/td.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'center' | 'left' | 'right'", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsTableTh", + "sourcePath": "./components/hds/table/th.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'center' | 'left' | 'right'", + "required": false + }, + { + "name": "isVisuallyHidden", + "type": "boolean", + "required": false + }, + { + "name": "scope", + "type": "'col' | 'row'", + "required": false + }, + { + "name": "tooltip", + "type": "string", + "required": false + }, + { + "name": "width", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsTableThButtonSort", + "sourcePath": "./components/hds/table/th-button-sort.gts", + "summary": "TODO", + "args": [ + { + "name": "labelId", + "type": "string", + "required": false + }, + { + "name": "onClick", + "type": "() => void", + "required": false + }, + { + "name": "sortOrder", + "type": "'asc' | 'desc'", + "required": false + } + ] + }, + { + "name": "HdsTableThButtonTooltip", + "sourcePath": "./components/hds/table/th-button-tooltip.gts", + "summary": "TODO", + "args": [ + { + "name": "labelId", + "type": "string", + "required": false + }, + { + "name": "tooltip", + "type": "string", + "required": true + } + ] + }, + { + "name": "HdsTableThSelectable", + "sourcePath": "./components/hds/table/th-selectable.gts", + "summary": "TODO", + "args": [ + { + "name": "didInsert", + "type": "( checkbox: HdsFormCheckboxBaseSignature['Element'], selectionKey?: string ) => void", + "required": false + }, + { + "name": "isSelected", + "type": "boolean", + "required": false + }, + { + "name": "onClickSortBySelected", + "type": "() => void", + "required": false + }, + { + "name": "onSelectionChange", + "type": "( target: HdsFormCheckboxBaseSignature['Element'], selectionKey: string | undefined ) => void", + "required": false + }, + { + "name": "selectionAriaLabelSuffix", + "type": "string", + "required": false + }, + { + "name": "selectionKey", + "type": "string", + "required": false + }, + { + "name": "selectionScope", + "type": "'col' | 'row'", + "required": false + }, + { + "name": "sortBySelectedOrder", + "type": "'asc' | 'desc'", + "required": false + }, + { + "name": "willDestroy", + "type": "(selectionKey?: string) => void", + "required": false + } + ] + }, + { + "name": "HdsTableThSort", + "sourcePath": "./components/hds/table/th-sort.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'center' | 'left' | 'right'", + "required": false + }, + { + "name": "onClickSort", + "type": "HdsTableThButtonSortSignature['Args']['onClick']", + "required": false + }, + { + "name": "sortOrder", + "type": "'asc' | 'desc'", + "required": false + }, + { + "name": "tooltip", + "type": "string", + "required": false + }, + { + "name": "width", + "type": "string", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsTableTr", + "sourcePath": "./components/hds/table/tr.gts", + "summary": "TODO", + "args": [ + { + "name": "didInsert", + "type": "( checkbox: HdsFormCheckboxBaseSignature['Element'], selectionKey?: string ) => void", + "required": false + }, + { + "name": "isSelectable", + "type": "boolean", + "required": false + }, + { + "name": "isSelected", + "type": "boolean", + "required": false + }, + { + "name": "onClickSortBySelected", + "type": "HdsTableThSelectableSignature['Args']['onClickSortBySelected']", + "required": false + }, + { + "name": "onSelectionChange", + "type": "( checkbox?: HdsFormCheckboxBaseSignature['Element'], selectionKey?: string ) => void", + "required": false + }, + { + "name": "selectableColumnKey", + "type": "HdsTableSignature['Args']['selectableColumnKey']", + "required": false + }, + { + "name": "selectionAriaLabelSuffix", + "type": "string", + "required": false + }, + { + "name": "selectionKey", + "type": "string", + "required": false + }, + { + "name": "selectionScope", + "type": "'col' | 'row'", + "required": false + }, + { + "name": "sortBySelectedOrder", + "type": "'asc' | 'desc'", + "required": false + }, + { + "name": "willDestroy", + "type": "() => void", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsTabs", + "sourcePath": "./components/hds/tabs/index.gts", + "summary": "TODO", + "args": [ + { + "name": "isParentVisible", + "type": "boolean", + "required": false + }, + { + "name": "onClickTab", + "type": "(event: MouseEvent, tabIndex: number) => void", + "required": false + }, + { + "name": "selectedTabIndex", + "type": "HdsTabsTabSignature['Args']['selectedTabIndex']", + "required": false + }, + { + "name": "size", + "type": "'medium' | 'large'", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "Panel", + "type": "WithBoundArgs< typeof HdsTabsPanel, | 'selectedTabIndex' | 'tabIds' | 'panelIds' | 'didInsertNode' | 'willDestroyNode' >", + "kind": "component", + "componentName": "HdsTabsPanel", + "sourcePath": "./panel.gts", + "boundArgs": [ + "selectedTabIndex", + "tabIds", + "panelIds", + "didInsertNode", + "willDestroyNode" + ] + }, + { + "name": "Tab", + "type": "WithBoundArgs< typeof HdsTabsTab, | 'selectedTabIndex' | 'tabIds' | 'panelIds' | 'onClick' | 'onKeyUp' | 'didInsertNode' | 'didUpdateNode' | 'willDestroyNode' >", + "kind": "component", + "componentName": "HdsTabsTab", + "sourcePath": "./tab.gts", + "boundArgs": [ + "selectedTabIndex", + "tabIds", + "panelIds", + "onClick", + "onKeyUp", + "didInsertNode", + "didUpdateNode", + "willDestroyNode" + ] + } + ] + } + ] + }, + { + "name": "HdsTabsPanel", + "sourcePath": "./components/hds/tabs/panel.gts", + "summary": "TODO", + "args": [ + { + "name": "didInsertNode", + "type": "(element: HTMLElement, elementId: string) => void", + "required": false + }, + { + "name": "panelIds", + "type": "HdsTabsPanelIds", + "required": false + }, + { + "name": "selectedTabIndex", + "type": "HdsTabsTabSignature['Args']['selectedTabIndex']", + "required": false + }, + { + "name": "tabIds", + "type": "HdsTabsTabIds", + "required": false + }, + { + "name": "willDestroyNode", + "type": "(element: HTMLElement) => void", + "required": false + } + ], + "blocks": [ + { + "name": "default", + "yields": [ + { + "name": "isVisible", + "type": "boolean", + "kind": "value" + } + ] + } + ] + }, + { + "name": "HdsTabsTab", + "sourcePath": "./components/hds/tabs/tab.gts", + "summary": "TODO", + "args": [ + { + "name": "count", + "type": "string", + "required": false + }, + { + "name": "didInsertNode", + "type": "(element: HTMLButtonElement, isSelected?: boolean) => void", + "required": false + }, + { + "name": "didUpdateNode", + "type": "(nodeIndex: number, isSelected?: boolean) => void", + "required": false + }, + { + "name": "icon", + "type": "IconName", + "required": false + }, + { + "name": "isSelected", + "type": "boolean", + "required": false + }, + { + "name": "onClick", + "type": "(event: MouseEvent, tabIndex: number) => void", + "required": false + }, + { + "name": "onKeyUp", + "type": "(nodeIndex: number, event: KeyboardEvent) => void", + "required": false + }, + { + "name": "panelIds", + "type": "HdsTabsPanelIds", + "required": false + }, + { + "name": "selectedTabIndex", + "type": "number", + "required": false + }, + { + "name": "tabIds", + "type": "HdsTabsTabIds", + "required": false + }, + { + "name": "willDestroyNode", + "type": "(element: HTMLButtonElement) => void", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsTag", + "sourcePath": "./components/hds/tag/index.gts", + "summary": "TODO", + "args": [ + { + "name": "'current-when'", + "type": "string | boolean", + "required": false + }, + { + "name": "ariaLabel", + "type": "string", + "required": false + }, + { + "name": "color", + "type": "'primary' | 'secondary'", + "required": false + }, + { + "name": "href", + "type": "string", + "required": false + }, + { + "name": "isHrefExternal", + "type": "boolean", + "required": false + }, + { + "name": "isRouteExternal", + "type": "boolean", + "required": false + }, + { + "name": "model", + "type": "unknown", + "required": false + }, + { + "name": "models", + "type": "unknown[]", + "required": false + }, + { + "name": "onDismiss", + "type": "(event: MouseEvent, ...args: any[]) => void", + "required": false + }, + { + "name": "query", + "type": "Record", + "required": false + }, + { + "name": "replace", + "type": "boolean", + "required": false + }, + { + "name": "route", + "type": "string", + "required": false + }, + { + "name": "text", + "type": "string", + "required": true + }, + { + "name": "tooltipPlacement", + "type": "'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end'", + "required": false + } + ] + }, + { + "name": "HdsText", + "sourcePath": "./components/hds/text/index.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'left' | 'center' | 'right'", + "required": false + }, + { + "name": "color", + "type": "HdsTextColors | string | undefined", + "required": false + }, + { + "name": "group", + "type": "'code' | 'display' | 'body'", + "required": true + }, + { + "name": "size", + "type": "HdsTextSizes", + "required": true + }, + { + "name": "tag", + "type": "HdsTextTags", + "required": false + }, + { + "name": "weight", + "type": "'regular' | 'medium' | 'semibold' | 'bold'", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsTextBody", + "sourcePath": "./components/hds/text/body.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'left' | 'center' | 'right'", + "required": false + }, + { + "name": "color", + "type": "string | HdsTextColors", + "required": false + }, + { + "name": "size", + "type": "HdsTextBodySizes", + "required": false + }, + { + "name": "tag", + "type": "HdsTextTags", + "required": false + }, + { + "name": "weight", + "type": "HdsTextBodyWeight", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsTextCode", + "sourcePath": "./components/hds/text/code.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'left' | 'center' | 'right'", + "required": false + }, + { + "name": "color", + "type": "string | HdsTextColors", + "required": false + }, + { + "name": "size", + "type": "HdsTextCodeSizes", + "required": false + }, + { + "name": "tag", + "type": "HdsTextTags", + "required": false + }, + { + "name": "weight", + "type": "HdsTextCodeWeight", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsTextDisplay", + "sourcePath": "./components/hds/text/display.gts", + "summary": "TODO", + "args": [ + { + "name": "align", + "type": "'left' | 'center' | 'right'", + "required": false + }, + { + "name": "color", + "type": "string | HdsTextColors", + "required": false + }, + { + "name": "size", + "type": "HdsTextSizes", + "required": false + }, + { + "name": "tag", + "type": "HdsTextTags", + "required": false + }, + { + "name": "weight", + "type": "HdsTextDisplayWeight", + "required": false + } + ], + "blocks": [ + { + "name": "default" + } + ] + }, + { + "name": "HdsTime", + "sourcePath": "./components/hds/time/index.gts", + "summary": "TODO", + "args": [ + { + "name": "date", + "type": "Date | string", + "required": false + }, + { + "name": "display", + "type": "'utc' | 'relative' | 'friendly-only' | 'friendly-local' | 'friendly-relative'", + "required": false + }, + { + "name": "endDate", + "type": "Date | string", + "required": false + }, + { + "name": "hasTooltip", + "type": "boolean", + "required": false + }, + { + "name": "isOpen", + "type": "boolean", + "required": false + }, + { + "name": "isoUtcString", + "type": "string", + "required": false + }, + { + "name": "startDate", + "type": "Date | string", + "required": false + } + ] + }, + { + "name": "HdsTimeRange", + "sourcePath": "./components/hds/time/range.gts", + "summary": "TODO", + "args": [ + { + "name": "endDate", + "type": "Date", + "required": false + }, + { + "name": "startDate", + "type": "Date", + "required": false + } + ] + }, + { + "name": "HdsTimeSingle", + "sourcePath": "./components/hds/time/single.gts", + "summary": "TODO", + "args": [ + { + "name": "date", + "type": "Date", + "required": false + }, + { + "name": "display", + "type": "DisplayType", + "required": true + }, + { + "name": "isoUtcString", + "type": "string", + "required": false + }, + { + "name": "register", + "type": "() => void", + "required": true + }, + { + "name": "unregister", + "type": "() => void", + "required": true + } + ] + }, + { + "name": "HdsToast", + "sourcePath": "./components/hds/toast/index.gts", + "summary": "TODO" + }, + { + "name": "HdsTooltipButton", + "sourcePath": "./components/hds/tooltip-button/index.gts", + "summary": "TODO", + "args": [ + { + "name": "extraTippyOptions", + "type": "Partial>", + "required": false + }, + { + "name": "isInline", + "type": "boolean", + "required": false + }, + { + "name": "offset", + "type": "[number, number]", + "required": false + }, + { + "name": "placement", + "type": "'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end'", + "required": false + }, + { + "name": "text", + "type": "string", + "required": true + } + ], + "blocks": [ + { + "name": "default" + } + ] + } + ] +} diff --git a/packages/mcp/src/catalogs/components/schema.ts b/packages/mcp/src/catalogs/components/schema.ts new file mode 100644 index 00000000000..be9c1f2552a --- /dev/null +++ b/packages/mcp/src/catalogs/components/schema.ts @@ -0,0 +1,59 @@ +/** + * Copyright IBM Corp. 2021, 2025 + * SPDX-License-Identifier: MPL-2.0 + */ + +import { z } from "zod"; + +const catalogArgSchema = z.object({ + name: z.string().min(1), + type: z.string().min(1), + required: z.boolean().optional(), + summary: z.string().optional(), + description: z.string().optional(), + default: z.string().optional(), +}); + +const catalogBlockYieldSchema = z.object({ + name: z.string().min(1), + type: z.string().min(1), + kind: z.enum(["component", "function", "value"]).optional(), + componentName: z.string().min(1).optional(), + sourcePath: z.string().min(1).optional(), + boundArgs: z.array(z.string().min(1)).optional(), + summary: z.string().optional(), + description: z.string().optional(), +}); + +const catalogBlockSchema = z.object({ + name: z.string().min(1), + summary: z.string().optional(), + description: z.string().optional(), + yields: z.array(catalogBlockYieldSchema).optional(), +}); + +const catalogDesignSchema = z.object({ + figmaUrl: z.string().url(), + nodeId: z.string().min(1).optional(), + fileKey: z.string().min(1).optional(), +}); + +const catalogComponentSchema = z.object({ + name: z.string().min(1), + sourcePath: z.string().min(1), + summary: z.string().min(1), + docSourcePath: z.string().min(1).optional(), + docEnrichedAt: z.string().datetime().optional(), + design: catalogDesignSchema.optional(), + args: z.array(catalogArgSchema).optional(), + blocks: z.array(catalogBlockSchema).optional(), + examples: z.array(z.string()).optional(), +}); + +export const componentCatalogSchema = z.object({ + updatedAt: z.string().datetime().optional(), + components: z.array(catalogComponentSchema), +}); + +export type ComponentCatalog = z.infer; +export type ComponentCatalogComponent = ComponentCatalog["components"][number]; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bb3a7010298..401bfde1b88 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -269,6 +269,15 @@ importers: babel-plugin-ember-template-compilation: specifier: ^2.4.1 version: 2.4.1 + boxen: + specifier: ^8.0.1 + version: 8.0.1 + chalk: + specifier: ^5.4.1 + version: 5.4.1 + cli-table3: + specifier: ^0.6.5 + version: 0.6.5 concurrently: specifier: ^9.1.2 version: 9.2.0 @@ -305,6 +314,12 @@ importers: globals: specifier: ^16.0.0 version: 16.3.0 + log-symbols: + specifier: ^7.0.1 + version: 7.0.1 + ora: + specifier: ^9.4.1 + version: 9.4.1 postcss: specifier: ^8.5.10 version: 8.5.15 @@ -314,6 +329,9 @@ importers: prettier-plugin-ember-template-tag: specifier: ^2.0.5 version: 2.1.0(prettier@3.6.2) + prettier-plugin-jsdoc: + specifier: ^1.8.1 + version: 1.8.1(prettier@3.6.2) rollup: specifier: ^4.59.0 version: 4.59.0 @@ -335,6 +353,9 @@ importers: stylelint-config-standard-scss: specifier: ^14.0.0 version: 14.0.0(postcss@8.5.15)(stylelint@16.23.0(typescript@5.9.2)) + ts-morph: + specifier: ^28.0.0 + version: 28.0.0 typescript: specifier: ^5.8.2 version: 5.9.2 @@ -2691,18 +2712,10 @@ packages: resolution: {integrity: sha512-bkOp+iumZCCbt1K1CmWf0R9pM5yKpDv+ZXtvSyQpudrI9kuFLp+bM2WOPXImuD/ceQuaa8f5pj93Y7zyECIGNA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/eslintrc@2.1.4': - resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@eslint/eslintrc@3.3.1': resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@8.57.1': - resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@eslint/js@9.32.0': resolution: {integrity: sha512-BBpRFZK3eX6uMLKz8WxFOBIFFcGFJ/g8XuwjTHCqHROSIsopI+ddn/d5Cfh36+7+e5edVS8dbSHnBNhrLEX0zg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -2943,19 +2956,10 @@ packages: resolution: {integrity: sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==} engines: {node: '>=18.18.0'} - '@humanwhocodes/config-array@0.13.0': - resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==} - engines: {node: '>=10.10.0'} - deprecated: Use @eslint/config-array instead - '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - '@humanwhocodes/object-schema@2.0.3': - resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} - deprecated: Use @eslint/object-schema instead - '@humanwhocodes/retry@0.3.1': resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} engines: {node: '>=18.18'} @@ -3606,6 +3610,9 @@ packages: '@tootallnate/quickjs-emscripten@0.23.0': resolution: {integrity: sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==} + '@ts-morph/common@0.29.0': + resolution: {integrity: sha512-35oUmphHbJvQ/+UTwFNme/t2p3FoKiGJ5auTjjpNTop2dyREspirjMy82PLSC1pnDJ8ah1GU98hwpVt64YXQsg==} + '@tsconfig/ember@3.0.11': resolution: {integrity: sha512-c9uaKBN4KxtdT/UNPPxoWghyoDsTRHzYb53Z5Fv9eum+4cok0U+hYwyKNjvCxkBjEPECS8QAyp8nGAhRifZnBQ==} deprecated: Please use @ember/app-tsconfig or @ember/library-tsconfig instead. These live at https://github.com/ember-cli/tsconfigs @@ -4260,6 +4267,9 @@ packages: resolution: {integrity: sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==} engines: {node: '>=0.4.2'} + ansi-align@3.0.1: + resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==} + ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} @@ -4297,6 +4307,10 @@ packages: resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} engines: {node: '>=12'} + ansi-regex@6.2.2: + resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} + engines: {node: '>=12'} + ansi-sequence-parser@1.1.3: resolution: {integrity: sha512-+fksAx9eG3Ab6LDnLs3ZqZa8KVJ/jYnX+D4Qe1azX+LFGFAXqynCQLOdLpNYN/l9e7l6hMWwZbrnctqr6eSQSw==} @@ -4837,6 +4851,9 @@ packages: big.js@5.2.2: resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==} + binary-searching@2.0.5: + resolution: {integrity: sha512-v4N2l3RxL+m4zDxyxz3Ne2aTmiPn8ZUpKFpdPtO+ItW1NcTCXA7JeHG5GMBSvoKSkQZ9ycS+EouDVxYB9ufKWA==} + binaryextensions@2.3.0: resolution: {integrity: sha512-nAihlQsYGyc5Bwq6+EsubvANYGExeJKHDO3RjnvwU042fawQTQfM3Kxn7IHUXQOz4bzfwsGYYHGSvXyW4zOGLg==} engines: {node: '>=0.8'} @@ -4863,6 +4880,10 @@ packages: boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} + boxen@8.0.1: + resolution: {integrity: sha512-F3PH5k5juxom4xktynS7MoFY+NUWH5LC4CnH11YB8NPew+HLpmBLCybSAEyb2F+4pRXhuhWqFesoQd6DAyc2hw==} + engines: {node: '>=18'} + brace-expansion@1.1.13: resolution: {integrity: sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==} @@ -5150,6 +5171,10 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} + camelcase@8.0.0: + resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} + engines: {node: '>=16'} + can-symlink@1.0.0: resolution: {integrity: sha512-RbsNrFyhwkx+6psk/0fK/Q9orOUr9VMxohGd8vTa4djf4TGLfblBgUfqZChrZuW0Q+mz2eBPFLusw9Jfukzmhg==} hasBin: true @@ -5194,6 +5219,10 @@ packages: resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + change-case@5.4.4: resolution: {integrity: sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==} @@ -5287,6 +5316,10 @@ packages: resolution: {integrity: sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw==} engines: {node: '>=8'} + cli-boxes@3.0.0: + resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==} + engines: {node: '>=10'} + cli-cursor@2.1.0: resolution: {integrity: sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==} engines: {node: '>=4'} @@ -5303,6 +5336,10 @@ packages: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} + cli-spinners@3.4.0: + resolution: {integrity: sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==} + engines: {node: '>=18.20'} + cli-table3@0.6.5: resolution: {integrity: sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==} engines: {node: 10.* || >= 12.*} @@ -5355,6 +5392,9 @@ packages: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + code-block-writer@13.0.3: + resolution: {integrity: sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==} + codemirror-lang-hcl@0.0.0-beta.2: resolution: {integrity: sha512-R3ew7Z2EYTdHTMXsWKBW9zxnLoLPYO+CrAa3dPZjXLrIR96Q3GR4cwJKF7zkSsujsnWgwRQZonyWpXYXfhQYuQ==} @@ -5460,6 +5500,10 @@ packages: resolution: {integrity: sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==} engines: {node: '>= 6'} + comment-parser@1.4.7: + resolution: {integrity: sha512-0h+uSNtQGW3D98eQt3jJ8L06Fves8hncB4V/PKdw/Qb8Hnk19VaKuTr55UNRYiSoVa7WwrFls+rh3ux9agmkeQ==} + engines: {node: '>= 12.0.0'} + common-ancestor-path@1.0.1: resolution: {integrity: sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==} @@ -6285,10 +6329,6 @@ packages: resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} engines: {node: '>=0.10.0'} - doctrine@3.0.0: - resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} - engines: {node: '>=6.0.0'} - dom-element-descriptors@0.5.1: resolution: {integrity: sha512-DLayMRQ+yJaziF4JJX1FMjwjdr7wdTr1y9XvZ+NfHELfOMcYDnCHneAYXAS4FT1gLILh4V0juMZohhH1N5FsoQ==} @@ -7055,12 +7095,6 @@ packages: resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@8.57.1: - resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. - hasBin: true - eslint@9.32.0: resolution: {integrity: sha512-LSehfdpgMeWcTZkWZVIJl+tkZ2nuSkyyB9C27MZqFWXuph7DvaowgcTvKqxvpLW1JZIk8PN7hFY3Rj9LQ7m7lg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -7079,10 +7113,6 @@ packages: resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - espree@9.6.1: - resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - esprima@3.0.0: resolution: {integrity: sha512-xoBq/MIShSydNZOkjkoCEjqod963yHNXTLC40ypBhop6yPqflPz/vTinmCfSrGcywVLnSftRf6a0kJLdFdzemw==} engines: {node: '>=0.10.0'} @@ -7305,10 +7335,6 @@ packages: resolution: {integrity: sha512-AVSwsnbV8vH/UVbvgEhf3saVQXORNv0ZzSkvkhQIaia5Tia+JhGTaa/ePUSVoPHQyGayQNmYfkzFi3WZV5zcpA==} engines: {node: '>=4'} - file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} - file-entry-cache@8.0.0: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} @@ -7400,10 +7426,6 @@ packages: resolution: {integrity: sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==} engines: {node: '>=4'} - flat-cache@3.2.0: - resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} - engines: {node: ^10.12.0 || >=12.0.0} - flat-cache@4.0.1: resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} engines: {node: '>=16'} @@ -7551,6 +7573,10 @@ packages: resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==} engines: {node: '>=18'} + get-east-asian-width@1.6.0: + resolution: {integrity: sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==} + engines: {node: '>=18'} + get-intrinsic@1.3.0: resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} engines: {node: '>= 0.4'} @@ -7677,10 +7703,6 @@ packages: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} - globals@13.24.0: - resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} - engines: {node: '>=8'} - globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} @@ -8300,10 +8322,6 @@ packages: resolution: {integrity: sha512-kyiNFFLU0Ampr6SDZitD/DwUo4Zs1nSdnygUBqsu3LooL00Qvb5j+UnvApUn/TTj1J3OuE6BTdQ5rudKmU2ZaA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - is-path-inside@3.0.3: - resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} - engines: {node: '>=8'} - is-path-inside@4.0.0: resolution: {integrity: sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==} engines: {node: '>=12'} @@ -8926,6 +8944,10 @@ packages: resolution: {integrity: sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==} engines: {node: '>=18'} + log-symbols@7.0.1: + resolution: {integrity: sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==} + engines: {node: '>=18'} + longest-streak@2.0.4: resolution: {integrity: sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==} @@ -9600,6 +9622,10 @@ packages: resolution: {integrity: sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==} engines: {node: '>=18'} + ora@9.4.1: + resolution: {integrity: sha512-6VlU9MLXbjVQD04AZCMX28hVtA5bUoadvUqO76MUCVA0ilwJbMiHsITRPfyVm6p/BC0Av/BXMujx39WCe1LEqw==} + engines: {node: '>=20'} + os-homedir@1.0.2: resolution: {integrity: sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==} engines: {node: '>=0.10.0'} @@ -10062,6 +10088,12 @@ packages: peerDependencies: prettier: '>= 3.0.0' + prettier-plugin-jsdoc@1.8.1: + resolution: {integrity: sha512-XuMqBWTc3b/8eCOe+OlZlFy9Z413a7WOmF4i5hDGtjbtIFOdvRrVtGjXR2Feye3TrLWhkkkHheNXPTyYKxw3nA==} + engines: {node: '>=14.13.1 || >=16.0.0'} + peerDependencies: + prettier: ^3.0.0 + prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} @@ -10962,6 +10994,10 @@ packages: resolution: {integrity: sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==} engines: {node: '>=18'} + stdin-discarder@0.3.2: + resolution: {integrity: sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==} + engines: {node: '>=18'} + stop-iteration-iterator@1.1.0: resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} engines: {node: '>= 0.4'} @@ -10999,6 +11035,10 @@ packages: resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} engines: {node: '>=18'} + string-width@8.2.1: + resolution: {integrity: sha512-IIaP0g3iy9Cyy18w3M9YcaDudujEAVHKt3a3QJg1+sr/oX96TbaGUubG0hJyCjCBThFH+tFpcIyoUHUn1ogaLA==} + engines: {node: '>=20'} + string.prototype.matchall@4.0.12: resolution: {integrity: sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==} engines: {node: '>= 0.4'} @@ -11050,6 +11090,10 @@ packages: resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} engines: {node: '>=12'} + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + strip-bom-string@1.0.0: resolution: {integrity: sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==} engines: {node: '>=0.10.0'} @@ -11309,9 +11353,6 @@ packages: text-decoder@1.2.3: resolution: {integrity: sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==} - text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - textextensions@2.6.0: resolution: {integrity: sha512-49WtAWS+tcsy93dRt6P0P3AMD2m5PvXRhuEA0kaXos5ZLlujtYmpmFsB+QvWUSxE1ZsstmYXfQ7L40+EcQgpAQ==} engines: {node: '>=0.8'} @@ -11480,6 +11521,9 @@ packages: peerDependencies: typescript: '>=4.0.0' + ts-morph@28.0.0: + resolution: {integrity: sha512-Wp3tnZ2bzwxyTZMtgWVzXDfm7lB1Drz+y9DmmYH/L702PQhPyVrp3pkou3yIz4qjS14GY9kcpmLiOOMvl8oG1g==} + ts-node@10.9.2: resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true @@ -11524,10 +11568,6 @@ packages: resolution: {integrity: sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==} engines: {node: '>=8'} - type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} - engines: {node: '>=10'} - type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} @@ -11987,6 +12027,10 @@ packages: wide-align@1.1.5: resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==} + widest-line@5.0.0: + resolution: {integrity: sha512-c9bZp7b5YtRj2wOe6dlj32MK+Bx/M/d+9VB2SHM1OtsUHR0aV0tdP6DWh/iMt0kWi1t5g1Iudu6hQRNd1A4PVA==} + engines: {node: '>=18'} + word-wrap@1.2.5: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} @@ -12018,6 +12062,10 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} + wrap-ansi@9.0.2: + resolution: {integrity: sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==} + engines: {node: '>=18'} + wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -12151,6 +12199,10 @@ packages: resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} engines: {node: '>=18'} + yoctocolors@2.1.2: + resolution: {integrity: sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==} + engines: {node: '>=18'} + zip-stream@6.0.1: resolution: {integrity: sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==} engines: {node: '>= 14'} @@ -14133,11 +14185,6 @@ snapshots: '@esbuild/win32-x64@0.25.8': optional: true - '@eslint-community/eslint-utils@4.7.0(eslint@8.57.1)': - dependencies: - eslint: 8.57.1 - eslint-visitor-keys: 3.4.3 - '@eslint-community/eslint-utils@4.7.0(eslint@9.32.0)': dependencies: eslint: 9.32.0 @@ -14159,20 +14206,6 @@ snapshots: dependencies: '@types/json-schema': 7.0.15 - '@eslint/eslintrc@2.1.4': - dependencies: - ajv: 6.14.0 - debug: 4.4.1 - espree: 9.6.1 - globals: 13.24.0 - ignore: 5.3.2 - import-fresh: 3.3.1 - js-yaml: 4.1.1 - minimatch: 3.1.5 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - '@eslint/eslintrc@3.3.1': dependencies: ajv: 6.14.0 @@ -14187,8 +14220,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@8.57.1': {} - '@eslint/js@9.32.0': {} '@eslint/object-schema@2.1.6': {} @@ -14657,18 +14688,8 @@ snapshots: '@humanfs/core': 0.19.1 '@humanwhocodes/retry': 0.3.1 - '@humanwhocodes/config-array@0.13.0': - dependencies: - '@humanwhocodes/object-schema': 2.0.3 - debug: 4.4.1 - minimatch: 3.1.5 - transitivePeerDependencies: - - supports-color - '@humanwhocodes/module-importer@1.0.1': {} - '@humanwhocodes/object-schema@2.0.3': {} - '@humanwhocodes/retry@0.3.1': {} '@humanwhocodes/retry@0.4.2': {} @@ -15481,6 +15502,12 @@ snapshots: '@tootallnate/quickjs-emscripten@0.23.0': {} + '@ts-morph/common@0.29.0': + dependencies: + minimatch: 10.2.3 + path-browserify: 1.0.1 + tinyglobby: 0.2.14 + '@tsconfig/ember@3.0.11': {} '@tsconfig/node10@1.0.11': {} @@ -15984,23 +16011,6 @@ snapshots: '@types/node': 22.17.0 optional: true - '@typescript-eslint/eslint-plugin@8.38.0(@typescript-eslint/parser@8.38.0(eslint@8.57.1)(typescript@5.9.2))(eslint@8.57.1)(typescript@5.9.2)': - dependencies: - '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.38.0(eslint@8.57.1)(typescript@5.9.2) - '@typescript-eslint/scope-manager': 8.38.0 - '@typescript-eslint/type-utils': 8.38.0(eslint@8.57.1)(typescript@5.9.2) - '@typescript-eslint/utils': 8.38.0(eslint@8.57.1)(typescript@5.9.2) - '@typescript-eslint/visitor-keys': 8.38.0 - eslint: 8.57.1 - graphemer: 1.4.0 - ignore: 7.0.5 - natural-compare: 1.4.0 - ts-api-utils: 2.1.0(typescript@5.9.2) - typescript: 5.9.2 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/eslint-plugin@8.38.0(@typescript-eslint/parser@8.38.0(eslint@9.32.0)(typescript@5.9.2))(eslint@9.32.0)(typescript@5.9.2)': dependencies: '@eslint-community/regexpp': 4.12.1 @@ -16018,18 +16028,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.38.0(eslint@8.57.1)(typescript@5.9.2)': - dependencies: - '@typescript-eslint/scope-manager': 8.38.0 - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.9.2) - '@typescript-eslint/visitor-keys': 8.38.0 - debug: 4.4.1 - eslint: 8.57.1 - typescript: 5.9.2 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/parser@8.38.0(eslint@9.32.0)(typescript@5.9.2)': dependencies: '@typescript-eslint/scope-manager': 8.38.0 @@ -16060,18 +16058,6 @@ snapshots: dependencies: typescript: 5.9.2 - '@typescript-eslint/type-utils@8.38.0(eslint@8.57.1)(typescript@5.9.2)': - dependencies: - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.9.2) - '@typescript-eslint/utils': 8.38.0(eslint@8.57.1)(typescript@5.9.2) - debug: 4.4.1 - eslint: 8.57.1 - ts-api-utils: 2.1.0(typescript@5.9.2) - typescript: 5.9.2 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/type-utils@8.38.0(eslint@9.32.0)(typescript@5.9.2)': dependencies: '@typescript-eslint/types': 8.38.0 @@ -16102,17 +16088,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.38.0(eslint@8.57.1)(typescript@5.9.2)': - dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@8.57.1) - '@typescript-eslint/scope-manager': 8.38.0 - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.9.2) - eslint: 8.57.1 - typescript: 5.9.2 - transitivePeerDependencies: - - supports-color - '@typescript-eslint/utils@8.38.0(eslint@9.32.0)(typescript@5.9.2)': dependencies: '@eslint-community/eslint-utils': 4.7.0(eslint@9.32.0) @@ -16372,6 +16347,10 @@ snapshots: amdefine@1.0.1: {} + ansi-align@3.0.1: + dependencies: + string-width: 4.2.3 + ansi-colors@4.1.3: {} ansi-escapes@3.2.0: {} @@ -16392,6 +16371,8 @@ snapshots: ansi-regex@6.1.0: {} + ansi-regex@6.2.2: {} + ansi-sequence-parser@1.1.3: {} ansi-styles@2.2.1: {} @@ -17259,6 +17240,8 @@ snapshots: big.js@5.2.2: {} + binary-searching@2.0.5: {} + binaryextensions@2.3.0: {} bl@4.1.0: @@ -17299,6 +17282,17 @@ snapshots: boolbase@1.0.0: {} + boxen@8.0.1: + dependencies: + ansi-align: 3.0.1 + camelcase: 8.0.0 + chalk: 5.4.1 + cli-boxes: 3.0.0 + string-width: 7.2.0 + type-fest: 4.39.0 + widest-line: 5.0.0 + wrap-ansi: 9.0.2 + brace-expansion@1.1.13: dependencies: balanced-match: 1.0.2 @@ -17918,6 +17912,8 @@ snapshots: camelcase@6.3.0: {} + camelcase@8.0.0: {} + can-symlink@1.0.0: dependencies: tmp: 0.0.28 @@ -17969,6 +17965,8 @@ snapshots: chalk@5.4.1: {} + chalk@5.6.2: {} + change-case@5.4.4: {} char-regex@1.0.2: {} @@ -18058,6 +18056,8 @@ snapshots: parent-module: 2.0.0 resolve-from: 5.0.0 + cli-boxes@3.0.0: {} + cli-cursor@2.1.0: dependencies: restore-cursor: 2.0.0 @@ -18072,6 +18072,8 @@ snapshots: cli-spinners@2.9.2: {} + cli-spinners@3.4.0: {} + cli-table3@0.6.5: dependencies: string-width: 4.2.3 @@ -18123,6 +18125,8 @@ snapshots: co@4.6.0: {} + code-block-writer@13.0.3: {} + codemirror-lang-hcl@0.0.0-beta.2: dependencies: '@codemirror/language': 6.11.2 @@ -18226,6 +18230,8 @@ snapshots: has-own-prop: 2.0.0 repeat-string: 1.6.1 + comment-parser@1.4.7: {} + common-ancestor-path@1.0.1: {} common-tags@1.8.2: {} @@ -18967,10 +18973,6 @@ snapshots: dependencies: esutils: 2.0.3 - doctrine@3.0.0: - dependencies: - esutils: 2.0.3 - dom-element-descriptors@0.5.1: {} dom-serializer@0.2.2: @@ -20822,49 +20824,6 @@ snapshots: eslint-visitor-keys@4.2.1: {} - eslint@8.57.1: - dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@8.57.1) - '@eslint-community/regexpp': 4.12.1 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.57.1 - '@humanwhocodes/config-array': 0.13.0 - '@humanwhocodes/module-importer': 1.0.1 - '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.2.1 - ajv: 6.14.0 - chalk: 4.1.2 - cross-spawn: 7.0.6 - debug: 4.4.1 - doctrine: 3.0.0 - escape-string-regexp: 4.0.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 - esquery: 1.6.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 - find-up: 5.0.0 - glob-parent: 6.0.2 - globals: 13.24.0 - graphemer: 1.4.0 - ignore: 5.3.2 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - is-path-inside: 3.0.3 - js-yaml: 4.1.1 - json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 - lodash.merge: 4.6.2 - minimatch: 3.1.5 - natural-compare: 1.4.0 - optionator: 0.9.4 - strip-ansi: 6.0.1 - text-table: 0.2.0 - transitivePeerDependencies: - - supports-color - eslint@9.32.0: dependencies: '@eslint-community/eslint-utils': 4.7.0(eslint@9.32.0) @@ -20913,12 +20872,6 @@ snapshots: acorn-jsx: 5.3.2(acorn@8.15.0) eslint-visitor-keys: 4.2.1 - espree@9.6.1: - dependencies: - acorn: 8.15.0 - acorn-jsx: 5.3.2(acorn@8.15.0) - eslint-visitor-keys: 3.4.3 - esprima@3.0.0: {} esprima@4.0.1: {} @@ -21242,10 +21195,6 @@ snapshots: dependencies: flat-cache: 2.0.1 - file-entry-cache@6.0.1: - dependencies: - flat-cache: 3.2.0 - file-entry-cache@8.0.0: dependencies: flat-cache: 4.0.1 @@ -21385,12 +21334,6 @@ snapshots: rimraf: 2.6.3 write: 1.0.3 - flat-cache@3.2.0: - dependencies: - flatted: 3.4.2 - keyv: 4.5.4 - rimraf: 3.0.2 - flat-cache@4.0.1: dependencies: flatted: 3.4.2 @@ -21578,6 +21521,8 @@ snapshots: get-east-asian-width@1.3.0: {} + get-east-asian-width@1.6.0: {} + get-intrinsic@1.3.0: dependencies: call-bind-apply-helpers: 1.0.2 @@ -21732,10 +21677,6 @@ snapshots: globals@11.12.0: {} - globals@13.24.0: - dependencies: - type-fest: 0.20.2 - globals@14.0.0: {} globals@15.15.0: {} @@ -22443,8 +22384,6 @@ snapshots: is-path-cwd@3.0.0: {} - is-path-inside@3.0.3: {} - is-path-inside@4.0.0: {} is-plain-obj@1.1.0: {} @@ -23275,6 +23214,11 @@ snapshots: chalk: 5.4.1 is-unicode-supported: 1.3.0 + log-symbols@7.0.1: + dependencies: + is-unicode-supported: 2.1.0 + yoctocolors: 2.1.2 + longest-streak@2.0.4: {} longest-streak@3.1.0: {} @@ -24172,6 +24116,17 @@ snapshots: string-width: 7.2.0 strip-ansi: 7.1.0 + ora@9.4.1: + dependencies: + chalk: 5.6.2 + cli-cursor: 5.0.0 + cli-spinners: 3.4.0 + is-interactive: 2.0.0 + is-unicode-supported: 2.1.0 + log-symbols: 7.0.1 + stdin-discarder: 0.3.2 + string-width: 8.2.1 + os-homedir@1.0.2: {} os-locale@5.0.0: @@ -24606,6 +24561,15 @@ snapshots: transitivePeerDependencies: - supports-color + prettier-plugin-jsdoc@1.8.1(prettier@3.6.2): + dependencies: + binary-searching: 2.0.5 + comment-parser: 1.4.7 + mdast-util-from-markdown: 2.0.2 + prettier: 3.6.2 + transitivePeerDependencies: + - supports-color + prettier@2.8.8: {} prettier@3.6.2: {} @@ -25712,6 +25676,8 @@ snapshots: stdin-discarder@0.2.2: {} + stdin-discarder@0.3.2: {} + stop-iteration-iterator@1.1.0: dependencies: es-errors: 1.3.0 @@ -25765,6 +25731,11 @@ snapshots: get-east-asian-width: 1.3.0 strip-ansi: 7.1.0 + string-width@8.2.1: + dependencies: + get-east-asian-width: 1.6.0 + strip-ansi: 7.2.0 + string.prototype.matchall@4.0.12: dependencies: call-bind: 1.0.8 @@ -25846,6 +25817,10 @@ snapshots: dependencies: ansi-regex: 6.1.0 + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.2.2 + strip-bom-string@1.0.0: {} strip-bom@3.0.0: {} @@ -26283,8 +26258,6 @@ snapshots: dependencies: b4a: 1.6.7 - text-table@0.2.0: {} - textextensions@2.6.0: {} thingies@1.21.0(tslib@2.8.1): @@ -26458,6 +26431,11 @@ snapshots: picomatch: 4.0.4 typescript: 5.9.2 + ts-morph@28.0.0: + dependencies: + '@ts-morph/common': 0.29.0 + code-block-writer: 13.0.3 + ts-node@10.9.2(@types/node@22.17.0)(typescript@5.9.2): dependencies: '@cspotcode/source-map-support': 0.8.1 @@ -26504,8 +26482,6 @@ snapshots: type-fest@0.11.0: {} - type-fest@0.20.2: {} - type-fest@0.21.3: {} type-fest@4.39.0: {} @@ -27067,6 +27043,10 @@ snapshots: dependencies: string-width: 4.2.3 + widest-line@5.0.0: + dependencies: + string-width: 7.2.0 + word-wrap@1.2.5: {} wordwrap@1.0.0: {} @@ -27105,6 +27085,12 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.1.0 + wrap-ansi@9.0.2: + dependencies: + ansi-styles: 6.2.1 + string-width: 7.2.0 + strip-ansi: 7.1.0 + wrappy@1.0.2: {} write-file-atomic@2.4.3: @@ -27211,6 +27197,8 @@ snapshots: yoctocolors-cjs@2.1.2: {} + yoctocolors@2.1.2: {} + zip-stream@6.0.1: dependencies: archiver-utils: 5.0.2 diff --git a/tsdocs_exploration.md b/tsdocs_exploration.md new file mode 100644 index 00000000000..43d2767d424 --- /dev/null +++ b/tsdocs_exploration.md @@ -0,0 +1,65 @@ +# Notes on TSDocs exploration + +## The Problem + +We need a way to parse the docs into a JSON document with a strict schema. Our documents are written in a non-standardized method. While we follow the same general patterns across docs, there is enough nuance in how some items are documented that parsing becomes difficult. + +## The Proposal + +Component API documentation should be a deterministic output based on TSDoc comments and defined types. + +## Issues + +### General + +- We need to change the way we use Enums + +### AppHeader + +[Docs](website/docs/components/app-header/partials/code/component-api.md) + +- `a11yRefocusSkipText` + - Default value is in the description +- `a11yRefocusNavigationText` + - Default value is in the description +- `a11yRefocusRouteChangeValidator` + - Remarks included in description + - Incorrectly documented as a string +- `a11yRefocusExcludeAllQueryParams` + - Remarks included in description + - Default not included +- `breakpoint` + - Not formatted as string + +### Alert + +[Types file](packages/components/src/components/hds/alert/index.types.ts) + +- `color` + - Need to reference the enum itself rather than the stringified values +- `icon` + - Let's us correct the type + +### Dropdown + +- We don't always nest dependent attributes +- `enableCollisionDetection` is improperly documented as only a boolean +- We have multiple components documented in one section + - `#### [D].Header / [D].Footer` +- `boundary` + - ` + +## RANDOM THOUGHTS + +- Make this the default for when yielded components fo not have an explicit description: "`Alert::Description` yielded as contextual component (see below)." +- We don't document params for function arguments. +- We have multiple ways of adding "notes" to documentation + - Banners + - Italic text + - "Warning:" + - "Note:" + +## Write-up outline + +- Why cant we just parse the existing docs? +- diff --git a/website/app/components/doc/code-group/index.gts b/website/app/components/doc/code-group/index.gts index edab6489751..edd092a30d4 100644 --- a/website/app/components/doc/code-group/index.gts +++ b/website/app/components/doc/code-group/index.gts @@ -1,5 +1,5 @@ /** - * Copyright IBM Corp. 2021, 2026 + * Copyright (c) HashiCorp, Inc. * SPDX-License-Identifier: MPL-2.0 */ import Component from '@glimmer/component'; @@ -312,12 +312,16 @@ export default class DocCodeGroup extends Component { {{if this.hasFooter 'doc-code-group__code-snippet--has-footer' ''}}" {{this.setCodeElementTabIndex}} > - + {{#if this.fastboot.isFastBoot}} +
{{this.currentSnippet.snippet}}
+ {{else}} + + {{/if}} {{#if this.hasFooter}}