import hbs from 'htmlbars-inline-precompile'; import moment from 'moment'; export default { title: 'Components|Timeline', }; export let Standard = () => { return { template: hbs`
Timeline
  1. {{format-date yesterday}}
  2. Object number one
  3. Object number two
  4. {{format-date today}}
  5. Object number three

Timelines are a combination of objects and notes. Objects compose with boxed sections to create structure.

Timeline notes should be used sparingly when possible. In this example there is a note per day rather than a note per object.

`, context: { yesterday: moment().subtract(1, 'd'), today: moment(), }, }; }; export let Detailed = () => { return { template: hbs`
Detailed timeline
  1. {{format-date today}}
  2. Running Stable a387e243 Submitted {{moment-from-now (now)}}
  3. Complete Expired b3220efb Submitted {{format-month-ts yesterday}}
  4. {{format-date yesterday}}
  5. Failed Reverted fec9218e Submitted {{format-month-ts yesterday}}
`, context: { yesterday: moment().subtract(1, 'd'), today: moment(), }, }; }; export let Toggling = () => { return { template: hbs`
Toggling timeline objects
  1. {{format-date today}}
  2. Running Stable a387e243
    {{#if toggle1}}

    Some details for the timeline object.

    {{/if}}
  3. {{format-date yesterday}}
  4. Complete Expired b3220efb
    {{#if toggle2}}

    Some details for the timeline object.

    {{/if}}

`, context: { yesterday: moment().subtract(1, 'd'), today: moment(), }, }; }; export let Emphasizing = () => { return { template: hbs`
Emphasizing timeline objects
  1. {{format-date today}}
  2. Stable a387e243 Submitted {{moment-from-now (now)}}
  3. Pay attention here
    Expired b3220efb Submitted {{format-ts yesterday}}
  4. {{format-date yesterday}}
  5. Reverted fec9218e Submitted {{format-ts yesterday}}

By using a full boxed-section for an emphasized timeline object, the object takes up more space and gets more visual weight. It also adheres to existing patterns.

`, context: { yesterday: moment().subtract(1, 'd'), today: moment(), }, }; };