Skip to content

V4 status component#2406

Open
sazedul-haque wants to merge 5 commits into4.0.0-devfrom
v4-status-component
Open

V4 status component#2406
sazedul-haque wants to merge 5 commits into4.0.0-devfrom
v4-status-component

Conversation

@sazedul-haque
Copy link
Collaborator

Status component added to change status from list.
Screenshot 2026-03-03 at 10 45 40 AM

Introduce a new StatusSelect UI component: adds PHP builder (components/StatusSelect.php) for server rendering and Alpine props, a TypeScript Alpine controller (assets/core/ts/components/status-select.ts) to handle variant classes and AJAX status updates, and SCSS styling with variant tokens (assets/core/scss/components/_status-select.scss). Also export the component in the core SCSS index and register statusSelectMeta in the TS index so it initializes with other components.
@sazedul-haque sazedul-haque added the 4.0.0 Tutor v4.w0w label Mar 3, 2026
Introduce a new $grid-split-utils SCSS map with predefined non-uniform column splits and a loop to generate .tutor-grid-cols-<name> classes (e.g. '1-5-1': 1.5fr 1fr, '2-1': 2fr 1fr, '1-2': 1fr 2fr). This provides specific grid-template-columns options in addition to the existing repeat-based grid column utilities and preserves .tutor-grid-cols-none.
Introduce a new protected property $menu_min_width and a fluent setter menu_min_width(string): self. When set, the popover menu wrapper will include an inline style to apply a min-width. Includes docblocks and an @SInCE tag for the new API.

use TUTOR\Icon;

defined( 'ABSPATH' ) || exit;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use this immediate after namespace.

>
<?php foreach ( $this->options as $value => $option ) : ?>
<option value="<?php echo esc_attr( $value ); ?>" <?php selected( $this->selected, $value ); ?>>
<?php echo esc_html( $option['label'] ); ?>
Copy link
Collaborator

Choose a reason for hiding this comment

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

$option['label'] ?? ''

'selected' => $this->selected,
'action' => $this->action,
'data' => $this->data,
'variants' => array_map(
Copy link
Collaborator

Choose a reason for hiding this comment

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

single statement. use arrow fn

'variants' => array_map( fn( $opt ) =>  $opt['variant'] ?? 'default', $options )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.0.0 Tutor v4.w0w

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants