Icônes
Deux librairies coexistent dans le DS b.connect. Elles ont des usages distincts.
| Librairie | Usage | Disponibilité |
|---|---|---|
| Bootstrap Icons | Props de composants DS (icon="bi-xxx") | Globale — aucun import |
| Phosphor Icons | Pages VitePress / templates Vue | Import par composant |
Bootstrap Icons
Intégrées dans les composants DS. Aucun import nécessaire — passer le nom de l'icône en prop.
Usage dans les composants
<!-- BcButton -->
<bc-button variant="primary" icon="bi-plus">Ajouter</bc-button>
<bc-button variant="ghost" icon="bi-download" icon-only />
<!-- BcDropdownMenu (menu contextuel data-driven) -->
<BcDropdownMenu :items="[
{ id: 'view', label: 'Voir le détail' },
{ id: 'delete', label: 'Supprimer' },
]" @select="onAction" />
<!-- BcAlert -->
<BcAlert variant="warning" icon="bi-exclamation-triangle">
Vérification requise
</BcAlert>
<!-- Inline dans les templates (hors props) -->
<i class="bi bi-three-dots-vertical" />Règle : Dans les props de composant, passer uniquement le nom (
"bi-xxx"). Les balises<i class="bi bi-xxx">sont valides dans les contenus de slot et templates libres.
Icônes les plus utilisées
| Icône | Nom | Label | Contexte d'usage |
|---|---|---|---|
| bi-eye | Voir / consulter | Ligne de tableau, détail dossier | |
| bi-pencil | Modifier | Action édition | |
| bi-trash | Supprimer | Action danger — toujours après séparateur | |
| bi-plus | Ajouter / créer | BcButton primary, CommandBar | |
| bi-download | Exporter / télécharger | CommandBar, actions bulk | |
| bi-upload | Importer / uploader | BcFileUpload, CommandBar | |
| bi-check | Confirmer / valider | État succès, confirmation | |
| bi-x | Fermer / annuler | Modale, toast, tags | |
| bi-three-dots-vertical | Actions contextuelles | BcDropdownMenu dans les tables | |
| bi-arrow-clockwise | Relancer / rafraîchir | Retry, reload | |
| bi-info-circle | Information | BcTooltip trigger, aide contextuelle | |
| bi-exclamation-triangle | Avertissement | BcAlert warning, validation | |
| bi-shield-check | KYB / sécurité validée | Statut KYB, conformité | |
| bi-shield-lock | Permission / scope OIDC | Erreurs auth, scopes | |
| bi-building | Entreprise / entité | Navigation, dossiers | |
| bi-people | Utilisateurs / équipe | Admin, gestion utilisateurs | |
| bi-gear | Paramètres / configuration | Admin, settings | |
| bi-clock-history | Historique | Audit log, timeline | |
| bi-search | Recherche | BcSearchInput | |
| bi-question-circle | Aide | BcField#help, BcTooltip |
Phosphor Icons
6 poids disponibles : thin · light · regular · bold · fill · duotone. Installé et bundlé via @phosphor-icons/vue — import par nom de composant.
Import et usage
<script setup>
import {
PhArrowRight,
PhCheckCircle,
PhWarning,
PhShieldCheck,
PhKey,
} from '@phosphor-icons/vue'
</script>
<!-- Taille par défaut (24px) -->
<PhArrowRight />
<!-- Taille + couleur + poids -->
<PhCheckCircle :size="24" color="#22c55e" weight="fill" />
<PhWarning :size="20" weight="duotone" />
<PhShieldCheck :size="32" color="var(--bc-pink)" weight="duotone" />Démo live :
Props
| Prop | Type | Défaut | Description |
|---|---|---|---|
| size | Number | String | 24 | Taille en px |
| color | String | currentColor | Couleur CSS (hex, var, etc.) |
| weight | 'thin' | 'light' | 'regular' | 'bold' | 'fill' | 'duotone' | 'regular' | Poids de l'icône |
| mirrored | Boolean | false | Miroir horizontal |
Icônes les plus utilisées
| Icône | Composant | Poids conseillé | Usage dans le DS |
|---|---|---|---|
| PhArrowRight | regular | Navigation, liens | |
| PhCheckCircle | fill | Succès, validation | |
| PhWarning | duotone | Alerte, avertissement | |
| PhX | bold | Fermer, supprimer | |
| PhMagnifyingGlass | regular | Recherche | |
| PhPlus | bold | Créer, ajouter | |
| PhDownloadSimple | regular | Export, téléchargement | |
| PhUploadSimple | regular | Import, upload | |
| PhPencilSimple | regular | Édition | |
| PhTrash | regular | Suppression | |
| PhShieldCheck | duotone | Sécurité, KYB validé | |
| PhIdentificationCard | duotone | KYC, identité | |
| PhLock | fill | Permission, accès restreint | |
| PhKey | regular | API key, credentials | |
| PhChartBar | duotone | Analytics, KPIs |
Exemple — Dashboard KPIs
<script setup>
import { PhChartBar, PhShieldCheck, PhKey, PhUsers } from '@phosphor-icons/vue'
</script>
<template>
<BcStatGrid>
<BcStat label="KYB validés" value="113">
<template #icon>
<PhShieldCheck :size="20" color="#22c55e" weight="fill" />
</template>
</BcStat>
<BcStat label="Clés API actives" value="28">
<template #icon>
<PhKey :size="20" color="var(--bc-orange)" weight="duotone" />
</template>
</BcStat>
</BcStatGrid>
</template>BcIcon — Wrapper Phosphor type-safe
BcIcon est un composant wrapper qui expose les icônes du registre interne du DS (~70 icônes) via une prop name fortement typée (IconName). À utiliser à la place des imports Phosphor directs dans les composants Vue du DS.
Démo
<BcIcon name="check-circle" size="lg" weight="duotone" />
<BcIcon name="warning" size="lg" weight="fill" />
<BcIcon name="trash" size="lg" />
<BcIcon name="arrow-right" size="sm" />
<BcIcon name="funnel" color="var(--bc-accent)" />Tailles
| Valeur | Pixels |
|---|---|
xs | 12px |
sm | 16px |
md | 20px (défaut) |
lg | 24px |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
name | IconName | — (requis) | Identifiant dans le registre DS |
size | "xs" | "sm" | "md" | "lg" | "md" | Taille |
weight | "thin" | "light" | "regular" | "bold" | "fill" | "duotone" | "regular" | Style Phosphor |
color | string | "currentColor" | Couleur CSS |
ariaLabel | string | — | Label lecteur d'écran (si ariaHidden=false) |
ariaHidden | boolean | true | Masque l'icône aux technologies d'assistance |
Le type
IconNameest exporté depuis le DS :import type { IconName } from '@bc'
Règles de choix
| Situation | Recommandation |
|---|---|
Prop icon d'un composant DS | Bootstrap Icons ("bi-xxx") |
| Élément inline dans un slot | <i class="bi bi-xxx"> |
| Page VitePress / template Vue personnalisé | Phosphor Icons (import named) |
| Icône avec état duotone ou fill stylisé | Phosphor Icons — meilleure expressivité |
| Cohérence avec le reste du DS | Bootstrap Icons — stock existant |