label: Hero

form:
  properties:
    heroDesign:
      $type: switchableField
      label: Design
      field:
        $type: radioButtonGroupField
        layout: horizontal
        defaultValue: small
        datasource:
          $type: optionListDatasource
          options:
            - name: tall
              value: tall
              label: Tall
            - name: small
              value: small
              label: Small
      itemProvider:
        $type: jcrChildNodeProvider
      forms:
        - name: tall
          properties:
            tall:
              $type: staticField
              label: ""
              value: ""
        - name: small
          properties:
            small:
              $type: staticField
              label: ""
              value: ""
    heroBackgroundOverlay:
      $type: sliderField
      label: Overlay opacity
      valueFormat: PERCENTAGE
      defaultValue: 0
      min: 0
      max: 50
      stepSize: 10
      gridStepSize: 10
    heroHeadline:
      $type: textField
      label: Headline
      rows: 3
      i18n: true
    heroHeadlineSize:
      $type: switchableField
      label: Headline size
      field:
        $type: radioButtonGroupField
        layout: horizontal
        defaultValue: h1
        datasource:
          $type: optionListDatasource
          options:
            - name: h1
              value: h1
              label: h1
            - name: h2
              value: h2
              label: h2
            - name: h3
              value: h3
              label: h3
            - name: h4
              value: h4
              label: h4
      itemProvider:
        $type: jcrChildNodeProvider
      forms:
        - name: h1
          properties:
            h1:
              $type: staticField
              label: ""
              value: ""
        - name: h2
          properties:
            h2:
              $type: staticField
              label: ""
              value: ""
        - name: h3
          properties:
            h3:
              $type: staticField
              label: ""
              value: ""
        - name: h4
          properties:
            h4:
              $type: staticField
              label: ""
              value: ""
    heroText:
      $type: textField
      label: Text
      rows: 5
      i18n: true
    heroCountdownDate:
      label: Countdown date
      $type: dateField
      type: java.util.Date
      time: true
    heroCtas:
      label: CTAs
      description: Set maximum of 4 CTAs
      $type: jcrMultiField
      itemProvider:
        $type: jcrChildNodeProvider
      field:
        $type: compositeField
        itemProvider:
          $type: jcrChildNodeProvider
        properties:
          linkLabel:
            label: Button label
            $type: textField
            i18n: true
          #link: !include:/corpweb2021/includes/dialogs/link.yaml
    heroCtasNoChild:
      label: CTAs
      description: Set maximum of 4 CTAs
      $type: jcrMultiField
      itemProvider:
        $type: jcrChildNodeProvider
      field:
        $type: compositeField
        properties:
          linkLabel:
            label: Button label
            $type: textField
            i18n: true
          #link: !include:/corpweb2021/includes/dialogs/link.yaml
    heroCtaStyle:
      $type: checkBoxField
      label: CTA style
      buttonLabel: Select to style CTAs as button
    heroVideo:
      $type: damLinkField
      label: Select video
      description: Video has precedence over images
    heroImage:
      $type: damLinkField
      label: Select desktop image
    heroImageMobile:
      $type: damLinkField
      label: Select mobile image
    heroImageAltText:
      $type: textField
      label: Image alt text
    heroMedia:
      $type: switchableField
      label: Type
      field:
        $type: radioButtonGroupField
        layout: horizontal
        defaultValue: none
        datasource:
          $type: optionListDatasource
          options:
            - name: none
              value: none
              label: None
            - name: logo
              value: logo
              label: Logo + badge
            - name: partner
              value: partner
              label: Partner
            - name: coverImage
              value: coverImage
              label: Cover image
      itemProvider:
        $type: jcrChildNodeProvider
      forms:
        - name: none
          properties:
            none:
              $type: staticField
              label: No media
              value: ""
        - name: logo
          properties:
            logo:
              $type: damLinkField
              label: Select logo
            tier:
              label: Badge
              $type: comboBoxField
              defaultValue: noTier
              datasource:
                $type: optionListDatasource
                options:
                  - name: noTier
                    label: None
                    value: noTier
                  - name: platinum
                    label: Platinum
                    value: platinum
                  - name: gold
                    label: Gold
                    value: gold
                  - name: partner
                    label: Partner
                    value: parter
                  - name: technology
                    label: Technology
                    value: technology
        - name: partner
          properties:
            partner:
              $type: linkField
              label: Partner
              buttonSelectNewLabel: Select partner
              buttonSelectOtherLabel: Select another
              preview:
                implementationClass: info.magnolia.contacts.app.ContactPreview
              chooser:
                workbenchChooser:
                  appName: partners
        - name: coverImage
          properties:
            coverImage:
              $type: damLinkField
              label: Select cover image
            coverImageAltText:
              $type: textField
              label: Image alt text
  layout:
    $type: tabbedLayout
    tabs:
      tabLayout:
        label: Layout
        fields:
          - name: heroDesign
          - name: heroBackgroundOverlay
      tabMain:
        label: Main
        fields:
          - name: heroHeadline
          - name: heroHeadlineSize
          - name: heroText
          - name: heroCountdownDate
      tabCtas:
        label: Links
        fields:
          - name: heroCtaStyle
          - name: heroCtas
          - name: heroCtasNoChild
      tabBackgroundMedia:
        label: Background media
        fields:
          - name: heroImage
          - name: heroImageMobile
          - name: heroImageAltText
          - name: heroVideo
      tabMedia:
        label: Media
        fields:
          - name: heroMedia

actions:
  commit:
    $type: commitAction

  cancel:
    $type: closeAction
