Skip to content

Add textAlign to Paragraph and improve JSDoc#4455

Merged
justinhenricks merged 4 commits into
2026-07-rcfrom
jh/add-text-align-paragraph
May 19, 2026
Merged

Add textAlign to Paragraph and improve JSDoc#4455
justinhenricks merged 4 commits into
2026-07-rcfrom
jh/add-text-align-paragraph

Conversation

@justinhenricks
Copy link
Copy Markdown
Contributor

TLDR

Add textAlign to ParagraphElementProps and replace the type prop, aligning ui-extensions types with the underlying component change.

What changed

  • Added textAlign prop ('start' | 'end' | 'center' | 'auto') to ParagraphElementProps
  • Removed type prop ('paragraph' | 'small')
  • Added @publicDocs annotations to ParagraphElement and ParagraphProps
  • Improved JSDoc for BaseElementProps, BaseElementPropsWithChildren, and their properties

Context

The underlying s-paragraph web component change shipped in https://github.com/shop/world/pull/577805, which wired textAlign through the Polaris web component pipeline. This PR updates the ui-extensions type declarations to match.

@github-actions
Copy link
Copy Markdown
Contributor

🚨🚨🚨 Docs migration in progress 🚨🚨🚨

We are actively migrating UI extension reference docs to MDX in the areas/platforms/shopify-dev zone of the monorepo. This impacts docs for the following surfaces:

During this migration, please be aware of the following:

.doc.ts files are being deprecated. Changes to .doc.ts files in this repo will not be reflected in the new MDX-based docs. If you need to update docs for a reference that has already been migrated, make your changes directly in the areas/platforms/shopify-dev zone of the monorepo instead.

Doc comments in .ts source files (the comment blocks above types and functions) are also affected. Generating docs from these comments currently requires a newer version of the @shopify/generate-docs library that isn't yet available. Updates to doc comments may not produce the expected output until the migration is complete.

Examples that previously lived in this repo are being moved to the areas/platforms/shopify-dev zone of the monorepo and should be authored there going forward.

What should I do?

  • If your PR includes changes to .doc.ts files, doc comments, or examples, please reach out to us in #devtools-proj-templated-refs so we can help ensure your updates are captured correctly.
  • If your PR is limited to source code changes (non-docs), you can ignore this notice.

Thanks for your patience while we complete the migration! 🙏

@justinhenricks justinhenricks force-pushed the jh/add-text-align-paragraph branch 3 times, most recently from 03729b2 to 1b9765e Compare May 13, 2026 18:06
* @default 'paragraph'
* @default 'auto'
*/
type?: Extract<ParagraphProps$1['type'], 'paragraph' | 'small'>;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

type is gone now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, it was just redundant to the 'type' on 'ParagraphProps'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ah cool. how did you generate those? Did the script remove the duplicate or did you do this manually?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I generated via pnpm build:components in checkout-web and copied over this .d.ts file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm assuming the docs will still pick all those up, eh?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I hope so? how can we be sure?

Replace the 'type' prop with 'textAlign' on ParagraphElementProps
to align with the underlying s-paragraph web component change.

- Add textAlign prop ('start' | 'end' | 'center' | 'auto')
- Remove type prop ('paragraph' | 'small')
- Add @publicdocs annotations
- Improve JSDoc for BaseElementProps and BaseElementPropsWithChildren
@justinhenricks justinhenricks force-pushed the jh/add-text-align-paragraph branch from 1b9765e to fe62c86 Compare May 19, 2026 13:31
@justinhenricks justinhenricks merged commit 6f573db into 2026-07-rc May 19, 2026
7 checks passed
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