Skip to content

Conversation

davebcn87
Copy link
Contributor

@davebcn87 davebcn87 commented Sep 29, 2025

Background

This PR adds comprehensive component examples to the Admin UI Extensions documentation for 5 components in the Structure category (Part II). These examples were automatically parsed and imported from the existing Polaris markdown documentation.

Solution

  • Enhanced Documentation Parser: Improved the markdown parsing script to support both .doc.ts and .ab.doc.ts files (App Bridge components)
  • Automated Example Generation: Extracted examples from Polaris markdown documentation and generated individual HTML example files
  • TypeScript Integration: Updated component documentation files with proper examples sections and TypeScript-safe character escaping

Components Updated

Structure Category - Part II (5 components, 20 examples total):

  • Page (4 examples):

    • Basic page layout default base inline size
    • Large inline size for wide content
    • Page with heading
    • Small inline size for focused content
  • Section (4 examples):

    • Full width content layout
    • Nested sections with visual level differences
    • Section with accessibility label
    • Top level section with form elements
  • Stack (5 examples):

    • Basic block stack vertical
    • Custom alignment
    • Custom spacing
    • Inline stack horizontal
    • Responsive stack with container queries
  • Table (5 examples + 1 updated):

    • Advanced table with all list slot types
    • Basic usage
    • Full width product inventory table
    • With loading state
    • With pagination
  • UnorderedList (1 example):

    • Store setup checklist

Technical Changes

  • Updated .doc.ts files for 4 regular Structure components
  • Updated .ab.doc.ts file for Page (App Bridge component)
  • Enhanced parsing script with improved comma insertion logic and character escaping
  • Preserved existing default.html example files while adding new ones
  • Added comprehensive layout and organizational component examples

🎩 Testing Steps

  1. Run the documentation build:

    yarn docs:admin examples-structure-2
  2. Navigate to shopify-dev repo and test locally at docs/api/app-home/polaris-web-components/structure/

  3. Verify the newly added examples are displayed correctly for each component:

    • Page - test different page layouts and sizing options
    • Section - verify nested section hierarchy and accessibility
    • Stack - confirm layout alignment and responsive behavior
    • Table - validate table functionality, loading states, and pagination
    • UnorderedList - test list structure and content organization
  4. Test that existing default.html examples still work as expected

Quality Assurance

  • All examples are sourced from official Polaris documentation
  • Examples include proper descriptions and usage context
  • TypeScript compilation passes without errors
  • Maintains backward compatibility with existing examples
  • Comprehensive coverage of layout patterns, data organization, and structural components

Checklist

  • I have 🎩'd these changes
  • I have updated relevant documentation

@davebcn87 davebcn87 changed the title Added exapmles to admin Structure components (Part II) Added examples to admin Structure components (Part II) Sep 29, 2025
@davebcn87 davebcn87 marked this pull request as ready for review September 29, 2025 10:57
@davebcn87 davebcn87 force-pushed the examples-structure-2 branch 2 times, most recently from 78b3711 to b4302cf Compare September 30, 2025 11:57
@davebcn87 davebcn87 force-pushed the examples-structure-2 branch 2 times, most recently from 166786c to 8edbe54 Compare September 30, 2025 15:42
@davebcn87 davebcn87 force-pushed the examples-structure-1 branch from 63e9c80 to 9b4aaa1 Compare October 1, 2025 11:01
@davebcn87 davebcn87 force-pushed the examples-structure-2 branch from 65c76cd to 2f81a08 Compare October 1, 2025 11:01
@davebcn87 davebcn87 force-pushed the examples-structure-1 branch from 9b4aaa1 to 3987ca6 Compare October 1, 2025 14:23
@davebcn87 davebcn87 force-pushed the examples-structure-2 branch from 2f81a08 to 45cd0e7 Compare October 1, 2025 14:23
@davebcn87 davebcn87 force-pushed the examples-structure-1 branch from 3987ca6 to 41cba3b Compare October 1, 2025 14:40
@davebcn87 davebcn87 force-pushed the examples-structure-2 branch from 45cd0e7 to 06e2870 Compare October 1, 2025 14:40
<s-stack gap="base">
<!-- Level 1 section -->
<s-section heading="Order details">
<s-text>Order #1234 placed on January 15, 2024</s-text>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to use s-paragraph here (and for other block-like text content examples)

heading="Payment summary"
accessibilityLabel="Order payment breakdown and totals"
>
<s-text>Subtotal: $42.99</s-text>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be inline or block?

Image

@@ -0,0 +1,5 @@
<s-page heading="Products" inline-size="base">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one seems to be almost identical to the "Page with heading" example. Might be good to consolidate

Screen.Recording.2025-10-01.at.10.50.24.AM.mov

tabs: [
{
code: './examples/page-with-heading.html',
language: 'preview',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might need to add a new layout here. The page examples are getting squished (maybe due to the container parent)

@davebcn87 davebcn87 force-pushed the examples-structure-1 branch from 41cba3b to c49764f Compare October 3, 2025 14:31
@davebcn87 davebcn87 force-pushed the examples-structure-2 branch from 06e2870 to 7bdb69c Compare October 3, 2025 14:48
@davebcn87 davebcn87 force-pushed the examples-structure-2 branch from 7bdb69c to ff921ac Compare October 3, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants