bs-accordion:
  label: Accordion libraries
  visibility: drupal
  namespace: "Organisms/Bootstrap/Accordion"
  use: "@organisms/tm-bs/accordion/_accordion_lib.twig"
  libraries:
    - accordion:
        css:
          component:
            ../styles/accordion.css: {}
        js:
          ../behaviors/accordion.js: { }


bs-accordion-items:
  namespace: "Organisms/Bootstrap/Accordion"
  use: "@organisms/tm-bs/accordion/_accordion_items.twig"
  label: Accordion - Items
  description: BS Accordion with data items in loop.
  fields:
    items:
      type: object
      label: Items
      preview:
        - pid: "parent"
          aiid: "item-a"
          label: "A title"
          content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. At ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget. Ipsum faucibus vitae aliquet nec ullamcorper. Phasellus faucibus scelerisque eleifend donec pretium vulputate. Ultricies tristique nulla aliquet enim tortor at. Nec feugiat nisl pretium fusce. Purus sit amet volutpat consequat mauris nunc congue. Scelerisque viverra mauris."
        - pid: "parent"
          aiid: "item-b"
          label: "B title"
          content: "Fames ac turpis egestas integer eget aliquet nibh praesent. Id eu nisl nunc mi ipsum faucibus vitae. Non arcu risus quis varius. Iaculis nunc sed augue lacus viverra. Et netus et malesuada fames ac turpis egestas. Donec enim diam vulputate ut pharetra sit amet aliquam id. Convallis convallis tellus id interdum velit laoreet id. Fermentum odio eu feugiat pretium nibh."
        - pid: "parent"
          aiid: "item-c"
          label: "C title"
          content: "Ultrices dui sapien eget mi proin. Sed euismod nisi porta lorem mollis aliquam. In pellentesque massa placerat duis ultricies. Enim facilisis gravida neque convallis a cras semper. Nunc sed id semper risus in hendrerit gravida rutrum quisque. Condimentum lacinia quis vel eros donec ac odio tempor. Integer vitae justo eget magna fermentum iaculis eu non diam. Eleifend mi in nulla posuere sollicitudin aliquam ultrices. Diam maecenas ultricies mi eget mauris."
          children:
            - pid: "item-c"
              aiid: "item-c-child-a"
              label: "C A title"
              content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. At ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget. Ipsum faucibus vitae aliquet nec ullamcorper. Phasellus faucibus scelerisque eleifend donec pretium vulputate. Ultricies tristique nulla aliquet enim tortor at. Nec feugiat nisl pretium fusce. Purus sit amet volutpat consequat mauris nunc congue. Scelerisque viverra mauris."
            - pid: "item-c"
              aiid: "item-c-child-b"
              label: "C B title"
              content: "Fames ac turpis egestas integer eget aliquet nibh praesent. Id eu nisl nunc mi ipsum faucibus vitae. Non arcu risus quis varius. Iaculis nunc sed augue lacus viverra. Et netus et malesuada fames ac turpis egestas. Donec enim diam vulputate ut pharetra sit amet aliquam id. Convallis convallis tellus id interdum velit laoreet id. Fermentum odio eu feugiat pretium nibh."
            - pid: "item-c"
              aiid: "item-c-child-c"
              label: "C C title"
              content: "Ultrices dui sapien eget mi proin. Sed euismod nisi porta lorem mollis aliquam. In pellentesque massa placerat duis ultricies. Enim facilisis gravida neque convallis a cras semper. Nunc sed id semper risus in hendrerit gravida rutrum quisque. Condimentum lacinia quis vel eros donec ac odio tempor. Integer vitae justo eget magna fermentum iaculis eu non diam. Eleifend mi in nulla posuere sollicitudin aliquam ultrices. Diam maecenas ultricies mi eget mauris."
    list_prefix:
      type: text
      label: List prefix
      description: Add an extra list item to the beginning. Only really good for Separated (tabs-like) situations.
    list_suffix:
      type: text
      label: List suffix
      description: Add an extra list item to the beginning. Only really good for Separated (tabs-like) situations.

  settings:
    pid:
      type: textfield
      label: Parent ID
      description: ID for accordion
      preview: "abc"
    toggle:
      type: select
      label: Toggle
      description: The icon used for collapse.
      options:
        sign: Sign
        chevron: Chevron
    open_first:
      type: boolean
      label: Open first
      description: Display first collapsible open on load.
      default_value: false
      preview: false
    show_close:
      type: boolean
      label: Show close
      default_value: false
      preview: false
    scroll_to:
      type: boolean
      label: Scroll to item
      default_value: false
      preview: false
    style:
      type: select
      label: Style
      description: Combined or Separated. This is so we can style an accordion as tabs.
      preview: combined
      default_value: combined
      options:
        combined: Combined
        separated: Separated
    absolute:
      type: boolean
      label: Absolute
      description: Make the contents absolute so it appears on top of following content. Only works with Separated.
      preview: false
      default_value: false
    wrapper_class:
      type: textfield
      label: Wrapper class
      description: Wrapper class
    wrapper_attributes:
      type: attributes
      label: Wrapper attributes
      description: Wrapper attributes
    child_content_class:
      type: textfield
      label: Child content class
      description: Content class
    child_content_attributes:
      type: attributes
      label: Child content attributes
      description: Content attributes
    child_link_attributes:
      type: attributes
      label: Child link attributes
      description: Link attributes
    child_link_class:
      type: textfield
      label: Child link class
      description: Link class
    child_variant:
      type: textfield
      label: Child variant
      description: Child variant.
  variants:
    __default:
      label: Default
      description: Default
    aci_a:
      label: Version A
      description: Version A
      settings:
        child_variant: aci_a
        wrapper_class: acw-a
        style: combined
        absolute: false
        toggle: ""
        child_content_class: ""
        child_content_attributes: ""
        child_link_class: ""
        child_link_attributes: ""
    aci_a_b:
      label: Version A (branded)
      description: Version A (branded)
      settings:
        child_variant: aci_a
        wrapper_class: acw-a branded
        style: combined
        absolute: false
        toggle: ""
        child_content_class: ""
        child_content_attributes: ""
        child_link_class: ""
        child_link_attributes: ""
    aci_a_c:
      label: Version A (alt)
      description: Version A (alt)
      settings:
        child_variant: aci_a
        wrapper_class: acw-a alt
        style: combined
        absolute: false
        toggle: ""
        child_content_class: ""
        child_content_attributes: ""
        child_link_class: ""
        child_link_attributes: ""
    aci_a_d:
      label: Version A (dark)
      description: Version A (dark)
      settings:
        child_variant: aci_a
        wrapper_class: acw-a dark
        style: combined
        absolute: false
        toggle: ""
        child_content_class: ""
        child_content_attributes: ""
        child_link_class: ""
        child_link_attributes: ""
    aci_b:
      label: Version B
      description: Version B
      settings:
        child_variant: aci_b
        wrapper_class: acw-b
        style: separated
        absolute: false
        toggle: ""
        child_content_class: ""
        child_content_attributes: ""
        child_link_class: ""
        child_link_attributes: ""
    aci_c:
      label: Version C
      description: Version C
      settings:
        child_variant: aci_c
        wrapper_class: acw-c
        style: separated
        absolute: true
        toggle: "chevron"
        child_content_class: ""
        child_content_attributes: ""
        child_link_class: ""
        child_link_attributes: ""
        show_close: true
    aci_c_b:
      label: Version C (alt)
      description: Version C (alt)
      settings:
        child_variant: aci_c
        wrapper_class: acw-c ac-alt
        style: separated
        absolute: true
        toggle: "chevron"
        child_content_class: ""
        child_content_attributes: ""
        child_link_class: ""
        child_link_attributes: ""
        show_close: true
    aci_c_nbgi:
      label: Version C (No BG image)
      description: Version C (No BG image)
      settings:
        child_variant: aci_c
        wrapper_class: acw-c nbgi
        style: separated
        absolute: true
        toggle: "chevron"
        child_content_class: ""
        child_content_attributes: ""
        child_link_class: ""
        child_link_attributes: ""
        show_close: true
    aci_d:
      label: Version D
      description: Version D
      settings:
        child_variant: aci_d
        wrapper_class: acw-d
        style: combined
        absolute: false
        toggle: ""
        child_content_class: ""
        child_content_attributes: ""
        child_link_class: ""
        child_link_attributes: ""

