Écrans : onboarding, accueil, séance guidée, minuteur, historique
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ba08daaa89
commit
af92c021e2
@@ -0,0 +1,42 @@
|
||||
// Morceaux de mise en page communs aux écrans.
|
||||
|
||||
import { h } from "./dom.js";
|
||||
|
||||
/**
|
||||
* En-tête d'écran : surtitre, titre en capitales condensées, sous-titre.
|
||||
* @param {{kicker?: string, title: string, sub?: string|null, back?: {label: string, onClick: () => void}}} o
|
||||
*/
|
||||
export function screenHeader({ kicker, title, sub, back }) {
|
||||
return h("header", { class: "screen-head" },
|
||||
back && h("button", { type: "button", class: "back", on: { click: back.onClick } },
|
||||
h("span", { "aria-hidden": "true" }, "← "), back.label),
|
||||
kicker && h("p", { class: "kicker" }, kicker),
|
||||
h("h1", { class: "title" }, title),
|
||||
sub && h("p", { class: "lede" }, sub));
|
||||
}
|
||||
|
||||
/**
|
||||
* Titre de section.
|
||||
* @param {string} text
|
||||
* @param {string} [hint]
|
||||
*/
|
||||
export function sectionLabel(text, hint) {
|
||||
return h("h2", { class: "section-label" }, text, hint && h("span", { class: "section-label__hint" }, hint));
|
||||
}
|
||||
|
||||
/**
|
||||
* Barre d'action collée en bas de l'écran, à portée de pouce.
|
||||
* @param {...(Node|null|false)} children
|
||||
*/
|
||||
export function actionBar(...children) {
|
||||
return h("div", { class: "action-bar" }, h("div", { class: "action-bar__in" }, ...children));
|
||||
}
|
||||
|
||||
/**
|
||||
* Petite carte de texte (cardio, repères).
|
||||
* @param {string} title
|
||||
* @param {string} text
|
||||
*/
|
||||
export function note(title, text) {
|
||||
return h("article", { class: "note" }, h("h3", { class: "note__title" }, title), h("p", { class: "note__text" }, text));
|
||||
}
|
||||
Reference in New Issue
Block a user