CartDrawer
ImplementedSlide-in cart drawer from right, composing the Drawer molecule for dialog chrome (portal, scrim, Escape-to-close). Cart line list + totals footer + checkout CTA. Localized fr/en labels; appears instantly (no animation).
components/organisms/cartdrawer/CartDrawer.tsxTiroir latéral (slide-over) affichant le panier avec ses lignes, le sous-total, les frais de service et le total. FR-CA : « Votre panier · Sous-total · Frais de service · Total · Passer à la caisse ».
CartDrawer
Organism — Commerce family (Family 7)
Composant contrôlé : passer `open=true` pour afficher le tiroir. Compose le molecule Drawer (portail, scrim, role=dialog) — piège de focus et retour de focus hérités du molecule. Verrouille le défilement et ferme via Escape, bouton ou overlay. Les boutons « retirer » et « passer à la caisse » sont des no-op tant que `onRemove` et `onCheckout` ne sont pas fournis.
This component supports light and dark mode.
Props
open*booleanVisibilité du tiroir.
onClose*() => voidFermeture (bouton, overlay ou Escape).
lines*CartLine[]Lignes du panier (id, eventTitle, ticketTier, quantity, unitPrice, lineTotal).
subtotal*stringSous-total formaté (ex. « 184,00 $ »).
fees*stringFrais de service formatés (ex. « 9,20 $ »).
total*stringTotal formaté (ex. « 193,20 $ »).
locale'fr' | 'en'frBascule des libellés intégrés.
classNamestringClasses supplémentaires sur le wrapper de mise en page interne.
onRemove(lineId: string) => voidAppelé au clic sur le bouton « retirer » d’une ligne. Reçoit l’identifiant de la ligne.
onCheckout() => voidAppelé au clic sur le bouton « passer à la caisse ».
Props
CartDrawer
openboolean—Drawer open state. Renders nothing when false.
onClose() => void—Called on scrim click, Escape, and the header close button.
linesCartLine[]—Cart lines. Each: id, eventTitle, ticketTier, quantity, unitPrice, lineTotal (pre-formatted strings).
subtotalstring—Pre-formatted subtotal (e.g. "184,00 $").
feesstring—Pre-formatted service fees (e.g. "9,20 $").
totalstring—Pre-formatted grand total (e.g. "193,20 $").
locale"fr" | "en"'fr'Switches built-in labels between French and English.
classNamestring—Extra CSS classes applied to the inner layout wrapper.
onRemove(lineId: string) => void—Called when the user clicks the per-line remove button.
onCheckout() => void—Called when the user clicks the checkout CTA.
<CartDrawer />Accessibility
Type
1 ruleARIA
1 ruleUsage
Import
import { CartDrawer } from "@epasslive/design-system"Example 1
<CartDrawer open onClose={fn} lines={[]} subtotal="" fees="" total="" />Anti-patterns
— Do not fetch data directly in organisms
— Avoid tight coupling to specific data sources