Skip to content

feat(theme): custom className on ThemeProvider + subpath JS emit#95

Merged
kzamanbd merged 3 commits into
mainfrom
feat/theme-provider-classname
May 22, 2026
Merged

feat(theme): custom className on ThemeProvider + subpath JS emit#95
kzamanbd merged 3 commits into
mainfrom
feat/theme-provider-classname

Conversation

@kzamanbd
Copy link
Copy Markdown
Contributor

@kzamanbd kzamanbd commented May 22, 2026

Summary

  • Add optional className to ThemeProvider; propagated through portal containers (Modal, Sheet, Dialog, AlertDialog, Popover, Tooltip, DropdownMenu, Select, Combobox) so consumers can scope portal styling.
  • Emit JS for each subpath export (components/ui, components/settings, providers, themes, lib/utils) via webpack entries; fix ./utils export to point at dist/lib/utils.*.
  • Minor: fallback 'Search...' placeholder in SettingsSidebar.

Test plan

  • npm run lint
  • npm run typecheck
  • Verify subpath imports resolve (@wedevs/plugin-ui/utils, /settings, /providers, /themes, /components/ui)
  • Verify portal containers pick up ThemeProvider className (Modal, Sheet, Tooltip, etc.)

Summary by CodeRabbit

  • New Features

    • Added configurable confirmation button tone support for destructive actions with 'destructive', 'positive', and 'default' options.
    • Enhanced theme styling integration across UI components for improved visual consistency.
  • Bug Fixes

    • Fixed settings sidebar search input placeholder to default to 'Search...' when not provided.
  • Chores

    • Updated package export mappings and webpack configuration.
    • Expanded barrel exports for new type definitions.

Review Change Stack

kzamanbd added 2 commits May 22, 2026 10:19
Add optional `className` to ThemeContextValue and thread it through
every Base-UI portal wrapper (alert-dialog, combobox, dialog,
dropdown-menu, modal, popover, select, sheet, tooltip) so consumers
can scope plugin-ui styles to a custom root class.

Also fall back to a default placeholder in SettingsSidebar search.
Add multi-entry webpack config so `./components/ui`, `./components/settings`,
`./providers`, `./themes`, and `./utils` resolve to real JS files. Repoint
the `./utils` export at `dist/lib/utils.*` (where `cn` already lives) rather
than a nonexistent `dist/utils/` path.

Note: each entry is a self-contained CJS bundle, so mixing subpath imports
with the root barrel can duplicate modules and break React context identity.
Pick one import style per consumer.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 613c0328-4e2c-4896-9636-a1f4688cd6c6

📥 Commits

Reviewing files that changed from the base of the PR and between e4894b4 and 9d7f864.

📒 Files selected for processing (17)
  • package.json
  • src/components/settings/settings-sidebar.tsx
  • src/components/ui/alert-dialog.tsx
  • src/components/ui/combobox.tsx
  • src/components/ui/dialog.tsx
  • src/components/ui/dropdown-menu.tsx
  • src/components/ui/index.ts
  • src/components/ui/modal.tsx
  • src/components/ui/popover.tsx
  • src/components/ui/select.tsx
  • src/components/ui/sheet.tsx
  • src/components/ui/tooltip.tsx
  • src/components/wordpress/DataViews.stories.tsx
  • src/components/wordpress/dataviews.tsx
  • src/index.ts
  • src/providers/theme-provider.tsx
  • webpack.config.js

📝 Walkthrough

Walkthrough

This PR extends theme styling infrastructure across UI components, adds configurable confirmation button tones for destructive DataViews actions, and updates build exports. Theme context now exposes an optional className field, which is applied to portal elements in nine UI components. DataViews destructive actions gain a new confirmTone type with a variant mapping. Type exports and build configuration are updated to support the changes.

Changes

Theme context and DataViews confirm tone feature

Layer / File(s) Summary
Theme context infrastructure
src/providers/theme-provider.tsx
ThemeContextValue gains optional className field; ThemeProvider now exposes className through context with updated dependency tracking.
UI components theme portal styling
src/components/ui/alert-dialog.tsx, src/components/ui/combobox.tsx, src/components/ui/dialog.tsx, src/components/ui/dropdown-menu.tsx, src/components/ui/modal.tsx, src/components/ui/popover.tsx, src/components/ui/select.tsx, src/components/ui/sheet.tsx, src/components/ui/tooltip.tsx
Nine UI portal components systematically apply theme?.className in their portal className composition alongside mode for consistent theme-aware styling.
DataViews destructive action confirm tone
src/components/wordpress/dataviews.tsx
Introduces ConfirmActionTone union type (`'destructive'
DataViews confirm tone story
src/components/wordpress/DataViews.stories.tsx
New ConfirmActionTones story demonstrates different confirmation button tones for destructive bulk actions with sample use cases and documented tone behavior.
Public type exports
src/components/ui/index.ts, src/index.ts
Barrel exports updated to include ConfirmActionTone and DestructiveActionConfig types from dataviews module.
Build configuration and minor updates
webpack.config.js, package.json, src/components/settings/settings-sidebar.tsx
Webpack entry points added for UI, settings, providers, themes, and utils modules; package.json utils export mapping updated from dist/utils/index to dist/lib/utils; settings sidebar search placeholder now defaults to 'Search...'.

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly Related PRs

  • getdokan/plugin-ui#83: Updates SheetPortal className composition to include mode plus optional theme?.className, directly parallel to the sheet component changes in this PR.
  • getdokan/plugin-ui#75: Modifies DialogContent/DialogPortal className handling to include theme?.className, overlapping with the dialog component updates here.
  • getdokan/plugin-ui#71: Updates modal portal root container className to incorporate theme-derived values, directly related to the modal component changes in this PR.

🐰 Theme and tone across the land,
Confirm buttons answer to our command,
Portals dressed in context's gentle hue,
DataViews dance in colors bold and true,
A harmonious UI renaissance anew! 🎨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/theme-provider-classname

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

Adds `confirmTone` ('destructive' | 'positive' | 'default') to action
config so the confirm button color matches intent. Defaults to
'destructive' for backward compatibility.
@kzamanbd kzamanbd merged commit 651c6df into main May 22, 2026
1 check passed
@kzamanbd kzamanbd deleted the feat/theme-provider-classname branch May 22, 2026 05:27
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