Skip to content

feat: integrate DataForm component and useFormValidity hook, update w…#87

Merged
kzamanbd merged 7 commits intomainfrom
feat/dataform
Apr 24, 2026
Merged

feat: integrate DataForm component and useFormValidity hook, update w…#87
kzamanbd merged 7 commits intomainfrom
feat/dataform

Conversation

@kzamanbd
Copy link
Copy Markdown
Contributor

@kzamanbd kzamanbd commented Apr 23, 2026

…ebpack config for module output

Summary by CodeRabbit

  • New Features

    • Added a DataForm component with multiple layout modes (regular, panel, card, row) and a useFormValidity hook for validation.
  • Documentation

    • Added Storybook demos and docs showcasing layouts, field types, conditional fields, transformers, and validation flows.
  • Style

    • Updated form styling: new corner-radius variable and adjusted no-results/panel rounding for consistent visuals.
  • Chores

    • Ignore editor/workspace and debug log files; minor packaging/formatting cleanup.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Warning

Rate limit exceeded

@kzamanbd has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 42 minutes and 56 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 42 minutes and 56 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9c443aa5-85f3-4b19-9e96-e8d13a4c82ce

📥 Commits

Reviewing files that changed from the base of the PR and between dfea162 and 2201425.

📒 Files selected for processing (1)
  • src/components/wordpress/DataForm.stories.tsx
📝 Walkthrough

Walkthrough

Re-exports WordPress DataForm component, hook, and related types to the public API; adds comprehensive Storybook stories demonstrating layouts and validation; updates styling variable names in DataViews CSS; removes @wordpress/dataviews externals from Webpack; minor config and formatting tweaks (.gitignore, package.json).

Changes

Cohort / File(s) Summary
Configuration
/.gitignore, package.json
Ignore debug-storybook.log and .vscode; package.json EOF newline removed (formatting only).
UI Barrel & Public API
src/components/ui/index.ts, src/index.ts
Re-export DataForm and useFormValidity from @wordpress/dataviews/wp; add DataForm* type aliases and surface them from the package entry.
Storybook
src/components/wordpress/DataForm.stories.tsx
Add new Storybook file with multiple DataForm stories (regular, side labels, panel dropdown/modal, card, row) and a WithValidation story using useFormValidity.
Stylesheet
src/components/wordpress/style.css
Rename CSS variable from --dokan-dataviews-radius to --pui-dataviews-radius (scoped) and update border-radius/fallbacks and related rules; remove a top border on no-results state.
Build Config
webpack.config.js
Remove @wordpress/dataviews and @wordpress/dataviews/wp from Webpack externals so they are bundled/resolved normally.
Docs
CLAUDE.md
Document DataForm as a WordPress-coupled UI component.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐇 I hopped into code with a curious grin,
Types and stories tucked neatly in,
Forms lined up, validations bright,
CSS rounded just right—
A tiny commit dance, whiskers twitch, begin!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: integrating the DataForm component and useFormValidity hook into the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dataform

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
webpack.config.js (1)

24-35: ⚠️ Potential issue | 🟠 Major

Externalize WordPress DataViews as well.

The new DataForm export imports @wordpress/dataviews/wp, but this externals map no longer excludes DataViews. That bundles WordPress DataViews into the library instead of using the consumer-provided WordPress package.

Proposed externals update
     externals: {
         react: 'react',
         'react-dom': 'react-dom',
         'react/jsx-runtime': 'react/jsx-runtime',
         '@wordpress/element': '@wordpress/element',
         '@wordpress/components': '@wordpress/components',
+        '@wordpress/dataviews': '@wordpress/dataviews',
+        '@wordpress/dataviews/wp': '@wordpress/dataviews/wp',
         '@wordpress/block-editor': '@wordpress/block-editor',
         '@wordpress/date': '@wordpress/date',
         '@wordpress/hooks': '@wordpress/hooks',
         '@wordpress/i18n': '@wordpress/i18n',
         quill: 'quill',
     },

As per coding guidelines, package.json: Ensure React, ReactDOM, and WordPress packages (@wordpress/components, @wordpress/dataviews, @wordpress/hooks, @wordpress/i18n, @wordpress/date) are externalized as they must be provided by consumers.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@webpack.config.js` around lines 24 - 35, The externals map is missing
`@wordpress/dataviews` so the new DataForm (which imports
'@wordpress/dataviews/wp') gets bundled; update the externals object (the
externals key in webpack.config.js) to include '@wordpress/dataviews':
'@wordpress/dataviews' alongside the existing WordPress packages (e.g.,
'@wordpress/components', '@wordpress/hooks', '@wordpress/i18n',
'@wordpress/date') and ensure package.json peerDependencies list React, ReactDOM
and these `@wordpress` packages so consumers provide them.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/ui/index.ts`:
- Around line 292-306: The UI barrel currently exports DataForm and
useFormValidity from '@wordpress/dataviews/wp' (symbols: DataForm,
useFormValidity in src/components/ui/index.ts) which introduces a WordPress API
dependency into the pure UI entrypoint; remove or relocate that export to a
WordPress-specific barrel/entrypoint (e.g., a new src/components/wp-ui/index.ts)
or alternatively update the allowed-exceptions list if you intend DataForm to be
a sanctioned UI exception—ensure the src/components/ui/index.ts only exports
non-WordPress UI modules and move the type re-exports for DataForm
(DataFormProps, DataFormSchema, DataFormField, etc.) out of this UI barrel as
well.

---

Outside diff comments:
In `@webpack.config.js`:
- Around line 24-35: The externals map is missing `@wordpress/dataviews` so the
new DataForm (which imports '@wordpress/dataviews/wp') gets bundled; update the
externals object (the externals key in webpack.config.js) to include
'@wordpress/dataviews': '@wordpress/dataviews' alongside the existing WordPress
packages (e.g., '@wordpress/components', '@wordpress/hooks', '@wordpress/i18n',
'@wordpress/date') and ensure package.json peerDependencies list React, ReactDOM
and these `@wordpress` packages so consumers provide them.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1c7149b7-9e5b-4998-80b9-090175e0aecc

📥 Commits

Reviewing files that changed from the base of the PR and between f42dfdb and e7f0a4b.

📒 Files selected for processing (6)
  • .gitignore
  • package.json
  • src/components/ui/index.ts
  • src/components/wordpress/DataForm.stories.tsx
  • src/index.ts
  • webpack.config.js

Comment thread src/components/ui/index.ts
@kzamanbd kzamanbd merged commit 65d48db into main Apr 24, 2026
1 check passed
@kzamanbd kzamanbd deleted the feat/dataform branch April 24, 2026 09:32
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.

1 participant