<?php

use Silvanus\includes\blocks\AcfBlockFields;

try {
    $fields = new AcfBlockFields('Column Single', __FILE__);

    $fields->addGroup('column_settings', ['layout' => 'row'])
        ->addNumber('width_default', [
            'label' => 'Default width',
            'default_value' => 12,
            'min' => 1,
            'max' => 12,
            'step' => 1,
            'instructions' => 'Bootstrap column width for extra small screens.',
        ])
        ->addNumber('width_sm', [
            'label' => 'SM width',
            'default_value' => 0,
            'min' => 0,
            'max' => 12,
            'step' => 1,
            'instructions' => 'Optional. Leave 0 to skip.',
        ])
        ->addNumber('width_md', [
            'label' => 'MD width',
            'default_value' => 0,
            'min' => 0,
            'max' => 12,
            'step' => 1,
            'instructions' => 'Optional. Leave 0 to skip.',
        ])
        ->addNumber('width_lg', [
            'label' => 'LG width',
            'default_value' => 0,
            'min' => 0,
            'max' => 12,
            'step' => 1,
            'instructions' => 'Optional. Leave 0 to skip.',
        ])
        ->addNumber('width_xl', [
            'label' => 'XL width',
            'default_value' => 0,
            'min' => 0,
            'max' => 12,
            'step' => 1,
            'instructions' => 'Optional. Leave 0 to skip.',
        ])
        ->addNumber('width_xxl', [
            'label' => 'XXL width',
            'default_value' => 0,
            'min' => 0,
            'max' => 12,
            'step' => 1,
            'instructions' => 'Optional. Leave 0 to skip.',
        ])
        ->endGroup();

    return $fields->build();
} catch (\StoutLogic\AcfBuilder\FieldNameCollisionException $e) {
    // no-op
}