Aller au contenu
Aubui · API figée (API.md)
Référence

API figée

Le contrat : attributs, classes et globales autorisés. Besoin nouveau → d’abord ici, ensuite l’usage.

Source : ui.aubota.xyz/API.md — rendu à la volée, toujours à jour.

Ne pas inventer d’attributs ou de classes hors de cette liste.
Besoin nouveau → ajouter ici + CSS + page catalogue, puis utiliser.

Installation

HTML
<script src="https://ui.aubota.xyz/js/aubui.js" defer></script>

Le script injecte automatiquement le CSS et charge, dans l’ordre : dialog.js, engine.js, theme.js, accent.js, actions.js, aubui-invite.js, puis (mode complet) navbar.js, notifications.js, timepicker.js. Mode léger : window.AubotaNav = { disabled: true } avant le script.

Point d’entrée CSS (si besoin manuel) : https://ui.aubota.xyz/css/aubui/aubui.full.css?v=<AUB_BUILD> avec data-aubui-css="1" (évite le double chargement). aubui.css à la racine reste un alias de compatibilité.

Doc vivante de chaque élément ci-dessous : https://ui.aubota.xyz/

Syntaxe déclarative (recommandée)

Tu écris des attributs. Le moteur ajoute les classes.

Boutons — aub-btn

HTML
<button aub-btn primary sm>OK</button>
AttributClasse générée
aub-btn.aub-btn
primary.aub-btn--primary
ghost.aub-btn--ghost
danger.aub-btn--danger
success.aub-btn--success
sm md lg.aub-btn--sm etc.
block.aub-btn--block

Cartes — aub-card

HTML
<div aub-card pad>
  <h3 aub-title>Titre</h3>
  <p aub-muted>Corps</p>
</div>
AttributClasse
aub-card.aub-card
pad.aub-card--pad
aub-title.aub-card__title

Champs

AttributClasse
aub-field.aub-field
aub-label.aub-label
aub-input.aub-input
block (sur input).aub-input--block
aub-hint.aub-hint

Alertes & badges

AttributClasse
aub-alert + info|success|warning|danger.aub-alert--…
aub-badge + variante.aub-badge--…

Texte

AttributClasse
aub-muted.aub-muted
aub-link.aub-link
aub-code.aub-code
aub-pre.aub-pre
aub-text-sm aub-text-xs aub-text-lgtailles
HTML
<nav aub-nav brand="Feedback" brand-href="/">
  <a href="/public">Publics</a>
  <a href="/submit">Soumettre</a>
</nav>
AttributRôle
aub-navactive le moteur navbar
brand="…"texte du brand
brand-href="…"lien du brand (défaut /)
no-notifn’ajoute pas la cloche
no-themen’ajoute pas le bouton thème

Généré automatiquement :

  • .aub-nav__brand
  • .aub-nav__links + .aub-nav__link (+ --active selon l’URL)
  • .aub-nav__spacer
  • .aub-nav__actions (cloche + thème + burger)
  • Drawer mobile (.aub-nav__drawer) + overlay

Breakpoint hamburger : ≤ 720px

Notifications

Structure générée dans la navbar (ou manuelle) :

ClasseRôle
.aub-notifconteneur
.aub-notif__btnbouton cloche
.aub-notif__badgecompteur (.is-visible)
.aub-notif__dropdownpanneau (.is-open)
.aub-notif__listliste
.aub-notif__itemitem (.is-unread)
JS
AubotaNotif.setCount(3);
AubotaNotif.render([
  { id: 'n1', module: 'Hub', title: '…', body: '…', ts: 1760000000, unread: true, href: '/…' }
]);
AubotaNotif.toast({ module, title, body, href, onClick });
AubotaNotif.load();

Endpoint : GET → { ok, unread, items[] }, POST { act: 'read', id }. Événements document : aubota:notif-new (émis, {items}), aubota:notif-count (écouté, {unread}), aub-nav-ready (écouté).

Classes classiques (toujours valides)

Tu peux continuer à écrire :

HTML
<button class="aub-btn aub-btn--primary aub-btn--sm">OK</button>

Utile pour la migration progressive ou le CSS direct.

Boutons — .aub-btn

ModificateurRôle
--primaryaction principale
--ghostdiscret
--dangerdestructif
--successvalidation
--sm --lgtaille
--blockpleine largeur