bs-accordion-children:
  namespace: "Organisms/Bootstrap/Accordion"
  use: "@organisms/tm-bs/accordion/_accordion_children.twig"
  label: Accordion - Children
  description: BS Accordion with prerendered children.
  fields:
    children:
      type: pattern
      label: Children
      preview:
        - id: bs-accordion-item
          fields:
            label: "A title"
            content: "Aliquam imperdiet euismod massa, vitae ultricies lacus aliquam non. Morbi imperdiet porttitor suscipit. Morbi vel gravida nunc. Donec vitae eros blandit, pharetra erat a, interdum quam."
            aiid: "a"
          settings:
            pid: "abc"
          variant: "aci_a"
        - id: bs-accordion-item
          fields:
            label: "B title"
            content: "Aliquam imperdiet euismod massa, vitae ultricies lacus aliquam non. Morbi imperdiet porttitor suscipit. Morbi vel gravida nunc. Donec vitae eros blandit, pharetra erat a, interdum quam."
            aiid: "b"
          settings:
            pid: "abc"
            toggle: "chevron"
          variant: "aci_b"
        - id: bs-accordion-item
          fields:
            label: "C title"
            content: "Aliquam imperdiet euismod massa, vitae ultricies lacus aliquam non. Morbi imperdiet porttitor suscipit. Morbi vel gravida nunc. Donec vitae eros blandit, pharetra erat a, interdum quam."
            aiid: "c"
          settings:
            pid: "abc"
          variant: "aci_c"
  settings:
    pid:
      type: textfield
      label: Parent ID
      description: ID for accordion
      preview: "abc"
    wrapper_class:
      type: textfield
      label: Wrapper class
      description: Wrapper class
    wrapper_attributes:
      type: attributes
      label: Wrapper attributes
      description: Wrapper attributes
  variants:
    __default:
      label: Default
      description: Default
    aci_a:
      label: Version A
      description: Version A
      settings:
        wrapper_class: acw-a
    aci_b:
      label: Version B
      description: Version B
      settings:
        wrapper_class: acw-b
    aci_c:
      label: Version C
      description: Version C
      settings:
        wrapper_class: acw-c
    aci_d:
      label: Version D
      description: Version D
      settings:
        wrapper_class: acw-d
