login-timeline.stories.mjs (1472B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 import { html } from "lit.all.mjs"; 6 // Imported for side-effects. 7 import "../../aboutlogins/content/components/login-timeline.mjs"; 8 9 export default { 10 title: "Domain-specific UI Widgets/Credential Management/Timeline", 11 component: "login-timeline", 12 }; 13 14 window.MozXULElement.insertFTLIfNeeded("browser/aboutLogins.ftl"); 15 16 const Template = ({ historyItems }) => html` 17 <login-timeline .history=${historyItems}></login-timeline> 18 `; 19 20 const ACTION_ID_CREATED = "login-item-timeline-action-created"; 21 const ACTION_ID_UPDATED = "login-item-timeline-action-updated"; 22 const ACTION_ID_USED = "login-item-timeline-action-used"; 23 24 export const EmptyTimeline = Template.bind({}); 25 EmptyTimeline.args = { 26 historyItems: [], 27 }; 28 29 export const TypicalTimeline = Template.bind({}); 30 TypicalTimeline.args = { 31 historyItems: [ 32 { actionId: ACTION_ID_CREATED, time: 1463526500267 }, 33 { actionId: ACTION_ID_UPDATED, time: 1653621219569 }, 34 { actionId: ACTION_ID_USED, time: 1561813190300 }, 35 ], 36 }; 37 38 export const AllSameDayTimeline = Template.bind({}); 39 AllSameDayTimeline.args = { 40 historyItems: [ 41 { actionId: ACTION_ID_CREATED, time: 1463526500267 }, 42 { actionId: ACTION_ID_UPDATED, time: 1463526500267 }, 43 { actionId: ACTION_ID_USED, time: 1463526500267 }, 44 ], 45 };