### Paragraph Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/components/all-components.mdx Demonstrates the usage of the Paragraph component. No specific setup required beyond importing the component. ```javascript import { Paragraph } from "grommet"; function ParagraphExample() { return ( This is a paragraph. ); } export default ParagraphExample; ``` -------------------------------- ### Telemetry for Generate Examples and Do/Don'ts Agents Source: https://github.com/grommet/hpe-design-system/blob/master/knowledge/capabilities/docs-refactor/docs-refactor-orchestrator.agent.md Use these commands to log the start and completion of the generate-examples-agent and dos-donts-agent. Ensure to replace '[name]' with the component name and '[ms]' with the duration in milliseconds. ```bash pnpm telemetry:write --component [name] --eventType agent-start --stage generated --agent generate-examples-agent # ...invoke @generate-examples-agent [name] if needed... pnpm telemetry:write --component [name] --eventType agent-complete --stage generated --agent generate-examples-agent --status success --durationMs [ms] pnpm telemetry:write --component [name] --eventType agent-start --stage generated --agent dos-donts-agent # ...invoke @dos-donts-agent [name] if needed... pnpm telemetry:write --component [name] --eventType agent-complete --stage generated --agent dos-donts-agent --status success --durationMs [ms] ``` ```bash pnpm telemetry:write --component [name] --eventType stage-transition --stage examples-pending --status success --metadata '{"fromStage":"generated","toStage":"examples-pending"}' ``` -------------------------------- ### Data Summary Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/components/datasummary.mdx This example demonstrates the usage of the Data Summary component. It requires importing the DataSummaryExample component and the Example layout component. ```javascript import { Example, AccessibilitySection } from '../../layouts'; import { DataSummaryExample } from '../../examples/components/'; ## Accessibility ### WCAG compliance ``` -------------------------------- ### Build and Start Docs Server in Production Source: https://github.com/grommet/hpe-design-system/blob/master/README.md Builds the documentation site for production and then starts a server to serve it. ```bash pnpm build pnpm --filter docs start-server ``` -------------------------------- ### Responsive Content Layout Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/templates/content-layouts.mdx This example demonstrates a responsive content layout that adjusts based on screen size. It utilizes the 'Example' component and includes links to the source code and related components. ```javascript ``` -------------------------------- ### Displaying Component States Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/design-tokens/component-states.mdx This example demonstrates how to render component states using the Example and ComponentStates components. Ensure necessary imports are included. ```jsx import { Checkmark } from '@hpe-design/icons-grommet'; import { Notification } from 'grommet'; import { Example } from '../../layouts'; import { ComponentStates } from '../../examples'; ``` -------------------------------- ### Simple Tag Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/components/tag.mdx A basic example of the Tag component. No specific setup is required beyond importing the component. ```javascript import { TagSimple, } from '../../examples'; import { Tag } from 'grommet'; ``` -------------------------------- ### MDX Example Integration Source: https://github.com/grommet/hpe-design-system/blob/master/knowledge/capabilities/docs-refactor/agents/generate-examples.agent.md Update the MDX file to include the new named import and replace TODO comments with an block. The wrapper automatically injects containerRef, so do not pass it explicitly from MDX. ```mdx <[ComponentName][UseCasePascalCase]Example /> ``` -------------------------------- ### Sign Up Form Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/templates/forms/index.mdx Example of a sign-up form, including form validation utilities. This template is suitable for user account creation. ```javascript https://raw.githubusercontent.com/grommet/hpe-design-system/master/apps/docs/src/examples/templates/forms/SignUpExample.js ``` ```javascript https://raw.githubusercontent.com/grommet/hpe-design-system/master/apps/docs/src/examples/templates/forms/utils/FormValidation.js ``` -------------------------------- ### PageHeader Introduction Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/components/pageheader.mdx This example demonstrates the basic introduction of the PageHeader component, showcasing its title, subtitle, and actions. ```javascript import React from 'react'; import { Box, PageHeader } from 'grommet'; export const PageHeaderIntroExample = () => ( {}, }, { label: 'Action 2', onClick: () => {}, }, ]} /> ); ``` -------------------------------- ### Sign In Form Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/templates/forms/index.mdx Example of a sign-in form, incorporating form validation utilities. Use this for user authentication. ```javascript https://raw.githubusercontent.com/grommet/hpe-design-system/master/apps/docs/src/examples/templates/forms/SignInExample.js ``` ```javascript https://raw.githubusercontent.com/grommet/hpe-design-system/master/apps/docs/src/examples/templates/forms/utils/FormValidation.js ``` -------------------------------- ### Install react-syntax-highlighter with NPM Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/templates/code-blocks.mdx Install the react-syntax-highlighter package using npm. This is a prerequisite for using code blocks. ```bash npm install react-syntax-highlighter --save ``` -------------------------------- ### Card Kitchen Sink Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/components/card/index.mdx Demonstrates a comprehensive example of the Card component with various features and content. ```javascript import React from 'react'; import { Card, CardBody, CardFooter, CardHeader, CardTitle } from 'grommet'; export const CardKitchenSink = (props) => (
{/* Card Title */} Card Title {/* Card Body */} Card Body {/* Card Footer */} Card Footer ); ``` -------------------------------- ### Exporting a Component Example Source: https://github.com/grommet/hpe-design-system/blob/master/knowledge/capabilities/docs-refactor/agents/generate-examples.agent.md Register each new example file by appending an export line to the component's index.js file. ```javascript export * from './[ComponentName][UseCasePascalCase]Example'; ``` -------------------------------- ### RangeInput Example Component Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/components/rangeinput.mdx This example demonstrates the usage of the RangeInput component. Ensure the component is imported before use. ```javascript import { Example, AccessibilitySection } from '../../layouts'; import { RangeInputExample } from '../../examples'; ## Accessibility ### WCAG compliance ``` -------------------------------- ### Install react-syntax-highlighter with Yarn Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/templates/code-blocks.mdx Install the react-syntax-highlighter package using Yarn. This is a prerequisite for using code blocks. ```bash yarn add react-syntax-highlighter ``` -------------------------------- ### Basic Menu Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/components/menu.mdx A standard example of the Menu component. This snippet demonstrates the basic structure and usage of the Menu. ```javascript import { Box, Paragraph, Anchor } from 'grommet'; import { Checkmark } from '@hpe-design/icons-grommet'; import { AccessibilitySection, BestPracticeGroup, Example, } from '../../layouts'; import { MenuAnatomy, MenuExample, MenuBatchActionsExample, MenuDangerousExample, MenuDefaultExample, MenuDisabledExample, MenuGroupingExample, MenuHeaderExample, MenuIconExample, MenuItemCountExample, MenuRecordActionsExample, MenuSelectValueExample, MenuToolbarExample, } from '../../examples'; ``` -------------------------------- ### Simple Selector Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/templates/selector.mdx Demonstrates the basic usage of the Selector component. This example shows how to implement a simple selection interface. ```javascript import { Notification } from 'grommet'; import { Example } from '../../layouts'; import { SimpleSelector, QuickFilter, SupportSelector, SelectorAnatomy, } from '../../examples'; ``` -------------------------------- ### Basic Header Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/components/header.mdx Demonstrates a basic Header component. This is a foundational example for understanding Header's structure and integration. ```jsx import { Header } from 'grommet';
{/* Header content goes here */}
``` -------------------------------- ### Basic Search Input Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/components/search.mdx Demonstrates a standard search input field. This is a foundational example for integrating search functionality. ```javascript import React from 'react'; import { TextInput } from 'grommet'; export const SearchExample = () => ( ); ``` -------------------------------- ### Simple Sign Up Form Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/templates/forms/index.mdx Demonstrates a basic sign-up form. It includes a JavaScript file for the form logic and a utility file for form validation. ```javascript https://raw.githubusercontent.com/grommet/hpe-design-system/master/apps/docs/src/examples/templates/forms/SimpleSignUpExample.js ``` ```javascript https://raw.githubusercontent.com/grommet/hpe-design-system/master/apps/docs/src/examples/templates/forms/utils/FormValidation.js ``` -------------------------------- ### Start Docs App Locally Source: https://github.com/grommet/hpe-design-system/blob/master/knowledge/capabilities/docs-refactor/docs/execution.skill.md Command to build and serve the documentation application locally for spot-checking. ```bash cd apps/docs pnpm start ``` -------------------------------- ### Simple FileInput Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/components/fileinput.mdx Basic usage of the FileInput component for single file uploads. No special setup is required beyond importing the component. ```javascript import React from 'react'; import { FileInput } from 'grommet'; export const FileInputSimpleExample = () => ( ); ``` -------------------------------- ### Button Alignment Examples Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/components/button.mdx Demonstrates different button alignment strategies based on context, such as drawers and modals. Follow this guide for general button placement. ```JavaScript ``` -------------------------------- ### Run Docs in Development Mode Source: https://github.com/grommet/hpe-design-system/blob/master/README.md Starts the documentation site in development mode. ```bash pnpm start:docs ``` -------------------------------- ### Tip Simple Example Source: https://github.com/grommet/hpe-design-system/blob/master/apps/docs/src/pages/components/all-components.mdx Shows a basic Tip component. Import Tip and Button. ```javascript import { Tip, Button } from "grommet"; function TipSimpleExample() { return (