Migrate site controls to Nebula design system
All checks were successful
Deploy Sokko G / deploy (push) Successful in 17s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 17s
This commit is contained in:
parent
e3d0925eb1
commit
817e21567b
127 changed files with 5380 additions and 2363 deletions
|
|
@ -67,7 +67,9 @@ export function ChecklistSection({ section, context, data, reorder, onRenameSect
|
|||
{showTitle && (
|
||||
<div className="checklist-section-header">
|
||||
<button
|
||||
className="checklist-drag-handle"
|
||||
className="checklist-drag-handle nds-icon-button"
|
||||
data-size="xs"
|
||||
data-variant="ghost"
|
||||
type="button"
|
||||
onPointerDown={(event) => reorder.groupReorder.startDrag(event, { groupId: section.id })}
|
||||
aria-label={`${textContent.reorderSectionTitle || "Déplacer la catégorie"} ${section.title}`}
|
||||
|
|
@ -79,6 +81,7 @@ export function ChecklistSection({ section, context, data, reorder, onRenameSect
|
|||
<input
|
||||
{...titleEdit.getInputProps({
|
||||
className: "checklist-section-title-input",
|
||||
type: "text",
|
||||
title: textContent.sectionEditTitle || "Renommer la catégorie",
|
||||
"aria-label": textContent.sectionEditTitle || "Renommer la catégorie"
|
||||
})}
|
||||
|
|
@ -87,7 +90,8 @@ export function ChecklistSection({ section, context, data, reorder, onRenameSect
|
|||
<div className="checklist-section-actions">
|
||||
<span>{section.items.filter((item) => context.clampQty(item.qtyCurrent, item.qtyTarget) >= item.qtyTarget).length} / {section.items.length}</span>
|
||||
<button
|
||||
className="checklist-section-collapse-button"
|
||||
className="checklist-section-collapse-button nds-icon-button"
|
||||
data-size="xs"
|
||||
type="button"
|
||||
onClick={toggleSectionCollapsed}
|
||||
aria-expanded={!isCollapsed}
|
||||
|
|
@ -160,7 +164,9 @@ function ChecklistItem({ item, section, context, reorder, items, save, onUpdateI
|
|||
<li className={className} {...reorder.getItemProps({ itemId: item.id, groupId: section.id })}>
|
||||
<div className={`checklist-item-main ${editing ? "is-editing" : ""}`}>
|
||||
<button
|
||||
className="checklist-drag-handle"
|
||||
className="checklist-drag-handle nds-icon-button"
|
||||
data-size="xs"
|
||||
data-variant="ghost"
|
||||
type="button"
|
||||
onPointerDown={(event) => reorder.itemReorder.startDrag(event, item.id)}
|
||||
aria-label={`${textContent.reorderTitle || "Déplacer"} ${item.label}`}
|
||||
|
|
@ -170,17 +176,20 @@ function ChecklistItem({ item, section, context, reorder, items, save, onUpdateI
|
|||
</button>
|
||||
{item.qtyTarget === 1 ? (
|
||||
<input
|
||||
className="nds-checkbox"
|
||||
data-size="sm"
|
||||
type="checkbox"
|
||||
checked={done}
|
||||
onChange={(event) => updateItem((entry) => ({ ...entry, qtyTarget: 1, qtyCurrent: event.target.checked ? 1 : 0 }))}
|
||||
aria-label={`Terminer ${item.label}`}
|
||||
/>
|
||||
) : (
|
||||
<div className="checklist-qty-controls" aria-label={`Quantité ${item.label}`}>
|
||||
<div className="checklist-qty-controls nds-quantity-stepper" data-size="md" aria-label={`Quantité ${item.label}`}>
|
||||
<button type="button" onClick={() => updateItem((entry) => ({ ...entry, qtyCurrent: context.clampQty(entry.qtyCurrent - 1, entry.qtyTarget) }))} aria-label={textContent.decrementLabel || "Retirer une quantité"}>-</button>
|
||||
<label className="checklist-qty-current">
|
||||
<input
|
||||
type="number"
|
||||
className="nds-quantity-stepper-input"
|
||||
max={item.qtyTarget}
|
||||
value={context.clampQty(item.qtyCurrent, item.qtyTarget)}
|
||||
style={{ "--qty-current-digits": String(context.clampQty(item.qtyCurrent, item.qtyTarget)).length }}
|
||||
|
|
@ -196,13 +205,15 @@ function ChecklistItem({ item, section, context, reorder, items, save, onUpdateI
|
|||
<>
|
||||
<input
|
||||
{...labelEdit.getInputProps({
|
||||
className: "checklist-label-input",
|
||||
className: "checklist-label-input nds-inline-input",
|
||||
type: "text",
|
||||
"aria-label": textContent.itemEditLabel || "Libellé"
|
||||
})}
|
||||
/>
|
||||
<input
|
||||
{...categoryEdit.getInputProps({
|
||||
className: "checklist-category-input",
|
||||
className: "checklist-category-input nds-inline-input",
|
||||
type: "text",
|
||||
placeholder: textContent.sectionPlaceholder || "Catégorie",
|
||||
"aria-label": textContent.categoryEditLabel || "Catégorie"
|
||||
})}
|
||||
|
|
@ -214,10 +225,10 @@ function ChecklistItem({ item, section, context, reorder, items, save, onUpdateI
|
|||
</button>
|
||||
)}
|
||||
</div>
|
||||
<button type="button" className="checklist-edit-button" onClick={onToggleEditing} aria-label={`${textContent.editTitle || "Modifier"} ${item.label}`} title={textContent.editTitle || "Modifier"}>
|
||||
<button type="button" className="checklist-edit-button nds-icon-button" data-size="sm" onClick={onToggleEditing} aria-label={`${textContent.editTitle || "Modifier"} ${item.label}`} title={textContent.editTitle || "Modifier"}>
|
||||
<Icon name="edit" />
|
||||
</button>
|
||||
<button className="checklist-delete-button danger" onClick={() => onDeleteItem(item.id)} aria-label={`${textContent.deleteTitle || "Supprimer"} ${item.label}`} title={textContent.deleteTitle || "Supprimer"}>
|
||||
<button className="checklist-delete-button nds-icon-button" data-size="sm" data-variant="danger" onClick={() => onDeleteItem(item.id)} aria-label={`${textContent.deleteTitle || "Supprimer"} ${item.label}`} title={textContent.deleteTitle || "Supprimer"}>
|
||||
<Icon name="trash" />
|
||||
</button>
|
||||
</li>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue