{#
Variables:
  - input:
    - type: radio|checkbox
    - name: foo
    - value: foo
    - checked: true|false
    - disabled: disabled|null
  - label_content: content
#}

{% set attributes = union_attributes(attributes|default([])) %}
{% set indicator_attributes = union_attributes(indicator_attributes|default([])) %}

{% if disabled %}
  {% set attributes = attributes.addClass('cu-checkbutton--disabled') %}
{% endif %}

{% set default_input_attributes = {
  'id': 'checkbutton',
  'type': 'radio',
  'name': 'cu-checkbutton',
  'value': '',
  'checked': ''
}%}

{% set input_attributes = union_attributes(input_attributes|default(default_input_attributes)) %}

<div{{ attributes.addClass('cu-checkbutton') }}>
  {% include "@union/_form-input.twig" with {
    attributes: input_attributes.addClass(['cu-checkbutton__input'])
  } %}
  <label class="cu-checkbutton__label" for="{{ input_attributes.id }}">
    <div class="cu-checkbutton__content">
      {{ label_content }}
    </div>
    <div{{ indicator_attributes.addClass('cu-checkbutton__indicator')}}></div>
  </label>
</div>