Champs — .aub-field + .aub-label + .aub-input

ClasseRôle
.aub-fieldgroupe label + contrôle
.aub-labellabel
.aub-inputinput / select / textarea
.aub-input--blocklargeur 100%
.aub-hintaide sous le champ
.aub-checkcheckbox / radio + label
.aub-check-grouppile de checks
.aub-check-group--rowen ligne
.aub-fieldsetgroupe / catégorie
.aub-password-wrapinput + bouton œil (auth)

Cartes & alertes

ClasseRôle
.aub-cardcarte
.aub-card--padpadding
.aub-card__titletitre
.aub-card__bodycorps
.aub-alertalerte
.aub-alert--info|success|warning|dangervariante
.aub-badgebadge

Layout utilitaires

.aub-flex .aub-grid .aub-flex-col .aub-items-center .aub-justify-between .aub-gap-2 … .aub-gap-6 .aub-mt-* .aub-mb-* .aub-p-* .aub-stack .aub-stack-lg .aub-max-w-md

Comportements data-aub-*

AttributEffet
data-aub-action="toggle" + data-aub-targetaffiche/masque
data-aub-action="show|hide" + targetforce
data-aub-action="copy" + data-aub-copy ou data-aub-copy-frompresse-papiers
data-aub-action="dismiss"masque [data-aub-dismissible] parent
data-aub-confirm="Message" (+ data-aub-confirm-title, data-aub-confirm-ok, data-aub-danger)lightbox AubuiDialog avant clic / envoi (<a>, <button>, <form>)
data-aub-theme-toggledark/light
data-aub-theme-set="dark|light"reçoit .is-active quand ce thème est actif
data-accent-set="blue|yellow|green|coral|purple|teal"accent (.aub-accent-dot)
input[type=radio][data-aub-accent-input]accent au change
data-aub-accent-pickerpicker repliable

API JS globale

JS
Aubui.process()       // re-scan attributs sur tout le document
Aubui.processNav()    // re-scan navbars
AubotaNotif.setCount(n)
AubotaNotif.render(items)
AubotaNotif.open()
AubotaNotif.close()
AubotaNotif.load()
AubotaNotif.toast(opts)

AubuiDialog.alert(msg, { title, ok, danger })               // Promise<void>
AubuiDialog.confirm(msg, { title, ok, cancel, danger })     // Promise<boolean>
AubuiDialog.prompt(msg, { value, placeholder, title, ok, cancel, type, multiline }) // Promise<string|null>
AubuiToast.show(msg, { kind, duration, action: { label, onClick } })  // { close() }
AubuiToast.success|error|warning|info(msg, opts)

AubuiTheme.apply('dark'|'light', { persist })  ·  AubuiTheme.current()
AubuiAccent.apply(name, { persist })  ·  AubuiAccent.current()  ·  AubuiAccent.accents  ·  AubuiAccent.buildHtml(opts)
AubuiPrefsSync.save({ accent, theme, … })  ·  AubuiPrefsSync.readCookie()

AubuiTime.scan(root)  ·  AubuiTime.enhance(input)
AubuiSearch.init(input)  ·  AubuiSearch.scan(root)
AubInvite.require({ action, title, body, cta, dismiss, next })  // Promise<boolean>
AubInvite.isDemo()  ·  AubInvite.guard(fn, opts)
AubotaNavMount()

Événements document : aubui:dialog-ready, aubui:theme {theme}, aubui:accent {accent}, aubui:prefs-ready, aubui:prefs-saved, aubui:prefs-error {error}. Sur l’input de recherche : aubui:search:select (detail = résultat, annulable).

Interdit dans les modules : alert(), confirm(), prompt() natifs → AubuiDialog / data-aub-confirm.

Pages layout (minces)

/css/aubui/pages/home.css auth.css share.css social.css feedback.css natacha.css — structure seulement.

Feedback — classes page (feedback.css)

ClasseRôle
.aub-feedbackshell body
.aub-feedback-mainconteneur principal
.aub-feedback-admin-layoutgrille admin
.aub-feedback-user-listcolonne utilisateurs
.aub-feedback-listcolonne tickets
.aub-feedback-ticketcarte ticket
.aub-feedback-imagesgalerie captures
.aub-feedback-replybulle réponse
.aub-feedback-admin-formzone actions admin

