best_fares:
  namespace: "Organisms/TM - Best Fares"
  use: "@organisms/tm-bf/_best-fares.twig"
  label: Best Fares
  description: Best Fares
  libraries:
    - best_fares_lib:
        js:
          ../behaviors/best-fares.js: { }
        css:
          component:
            ../styles/best-fares.css: { weight: 10 }

  fields:

    header_text:
      type: text
      label: Header template string
      preview: "Best fares {{dir_a}} {{stations}} {{dir_b}}"

    stations_list:
      type: object
      label: Tickets
      preview:
        LON: "London"
        NOR: "Norwich"
        BRS: "Bristol"

    tickets:
      type: object
      label: Tickets
      preview:
        LON:
          - title: "Colchester Colchester Colchester"
            price: 3
            direction: "one way"
          - title: "Chelmsford"
            price: 3.1
            direction: "one way"
          - title: "Ipswitch"
            price: 3.99
            direction: "return"
          - title: "Bishops Stortford Bishops Stortford"
            price: "3"
            direction: "return"
          - title: "Harlow Mill"
            price: "3.1"
            direction: "return"
          - title: "Billericay"
            price: "3.99"
            direction: "one way"
        NOR:
          - title: "Norwich Norwich Norwich Norwich"
            price: "10"
            direction: "one way"
          - title: "Cambridge"
            price: "8"
            direction: "one way"
          - title: "Southend Victoria"
            price: "6"
            direction: "one way"
          - title: "Southend Victoria Southend Victoria"
            price: "6"
            direction: "one way"
          - title: "Southend Victoria"
            price: "6"
            direction: "one way"
          - title: "Southend Victoria"
            price: "6"
            direction: "one way"
          - title: "Southend Victoria Southend Victoria"
            price: "6"
            direction: "one way"
          - title: "Southend Victoria"
            price: "6"
            direction: "one way"
          - title: "Southend Victoria"
            price: "6"
            direction: "one way"
        BRS:
          - title: "Norwich Norwich Norwich Norwich"
            price: "10"
            direction: "one way"
          - title: "Cambridge"
            price: "8"
            direction: "one way"
          - title: "Southend Victoria"
            price: "6"
            direction: "one way"

  settings:

    button_size:
      type: select
      label: Button size
      default_value: btn-md
      options:
        md: Normal
        sm: Small
        lg: large

    status:
      type: select
      label: Select button status
      default_value: default
      options:
        default: Default Branded
        primary: Primary
        secondary: Secondary
        success: Success
        danger: Danger
        warning: Warning
        info: Info
        light: Light
        dark: Dark
        none: None

    card_button_status:
      type: select
      label: Book button status
      default_value: default
      options:
        default: Default Branded
        primary: Primary
        secondary: Secondary
        success: Success
        danger: Danger
        warning: Warning
        info: Info
        light: Light
        dark: Dark
        none: None

    direction:
      type: select
      label: Direction
      default_value: from
      options:
        from: Fares to the main station (from)
        to: Fares from the main station (to)

    icon:
      type: textfield
      label: Icon

    add_mobile_button:
      type: boolean
      label: Add mobile button

best_fares_station_select:
  namespace: "Organisms/TM - Best Fares"
  use: "@organisms/tm-bf/_best-fares-station-select.twig"
  label: Station select
  description: Station select

  fields:
    stations_list:
      type: object
      label: Tickets
      preview:
        LON: "London"
        NOR: "Norwich"
        BRS: "Bristol"

    tickets:
      type: object
      label: Tickets
      preview:
        LON:
          - title: "Colchester"
            price: "10"
            direction: "one way"
          - title: "Chelmsford"
            price: "16.90"
            direction: "one way"
          - title: "Ipswitch"
            price: "16.90"
            direction: "return"
          - title: "Bishops Stortford"
            price: "17.60"
            direction: "return"
          - title: "Harlow Mill"
            price: "14.20"
            direction: "return"
          - title: "Billericay"
            price: "14.10"
            direction: "one way"
        NOR:
          - title: "Norwich"
            price: "10"
            direction: "one way"
          - title: "Cambridge"
            price: "8"
            direction: "one way"
          - title: "Southend Victoria"
            price: "6"
            direction: "one way"
          - title: "Southend Victoria"
            price: "6"
            direction: "one way"
          - title: "Southend Victoria"
            price: "6"
            direction: "one way"
          - title: "Southend Victoria"
            price: "6"
            direction: "one way"
          - title: "Southend Victoria"
            price: "6"
            direction: "one way"
          - title: "Southend Victoria"
            price: "6"
            direction: "one way"
          - title: "Southend Victoria"
            price: "6"
            direction: "one way"
        BRS:
          - title: "Norwich"
            price: "10"
            direction: "one way"
          - title: "Cambridge"
            price: "8"
            direction: "one way"
          - title: "Southend Victoria"
            price: "6"
            direction: "one way"
