title: Button
fields:
  -
    handle: label
    field:
      input_type: text
      type: text
      localizable: true
      listable: false
      display: Label
      width: 50
      replicator_preview: false
      instructions_position: above
      antlers: false
  -
    handle: show_controls
    field:
      display: 'Show controls'
      type: toggle
      default: true
      icon: revealer
      listable: hidden
      width: 50
      instructions_position: below
  -
    handle: target_blank
    field:
      type: toggle
      localizable: true
      width: 33
      listable: false
      display: 'Open in new window?'
      replicator_preview: false
      if:
        show_controls: 'equals true'
  -
    handle: link_type
    field:
      options:
        entry: Entry
        url: URL
        email: E-mail
        tel: Telephone
        asset: Asset
      type: button_group
      localizable: true
      default: entry
      listable: false
      display: 'Link type'
      replicator_preview: false
      if:
        show_controls: 'equals true'
  -
    handle: entry
    field:
      max_items: 1
      mode: default
      type: entries
      localizable: true
      width: 50
      listable: false
      display: Entry
      replicator_preview: false
      validate:
        - 'required_if:{this}.link_type,entry'
      if:
        link_type: entry
        show_controls: 'equals true'
  -
    handle: url
    field:
      placeholder: 'https://site.com'
      input_type: url
      type: text
      localizable: true
      listable: false
      display: URL
      width: 50
      validate:
        - 'required_if:{this}.link_type,url'
      if:
        link_type: url
        show_controls: 'equals true'
  -
    handle: email
    field:
      placeholder: info@site.com
      input_type: email
      type: text
      localizable: true
      listable: false
      display: E-mail
      width: 50
      replicator_preview: false
      validate:
        - 'required_if:{this}.link_type,email'
      if:
        link_type: email
        show_controls: 'equals true'
  -
    handle: tel
    field:
      placeholder: '+0 (0)12 345678'
      input_type: tel
      type: text
      localizable: true
      listable: false
      display: Telephone
      width: 50
      replicator_preview: false
      validate:
        - 'required_if:{this}.link_type,tel'
      if:
        link_type: tel
        show_controls: 'equals true'
  -
    handle: asset
    field: common.image
    config:
      localizable: true
      width: 50
      display: Asset
      if:
        link_type: asset
        show_controls: 'equals true'
  -
    handle: button_type
    field:
      options:
        button: Button
        inline: Inline
      type: button_group
      localizable: true
      default: button
      listable: false
      display: 'Button type'
      replicator_preview: false
      if:
        show_controls: 'equals true'
  -
    handle: attr_title
    field:
      placeholder: 'Learn more'
      input_type: text
      type: text
      localizable: true
      listable: false
      display: Title
      width: 50
      replicator_preview: false
      if:
        show_controls: 'equals true'
  -
    handle: attr_aria
    field:
      placeholder: 'Download the PDF'
      input_type: text
      type: text
      localizable: true
      listable: false
      display: 'Aria label'
      width: 50
      replicator_preview: false
      if:
        show_controls: 'equals true'