Natacha — classes page (natacha.css)

ClasseRôle
.aub-natachashell body
.aub-natacha-mainconteneur principal
.aub-natacha-filtersrangée de filtres / contrôles
.aub-natacha-ticketsgrille liste + détail
.aub-natacha-tickets__listcolonne tickets
.aub-natacha-tickets__item (+ .is-active .is-new)ligne ticket cliquable
.aub-natacha-tickets__detailpanneau détail
.aub-natacha-imagesgalerie captures
.aub-natacha-replybulle réponse
.aub-natacha-pretexte multi-ligne
.aub-natacha-detail-griddétail : 2 colonnes (≥ 1300px)
.aub-natacha-progress + __barbarre d'avancement des tâches
.aub-natacha-tasks + __row (.is-done) __actionsarbre de tâches
.aub-natacha-reply.is-team / .is-internalbulle équipe / annotation interne
.aub-natacha-logligne de journal automatique

Social — classes page (social.css)

ClasseRôle
.aub-socialshell page
.aub-social-main .aub-social-main--narrowconteneur contenu
.aub-social-search + __results __item __emptyrecherche live
.aub-feed + __loading __emptygrille feed
.aub-media-card + __media __body __title __meta __desccarte post
.aub-garage + __addgrille garage
.aub-specsliste specs
.aub-profile-head + __name __actionsen-tête profil
.aub-settings-row + __label __valueligne paramètres

Injectée automatiquement par aubui.js (sauf AubotaNav.disabled = true).

HTML
<script>
window.AubotaNav = {
  site: 'feedback',
  user: { loggedIn: true, name: 'fusty' },
  links: [
    { href: '/', label: 'Accueil' },
    { href: '/public', label: 'Publics' }
  ]
};
</script>
<script src="https://ui.aubota.xyz/js/aubui.js" defer></script>
CléRôle
siteGrand module actif (home, social, feedback, hub…)
user.loggedIn / user.nameAffiche Connexion ou le pseudo
linksSous-nav du module (optionnel)
disabledtrue = pas de navbar (ex. pages auth)

Structure : barre :AUBOTA + modules · trait accent · sous-nav centrée.

Règle d’or

Toute nouvelle UI = une ligne dans ce fichier + CSS + entrée catalogue + doc.

Concrètement : toute nouveauté Aubui = une section de doc dans pages/ + son entrée (avec sources et news) dans docs/registry.php, livrées avec le code. Voir README, « Règle ».

Time picker — aub-time

Roues heures / minutes (précision 1 min), style curseur central.

HTML
<input aub-time name="start_time" value="09:00">
<input aub-time name="end_time" value="" data-aub-time-empty>
AttributRôle
aub-timeActive le picker (input → hidden + bouton)
data-aub-time-emptyAutorise vide (bouton Effacer)
data-aub-time-stepPas des minutes (défaut 1)

Chargé automatiquement via aubui.js (mode complet).

Recherche — data-aubui-search (aubui-search.js, non chargé par aubui.js)

HTML
<link rel="stylesheet" href="https://ui.aubota.xyz/css/aubui/components/search.css">
<script src="https://ui.aubota.xyz/js/aubui-search.js" defer></script>
<input data-aubui-search data-search-url="/api/search" data-search-params='{"scope":"users"}' data-search-min="2">
<input data-aubui-search data-search-list-var="MES_DONNEES" data-search-fields="label,sub">
AttributRôle
data-search-urlendpoint GET ?q=&limit= → [{label, sub, href, icon, …}] ou {results: […]}
data-search-paramsJSON ajouté à la requête
data-search-list-varnom d’une globale (tableau) pour une recherche locale
data-search-fieldschamps comparés (défaut label,sub)
data-search-min / data-search-limitdéfauts 1 / 12

Classes : .aub-search-wrap .aub-search .aub-search-results .aub-search-item (.is-active) .aub-search-ico .aub-search-main .aub-search-label .aub-search-sub .aub-search-empty.

États vides — .aub-empty (Hub seulement pour l’instant)

.aub-empty + __icon __title __text __cta. Squelettes Hub : .hub-skel + --line --title --block. Styles dans hub.aubota.xyz/assets/polish.css, pas encore dans aubui.full.css.

Aubui · design system AUBOTA · version 2026-10-19-3 · API figée · README · Une nouveauté Aubui = une section ici.