An open source design system that's fully customizable and agent ready
TypeScript
Improve Text docs page and block examples (#1606)
Kenton Quatman13359c9d1e7a
diff --git a/packages/cli/templates/blocks/components/Text/TextCard.doc.mjs b/packages/cli/templates/blocks/components/Text/TextCard.doc.mjsnew file mode 100644index 0000000000..66a92005ea--- /dev/null+++ b/packages/cli/templates/blocks/components/Text/TextCard.doc.mjs@@ -0,0 +1,9 @@+/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */+export const doc = {+ type: 'block',+ name: 'Text — Card',+ description: 'Card layout with a label title, truncated body, and a supporting timestamp showing text hierarchy in a contained space.',+ isReady: true,+ aspectRatio: 16 / 9,+ componentsUsed: ['Text', 'Card', 'Stack'],+};diff --git a/packages/cli/templates/blocks/components/Text/TextCard.tsx b/packages/cli/templates/blocks/components/Text/TextCard.tsxnew file mode 100644index 0000000000..6240dbeafd--- /dev/null+++ b/packages/cli/templates/blocks/components/Text/TextCard.tsx@@ -0,0 +1,22 @@+'use client';++import {XDSText, XDSHeading} from '@xds/core/Text';+import {XDSCard} from '@xds/core/Card';+import {XDSStack} from '@xds/core/Stack';++export default function TextCard() {+ return (+ <XDSCard padding={4}>+ <XDSStack direction="vertical" gap={1}>+ <XDSHeading level={4}>Quarterly design review</XDSHeading>+ <XDSText type="body" maxLines={2} display="block">+ Review the latest component audit results, discuss the new color token+ strategy, and align on the typography scale changes planned for Q2.+ </XDSText>+ <XDSText type="supporting" display="block">+ Updated 5 minutes ago by Sarah Chen+ </XDSText>+ </XDSStack>+ </XDSCard>+ );+}diff --git a/packages/cli/templates/blocks/components/Text/TextColors.doc.mjs b/packages/cli/templates/blocks/components/Text/TextColors.doc.mjsnew file mode 100644index 0000000000..c0c4cc5993--- /dev/null+++ b/packages/cli/templates/blocks/components/Text/TextColors.doc.mjs@@ -0,0 +1,9 @@+/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */+export const doc = {+ type: 'block',+ name: 'Text — Colors',+ description: 'All text color options (primary, secondary, disabled, placeholder, active) applied to body text to show their intended use.',+ isReady: true,+ aspectRatio: 16 / 9,+ componentsUsed: ['Text', 'Stack'],+};diff --git a/packages/cli/templates/blocks/components/Text/TextColors.tsx b/packages/cli/templates/blocks/components/Text/TextColors.tsxnew file mode 100644index 0000000000..8136b731a0--- /dev/null+++ b/packages/cli/templates/blocks/components/Text/TextColors.tsx@@ -0,0 +1,24 @@+'use client';++import {XDSText} from '@xds/core/Text';+import {XDSStack} from '@xds/core/Stack';++const COLORS = [+ {color: 'primary' as const, description: 'Primary — Default for headings and body text'},+ {color: 'secondary' as const, description: 'Secondary — Supporting details and metadata'},+ {color: 'active' as const, description: 'Active — Links, success states, and emphasis'},+ {color: 'disabled' as const, description: 'Disabled — Unavailable or inactive content'},+ {color: 'placeholder' as const, description: 'Placeholder — Empty field hints'},+];++export default function TextColors() {+ return (+ <XDSStack direction="vertical" gap={3}>+ {COLORS.map(({color, description}) => (+ <XDSText key={color} type="body" color={color}>+ {description}+ </XDSText>+ ))}+ </XDSStack>+ );+}diff --git a/packages/cli/templates/blocks/components/Text/TextHeadingLevels.doc.mjs b/packages/cli/templates/blocks/components/Text/TextHeadingLevels.doc.mjsnew file mode 100644index 0000000000..b1b1f1a90a--- /dev/null+++ b/packages/cli/templates/blocks/components/Text/TextHeadingLevels.doc.mjs@@ -0,0 +1,9 @@+/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */+export const doc = {+ type: 'block',+ name: 'Text — Heading Levels',+ description: 'All 6 heading levels (h1 through h6) rendered with XDSHeading to show the full type scale.',+ isReady: true,+ aspectRatio: 16 / 9,+ componentsUsed: ['Text', 'Stack'],+};diff --git a/packages/cli/templates/blocks/components/Text/TextHeadingLevels.tsx b/packages/cli/templates/blocks/components/Text/TextHeadingLevels.tsxnew file mode 100644index 0000000000..effdb871ac--- /dev/null+++ b/packages/cli/templates/blocks/components/Text/TextHeadingLevels.tsx@@ -0,0 +1,18 @@+'use client';++import {XDSHeading} from '@xds/core/Text';+import {XDSStack} from '@xds/core/Stack';++const LEVELS = [1, 2, 3, 4, 5, 6] as const;++export default function TextHeadingLevels() {+ return (+ <XDSStack direction="vertical" gap={3}>+ {LEVELS.map((level) => (+ <XDSHeading key={level} level={level}>+ Heading {level}+ </XDSHeading>+ ))}+ </XDSStack>+ );+}diff --git a/packages/cli/templates/blocks/components/Text/TextHierarchy.doc.mjs b/packages/cli/templates/blocks/components/Text/TextHierarchy.doc.mjsindex acde80767c..40cb5f2965 100644--- a/packages/cli/templates/blocks/components/Text/TextHierarchy.doc.mjs+++ b/packages/cli/templates/blocks/components/Text/TextHierarchy.doc.mjs@@ -1,10 +1,9 @@/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */export const doc = {type: 'block',- name: 'Text — Content Hierarchy',- description:- 'Form-like content sections using label, body, and supporting text types for visual hierarchy.',+ name: 'Text — Hierarchy',+ description: 'Label, body, and supporting text types layered to create a natural reading order without any custom styling.',isReady: true,- aspectRatio: 4 / 3,- componentsUsed: ['Text'],+ aspectRatio: 16 / 9,+ componentsUsed: ['Text', 'Stack'],};diff --git a/packages/cli/templates/blocks/components/Text/TextHierarchy.tsx b/packages/cli/templates/blocks/components/Text/TextHierarchy.tsxindex 212f9c7d9a..883ec759ad 100644--- a/packages/cli/templates/blocks/components/Text/TextHierarchy.tsx+++ b/packages/cli/templates/blocks/components/Text/TextHierarchy.tsx@@ -1,39 +1,35 @@'use client';import {XDSText} from '@xds/core/Text';+import {XDSStack} from '@xds/core/Stack';export default function TextHierarchy() {return (- <div- style={{- maxWidth: 300,- display: 'flex',- flexDirection: 'column',- gap: 16,- }}>- <div>+ <XDSStack direction="vertical" gap={4}>+ <XDSStack direction="vertical" gap={1}><XDSText type="label" display="block">- Section title as label+ Account settings</XDSText><XDSText type="body" display="block">- Body text provides the main content or instructions for this section.+ Manage your profile information, notification preferences, and security+ options from this page.</XDSText><XDSText type="supporting" display="block">- Supporting text adds extra context or constraints.+ Last updated 3 hours ago</XDSText>- </div>- <div>+ </XDSStack>+ <XDSStack direction="vertical" gap={1}><XDSText type="label" display="block">- Another section+ Billing details</XDSText><XDSText type="body" display="block">- These text types create a natural visual hierarchy without any- additional styling.+ Your next invoice of $49.00 is scheduled for January 15, 2025. All+ charges are billed in USD.</XDSText><XDSText type="supporting" color="active" display="block">- Active supporting text draws attention to important details.+ Payment method verified</XDSText>- </div>- </div>+ </XDSStack>+ </XDSStack>);}diff --git a/packages/cli/templates/blocks/components/Text/TextMetrics.doc.mjs b/packages/cli/templates/blocks/components/Text/TextMetrics.doc.mjsnew file mode 100644index 0000000000..0bea4206d2--- /dev/null+++ b/packages/cli/templates/blocks/components/Text/TextMetrics.doc.mjs@@ -0,0 +1,9 @@+/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */+export const doc = {+ type: 'block',+ name: 'Text — Metrics',+ description: 'Dashboard-style metrics using tabular numbers for consistent digit alignment across values.',+ isReady: true,+ aspectRatio: 16 / 9,+ componentsUsed: ['Text', 'Stack'],+};diff --git a/packages/cli/templates/blocks/components/Text/TextMetrics.tsx b/packages/cli/templates/blocks/components/Text/TextMetrics.tsxnew file mode 100644index 0000000000..597e175081--- /dev/null+++ b/packages/cli/templates/blocks/components/Text/TextMetrics.tsx@@ -0,0 +1,32 @@+'use client';++import {XDSText} from '@xds/core/Text';+import {XDSStack} from '@xds/core/Stack';++const METRICS = [+ {label: 'Revenue', value: '$1,234,567.89'},+ {label: 'Active users', value: '12,345'},+ {label: 'Conversion', value: '23.4%', color: 'active' as const},+];++export default function TextMetrics() {+ return (+ <XDSStack direction="horizontal" gap={6}>+ {METRICS.map(({label, value, color}) => (+ <XDSStack key={label} direction="vertical" gap={0}>+ <XDSText type="supporting" color="secondary" display="block">+ {label}+ </XDSText>+ <XDSText+ type="large"+ weight="bold"+ color={color}+ hasTabularNumbers+ >+ {value}+ </XDSText>+ </XDSStack>+ ))}+ </XDSStack>+ );+}diff --git a/packages/cli/templates/blocks/components/Text/TextMetricsDisplay.doc.mjs b/packages/cli/templates/blocks/components/Text/TextMetricsDisplay.doc.mjsdeleted file mode 100644index c11097ad6e..0000000000--- a/packages/cli/templates/blocks/components/Text/TextMetricsDisplay.doc.mjs+++ /dev/null@@ -1,10 +0,0 @@-/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */-export const doc = {- type: 'block',- name: 'Text — Metrics Display',- description:- 'Dashboard metrics using tabular numbers for consistent alignment across values.',- isReady: true,- aspectRatio: 4 / 3,- componentsUsed: ['Text'],-};diff --git a/packages/cli/templates/blocks/components/Text/TextMetricsDisplay.tsx b/packages/cli/templates/blocks/components/Text/TextMetricsDisplay.tsxdeleted file mode 100644index 551be01c91..0000000000--- a/packages/cli/templates/blocks/components/Text/TextMetricsDisplay.tsx+++ /dev/null@@ -1,34 +0,0 @@-'use client';--import {XDSText} from '@xds/core/Text';--export default function TextMetricsDisplay() {- return (- <div style={{display: 'flex', gap: 24}}>- <div style={{textAlign: 'start'}}>- <XDSText type="body" color="secondary" display="block">- Revenue- </XDSText>- <XDSText type="large" weight="bold" hasTabularNumbers>- $1,234,567.89- </XDSText>- </div>- <div style={{textAlign: 'start'}}>- <XDSText type="body" color="secondary" display="block">- Users- </XDSText>- <XDSText type="large" weight="bold" hasTabularNumbers>- 12,345- </XDSText>- </div>- <div style={{textAlign: 'start'}}>- <XDSText type="body" color="secondary" display="block">- Conversion- </XDSText>- <XDSText type="large" weight="bold" color="active" hasTabularNumbers>- 23.4%- </XDSText>- </div>- </div>- );-}diff --git a/packages/cli/templates/blocks/components/Text/TextProductCard.doc.mjs b/packages/cli/templates/blocks/components/Text/TextProductCard.doc.mjsdeleted file mode 100644index f5c393ca34..0000000000--- a/packages/cli/templates/blocks/components/Text/TextProductCard.doc.mjs+++ /dev/null@@ -1,10 +0,0 @@-/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */-export const doc = {- type: 'block',- name: 'Text — Product Card',- description:- 'Card-like layout using text hierarchy with label, truncated body, and supporting timestamp.',- isReady: true,- aspectRatio: 4 / 3,- componentsUsed: ['Text'],-};diff --git a/packages/cli/templates/blocks/components/Text/TextProductCard.tsx b/packages/cli/templates/blocks/components/Text/TextProductCard.tsxdeleted file mode 100644index c8e8244814..0000000000--- a/packages/cli/templates/blocks/components/Text/TextProductCard.tsx+++ /dev/null@@ -1,27 +0,0 @@-'use client';--import {XDSText} from '@xds/core/Text';--export default function TextProductCard() {- return (- <div- style={{- maxWidth: 300,- padding: 16,- borderRadius: 8,- border: '1px solid #e0e0e0',- boxShadow: '0 2px 4px rgba(0,0,0,0.1)',- }}>- <XDSText type="label" display="block">- Product Name- </XDSText>- <XDSText type="body" maxLines={2} display="block">- This is a product description that might be quite long and needs to be- truncated after two lines to keep the card compact.- </XDSText>- <XDSText type="supporting" display="block">- Updated 5 minutes ago- </XDSText>- </div>- );-}diff --git a/packages/cli/templates/blocks/components/Text/TextShowcase.doc.mjs b/packages/cli/templates/blocks/components/Text/TextShowcase.doc.mjsindex ce00b04e48..43e843b1d2 100644--- a/packages/cli/templates/blocks/components/Text/TextShowcase.doc.mjs+++ b/packages/cli/templates/blocks/components/Text/TextShowcase.doc.mjs@@ -3,6 +3,6 @@ export const doc = {type: 'block',name: 'Text',isReady: true,- aspectRatio: 1,+ aspectRatio: 16 / 9,isShowcase: true,};diff --git a/packages/cli/templates/blocks/components/Text/TextShowcase.tsx b/packages/cli/templates/blocks/components/Text/TextShowcase.tsxindex a10fa03b55..0760948dcb 100644--- a/packages/cli/templates/blocks/components/Text/TextShowcase.tsx+++ b/packages/cli/templates/blocks/components/Text/TextShowcase.tsx@@ -1,15 +1,16 @@'use client';import {XDSText} from '@xds/core/Text';+import {XDSStack} from '@xds/core/Stack';export default function TextShowcase() {return (- <div style={{display: 'flex', flexDirection: 'column', gap: 12}}>+ <XDSStack direction="vertical" gap={2}><XDSText type="body">Body: The bulk of content</XDSText><XDSText type="large">Large: Emphasized content</XDSText><XDSText type="label">Label: Form and chart labels</XDSText><XDSText type="supporting">Supporting: Helper text</XDSText><XDSText type="code">Code: const x = 42;</XDSText>- </div>+ </XDSStack>);}diff --git a/packages/cli/templates/blocks/components/Text/TextTruncatedContent.doc.mjs b/packages/cli/templates/blocks/components/Text/TextTruncatedContent.doc.mjsdeleted file mode 100644index 2ee151e12b..0000000000--- a/packages/cli/templates/blocks/components/Text/TextTruncatedContent.doc.mjs+++ /dev/null@@ -1,10 +0,0 @@-/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */-export const doc = {- type: 'block',- name: 'Text — Truncated Content',- description:- 'Text truncation with configurable line limits and automatic ellipsis tooltips.',- isReady: true,- aspectRatio: 4 / 3,- componentsUsed: ['Text'],-};diff --git a/packages/cli/templates/blocks/components/Text/TextTruncatedContent.tsx b/packages/cli/templates/blocks/components/Text/TextTruncatedContent.tsxdeleted file mode 100644index 94da1d9ebf..0000000000--- a/packages/cli/templates/blocks/components/Text/TextTruncatedContent.tsx+++ /dev/null@@ -1,50 +0,0 @@-'use client';--import {XDSText} from '@xds/core/Text';--export default function TextTruncatedContent() {- return (- <div- style={{- display: 'flex',- flexDirection: 'column',- gap: 16,- maxWidth: 300,- }}>- <div>- <XDSText type="label" display="block">- 1 Line:- </XDSText>- <div style={{border: '1px solid #ccc', padding: 8}}>- <XDSText type="body" maxLines={1}>- This is a very long text that will be truncated to one line with- ellipsis.- </XDSText>- </div>- </div>- <div>- <XDSText type="label" display="block">- 2 Lines:- </XDSText>- <div style={{border: '1px solid #ccc', padding: 8}}>- <XDSText type="body" maxLines={2}>- This is a very long text that will be truncated to two lines. The- second line will end with an ellipsis if the content is too long.- </XDSText>- </div>- </div>- <div>- <XDSText type="label" display="block">- 3 Lines:- </XDSText>- <div style={{border: '1px solid #ccc', padding: 8}}>- <XDSText type="body" maxLines={3}>- This is a very long text that will be truncated to three lines. It- allows for more content to be shown but still limits the vertical- space. The third line will end with an ellipsis.- </XDSText>- </div>- </div>- </div>- );-}diff --git a/packages/cli/templates/blocks/components/Text/TextTruncation.doc.mjs b/packages/cli/templates/blocks/components/Text/TextTruncation.doc.mjsnew file mode 100644index 0000000000..90b749e8cb--- /dev/null+++ b/packages/cli/templates/blocks/components/Text/TextTruncation.doc.mjs@@ -0,0 +1,9 @@+/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */+export const doc = {+ type: 'block',+ name: 'Text — Truncation',+ description: 'Text truncation at 1, 2, and 3 lines with automatic ellipsis and hover tooltips that reveal the full content.',+ isReady: true,+ aspectRatio: 16 / 9,+ componentsUsed: ['Text', 'Stack', 'Section'],+};diff --git a/packages/cli/templates/blocks/components/Text/TextTruncation.tsx b/packages/cli/templates/blocks/components/Text/TextTruncation.tsxnew file mode 100644index 0000000000..5411b288b9--- /dev/null+++ b/packages/cli/templates/blocks/components/Text/TextTruncation.tsx@@ -0,0 +1,33 @@+'use client';++import {XDSText} from '@xds/core/Text';+import {XDSStack} from '@xds/core/Stack';+import {XDSSection} from '@xds/core/Section';++const LONG_TEXT =+ 'The design system provides a consistent set of typography tokens, spacing scales, and color palettes that ensure every surface in the product feels cohesive regardless of which team built it. Components inherit these tokens automatically so teams can build new features without manually matching fonts, colors, or spacing values across different surfaces and breakpoints.';++const LINES = [+ {maxLines: 1, label: '1 line'},+ {maxLines: 2, label: '2 lines'},+ {maxLines: 3, label: '3 lines'},+];++export default function TextTruncation() {+ return (+ <XDSStack direction="vertical" gap={3}>+ {LINES.map(({maxLines, label}) => (+ <XDSStack key={maxLines} direction="vertical" gap={1}>+ <XDSText type="supporting" color="secondary">+ {label}+ </XDSText>+ <XDSSection padding={2} variant="wash">+ <XDSText type="body" maxLines={maxLines}>+ {LONG_TEXT}+ </XDSText>+ </XDSSection>+ </XDSStack>+ ))}+ </XDSStack>+ );+}diff --git a/packages/cli/templates/blocks/components/Text/TextTypes.doc.mjs b/packages/cli/templates/blocks/components/Text/TextTypes.doc.mjsnew file mode 100644index 0000000000..6bbefcb71b--- /dev/null+++ b/packages/cli/templates/blocks/components/Text/TextTypes.doc.mjs@@ -0,0 +1,9 @@+/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */+export const doc = {+ type: 'block',+ name: 'Text — Types',+ description: 'All 5 semantic text types (body, large, label, supporting, code) with their default styling from the theme.',+ isReady: true,+ aspectRatio: 16 / 9,+ componentsUsed: ['Text', 'Stack'],+};diff --git a/packages/cli/templates/blocks/components/Text/TextTypes.tsx b/packages/cli/templates/blocks/components/Text/TextTypes.tsxnew file mode 100644index 0000000000..76a0506ac0--- /dev/null+++ b/packages/cli/templates/blocks/components/Text/TextTypes.tsx@@ -0,0 +1,29 @@+'use client';++import {XDSText} from '@xds/core/Text';+import {XDSStack} from '@xds/core/Stack';++const TYPES = [+ {type: 'large' as const, label: 'Large text', sample: 'Large text for introductions and callouts'},+ {type: 'body' as const, label: 'Body text', sample: 'Body text for paragraphs and general content'},+ {type: 'label' as const, label: 'Label text', sample: 'Label text for form fields and section titles'},+ {type: 'supporting' as const, label: 'Supporting text', sample: 'Supporting text for captions and metadata'},+ {type: 'code' as const, label: 'Code text', sample: 'const theme = defineTheme({})'},+];++export default function TextTypes() {+ return (+ <XDSStack direction="vertical" gap={3}>+ {TYPES.map(({type, label, sample}) => (+ <XDSStack key={type} direction="vertical" gap={0}>+ <XDSText type="supporting" color="secondary">+ {label}+ </XDSText>+ <XDSText type={type} display="block">+ {sample}+ </XDSText>+ </XDSStack>+ ))}+ </XDSStack>+ );+}diff --git a/packages/core/src/Text/Text.doc.mjs b/packages/core/src/Text/Text.doc.mjsindex 3abce65ea3..37b45487c6 100644--- a/packages/core/src/Text/Text.doc.mjs+++ b/packages/core/src/Text/Text.doc.mjs@@ -200,12 +200,15 @@ export const docs = {],usage: {description:- 'Text provides typography primitives for the design system, including body text via XDSText and headings via XDSHeading. Use XDSText for all body copy with semantic type variants, and XDSHeading for section headings that render the correct h1–h6 element.',+ 'Text renders styled body text and headings from the theme. Use XDSText with a semantic type for body copy, labels, and captions, and XDSHeading for section titles that output the correct h1\u2013h6 element.',bestPractices: [- { guidance: true, description: 'Use the type prop on XDSText to select a semantic text style rather than manually setting size and weight.' },- { guidance: true, description: 'Set accessibilityLevel on XDSHeading when the visual heading level differs from the document outline hierarchy.' },- { guidance: false, description: 'Override size and weight on XDSText when a semantic type already matches your use case.' },- { guidance: false, description: 'Skip heading levels in the document outline — maintain a logical h1 through h6 hierarchy for accessibility.' },+ { guidance: true, description: 'Pick a semantic type (body, label, supporting, large, code) instead of manually setting size and weight \u2014 the theme handles the details.' },+ { guidance: true, description: 'Set accessibilityLevel on XDSHeading when the visual level differs from the document outline so screen readers announce the correct hierarchy.' },+ { guidance: true, description: 'Use maxLines with a number to truncate long content \u2014 a tooltip appears automatically on hover so no text is lost.' },+ { guidance: true, description: 'Enable hasTabularNumbers for columns of numeric data so digits align vertically across rows.' },+ { guidance: false, description: 'Override size and weight when a semantic type already matches \u2014 extra overrides fight the theme and break when themes change.' },+ { guidance: false, description: 'Skip heading levels in the document outline \u2014 go h1 then h2 then h3, never h1 then h3.' },+ { guidance: false, description: 'Use raw HTML tags like <p>, <h1>\u2013<h6>, or <span> for text \u2014 XDSText and XDSHeading apply the correct theme tokens automatically.' },],},};@@ -411,27 +414,33 @@ export const docsZh = {],usage: {description:- 'Text provides typography primitives for the design system, including body text via XDSText and headings via XDSHeading. Use XDSText for all body copy with semantic type variants, and XDSHeading for section headings that render the correct h1–h6 element.',+ 'Text renders styled body text and headings from the theme. Use XDSText with a semantic type for body copy, labels, and captions, and XDSHeading for section titles that output the correct h1\u2013h6 element.',bestPractices: [- { guidance: true, description: 'Use the type prop on XDSText to select a semantic text style rather than manually setting size and weight.' },- { guidance: true, description: 'Set accessibilityLevel on XDSHeading when the visual heading level differs from the document outline hierarchy.' },- { guidance: false, description: 'Override size and weight on XDSText when a semantic type already matches your use case.' },- { guidance: false, description: 'Skip heading levels in the document outline — maintain a logical h1 through h6 hierarchy for accessibility.' },+ { guidance: true, description: 'Pick a semantic type (body, label, supporting, large, code) instead of manually setting size and weight \u2014 the theme handles the details.' },+ { guidance: true, description: 'Set accessibilityLevel on XDSHeading when the visual level differs from the document outline so screen readers announce the correct hierarchy.' },+ { guidance: true, description: 'Use maxLines with a number to truncate long content \u2014 a tooltip appears automatically on hover so no text is lost.' },+ { guidance: true, description: 'Enable hasTabularNumbers for columns of numeric data so digits align vertically across rows.' },+ { guidance: false, description: 'Override size and weight when a semantic type already matches \u2014 extra overrides fight the theme and break when themes change.' },+ { guidance: false, description: 'Skip heading levels in the document outline \u2014 go h1 then h2 then h3, never h1 then h3.' },+ { guidance: false, description: 'Use raw HTML tags like <p>, <h1>\u2013<h6>, or <span> for text \u2014 XDSText and XDSHeading apply the correct theme tokens automatically.' },],},};/** @type {import('../docs-types').TranslationDoc} */export const docsDense = {- description: 'Typography components: semantic body text, headings, wrapper for applying typography styles to native HTML.',+ description: 'semantic body text + headings w/ theme-driven type scale, truncation, tabular numbers',usage: {description:- 'Text provides typography primitives for the design system, including body text via XDSText and headings via XDSHeading. Use XDSText for all body copy with semantic type variants, and XDSHeading for section headings that render the correct h1–h6 element.',+ 'Text renders styled body text and headings. XDSText for body copy with semantic types, XDSHeading for h1\u2013h6 with theme tokens.',bestPractices: [- { guidance: true, description: 'Use the type prop on XDSText to select a semantic text style rather than manually setting size and weight.' },- { guidance: true, description: 'Set accessibilityLevel on XDSHeading when the visual heading level differs from the document outline hierarchy.' },- { guidance: false, description: 'Override size and weight on XDSText when a semantic type already matches your use case.' },- { guidance: false, description: 'Skip heading levels in the document outline — maintain a logical h1 through h6 hierarchy for accessibility.' },+ { guidance: true, description: 'Semantic type (body, label, supporting, large, code) instead of manual size/weight.' },+ { guidance: true, description: 'accessibilityLevel on XDSHeading when visual level differs from document outline.' },+ { guidance: true, description: 'maxLines for truncation \u2014 tooltip shows full text on hover.' },+ { guidance: true, description: 'hasTabularNumbers for aligned numeric columns.' },+ { guidance: false, description: 'Override size/weight when a semantic type already matches.' },+ { guidance: false, description: 'Skip heading levels \u2014 sequential h1 \u2192 h2 \u2192 h3.' },+ { guidance: false, description: 'Raw <p>/<h1>/<span> \u2014 use XDSText/XDSHeading for theme tokens.' },],},components: [