Commit Graph

8 Commits

Author SHA1 Message Date
dwindown
862abc8d74 feat: add shadcn/ui + Tailwind CSS v4 + Huge Icons foundation
- Install tailwindcss, @tailwindcss/postcss, clsx, tailwind-merge, class-variance-authority
- Install @hugeicons/react for icons
- Install Radix UI primitives (switch, tabs, label, separator, select, dialog, checkbox, dropdown-menu, popover)
- Install sonner for toast notifications
- Create postcss.config.js with Tailwind v4 PostCSS plugin
- Create jsconfig.json with @ path alias for src/admin
- Create components.json for shadcn configuration
- Update webpack.config.js with @ resolve alias
- Create globals.css with Tailwind v4 CSS-first config + shadcn CSS variables
- Create cn() utility in lib/utils.js
- Create 17 shadcn UI components (button, input, label, checkbox, switch, tabs, alert, separator, badge, textarea, dialog, sonner, table, skeleton, select, dropdown-menu, popover)
- Create async confirm() utility replacing SweetAlert2
- Create toast utility wrapping sonner
2026-04-19 12:27:20 +07:00
dwindown
d1de0015be feat: add React metabox island for coupon editor
- Create CouponMetabox React component with WPCFTO design system
- Add MetaboxLayout with vertical tabs (Rules, Restrictions)
- Implement Rules tab: active toggle, type radio, amount fields, multi-currency support
- Implement Restrictions tab: usage limit, date limit, autocomplete for forms/products/customers
- Add metabox registration in Coupon.php for formipay-coupon post type
- Update ReactAdmin to load assets on post.php edit screens
- Add autocomplete AJAX handler for relation fields
- Disable old WPCFTO metabox in favor of React island
2026-04-19 07:08:54 +07:00
dwindown
bde43d8c66 feat: update design system to match WPCFTO architecture
- Update CSS tokens to match WPCFTO values (sidebar #2c3e50, content #f0f3f5)
- Update Field component to 40%/60% 2-column layout
- Update Checkbox component to toggle switch UI
- Add GroupTitle component for visual section dividers
- Update TabNav component to WPCFTO sidebar styling
- Add MetaboxLayout component for 2-column wrapper
- Update TabPanel styles to match WPCFTO tab content area
- Fix Coupons page to use native WordPress post.php editor instead of modal

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-19 07:05:14 +07:00
dwindown
63e62b6a3e chore: rebuild assets after design system changes 2026-04-19 05:59:58 +07:00
dwindown
8529cfa2c0 feat: implement full-featured DataTable component
Implement comprehensive DataTable with all Grid.js features:
- Checkbox selection with "Select All"
- Bulk delete button (shows when rows selected)
- Inline row actions (edit, delete, duplicate) on hover
- Status filter tabs with counts
- Search input with debounce
- Sort dropdown (ID, date, title ASC/DESC)
- Server-side pagination
- "Add New" modal with SweetAlert2
- SweetAlert2 loaded via WordPress global scope

Updated Forms page to use new DataTable component with:
- Full column rendering (ID, title, date, status, shortcode)
- Copy shortcode button with toast notification
- All filter, search, sort, pagination features

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 17:10:45 +07:00
dwindown
e8fbfb14c1 fix: prevent asset conflicts between React and Grid.js versions
Add coexistence checks to all enqueue methods to prevent loading
both React and Grid.js assets simultaneously.

Changes:
- ReactAdmin.php: Only enqueue React assets when ?react=1
- Init.php: Skip Grid.js when React active on admin pages
- Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0
- Customer.php, Product.php, License.php: Add coexistence checks

Now the toggle between Classic and React versions works correctly.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 17:02:14 +07:00
dwindown
ab69d03f78 fix: React admin icon imports and mount point rendering
- Fix all @wordpress/icons imports - use build/ paths and call as functions
- Update all admin pages to render React mount points
- Components fixed: VariationPricingTable, NotificationLog, GlobalSettings,
  FormFieldOptions, OrderDetail, OrderListItem, OrderList, FormCanvas,
  AnalyticsDashboard, FormField, Products
- Admin pages updated: Order.php, Customer.php, Coupon.php, License.php,
  Product.php, Access.php, Form.php

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 13:28:57 +07:00
dwindown
6fd6d29fe8 fix: remove incompatible packages from dependencies
- Remove @wordpress/url (version doesn't exist)
- Remove unused @wordpress/date and @tanstack/react-table
- Keep only core WordPress dependencies that are actually used
- Add build/ directory with compiled assets
2026-04-18 13:14:39 +07:00