Skip to content

feat(DES-14641): add FormDialog block with docs and demos#303

Open
leahwangcloudflare wants to merge 5 commits intocloudflare:mainfrom
leahwangcloudflare:leah/DES-14641-form-dialog-block
Open

feat(DES-14641): add FormDialog block with docs and demos#303
leahwangcloudflare wants to merge 5 commits intocloudflare:mainfrom
leahwangcloudflare:leah/DES-14641-form-dialog-block

Conversation

@leahwangcloudflare
Copy link
Copy Markdown

@leahwangcloudflare leahwangcloudflare commented Mar 25, 2026

Summary:

  • Adds a new FormDialog block (packages/kumo/src/blocks/form-dialog/) with sm and base size variants, optional banner and errorMessage props, and built-in submit/cancel actions

  • Adds docs page at /blocks/form-dialog with installation instructions, usage example, and four demos (basic, size, multiple sections, banner, error state)

  • Adds Form Dialog to the docs site sidebar nav

Jira
DES-14641

image image

Copy link
Copy Markdown
Collaborator

@geoquant geoquant left a comment

Choose a reason for hiding this comment

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

@leahwangcloudflare looks good to me! if we make changes to the kumo library we need to include a "changeset"; run pnpm changeset to include one and make sure it's a minor or patch. you can ask your favorite agent

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 27, 2026

npm i https://pkg.pr.new/@cloudflare/kumo@303

commit: aa66e22

@github-actions
Copy link
Copy Markdown
Contributor

Docs Preview

View docs preview

Commit: aa66e22

@github-actions
Copy link
Copy Markdown
Contributor

Visual Regression Report

12 screenshot(s) with visual changes:

Button / Variant: Secondary

161 px (0.14%) changed

Before After Diff
Before After Diff

Button / Sizes

676 px (0.59%) changed

Before After Diff
Before After Diff

Button / Loading State

3 px (0%) changed

Before After Diff
Before After Diff

Button / Disabled State

231 px (0.2%) changed

Before After Diff
Before After Diff

Dialog / Dialog With Actions

233 px (0.2%) changed

Before After Diff
Before After Diff

Dialog / Dialog Basic

197 px (0.17%) changed

Before After Diff
Before After Diff

Dialog / Dialog Confirmation

2,102 px (1.82%) changed

Before After Diff
Before After Diff

Dialog / Dialog With Combobox

244 px (0.21%) changed

Before After Diff
Before After Diff

Select / Select Basic

468 px (0.41%) changed

Before After Diff
Before After Diff

Select / Select With Tooltip

504 px (0.44%) changed

Before After Diff
Before After Diff

Select / Select Loading

1,529 px (0.63%) changed

Before After Diff
Before After Diff

Select (Open)

0 px (0%) changed

Before After Diff
Before After Diff
18 screenshot(s) unchanged
  • Button / Basic
  • Button / Variant: Primary
  • Button / Variant: Ghost
  • Button / Variant: Destructive
  • Button / Variant: Outline
  • Button / Variant: Secondary Destructive
  • Button / With Icon
  • Button / Icon Only
  • Dialog / Dialog Alert
  • Dialog / Dialog With Select
  • Dialog / Dialog With Dropdown
  • Dialog (Open)
  • Select / Select Without Label
  • Select / Select With Field
  • Select / Select Placeholder
  • Select / Select Custom Rendering
  • Select / Select Multiple
  • Select / Select Complex

Generated by Kumo Visual Regression

Copy link
Copy Markdown
Contributor

@nandanmen nandanmen left a comment

Choose a reason for hiding this comment

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

Padding feels uneven here:

Image

It almost feels like there should be a visual separator for the footer? A border or a different background color maybe?

Comment on lines +55 to +62
/** Whether the submit action is in progress */
isSubmitting?: boolean;
/** Whether the submit button should be disabled */
isSubmitDisabled?: boolean;
/** Submit button label (default: "Save") */
submitButtonText?: string;
/** Cancel button label (default: "Cancel") */
cancelButtonText?: string;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should remove these from props and export a FormDialogSubmitButton component (or similar). The caller then does this instead:

<FormDialog>
  ...
  <FormDialogSubmitButton disabled={...} loading={...}>
    Submit
  </FormDialogSubmitButton>
</FormDialog>

This allows us to:

  • Simplify the props
  • Allow for composition (e.g. add icons to button etc)
  • Change other props of the button without needing to update the props of FormDialog

Comment on lines +131 to +137
<DialogClose
render={(props) => (
<Button {...props} variant="secondary" disabled={isSubmitting}>
{cancelButtonText}
</Button>
)}
/>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can do the same here by exporting a CancelButton component

…n exports

Replace isSubmitting, isSubmitDisabled, submitButtonText, and cancelButtonText props
with composable cancelButton and submitButton slot props. Both default to the new
exported sub-components so existing usage requires no changes.
@leahwangcloudflare
Copy link
Copy Markdown
Author

leahwangcloudflare commented Mar 27, 2026

@nandanmen Hey Nanda, thanks for the feedback! I just adjusted spacing - now the bottom button has the same pb and pr. I wanted to avoid having divider since it introduces visual noise - so intentionally added extra spacing above the bottom button to create more visual distance, let me know your thoughts!
image
image

Copy link
Copy Markdown
Contributor

@nandanmen nandanmen left a comment

Choose a reason for hiding this comment

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

@leahwangcloudflare much better, thanks!

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.

3 participants