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
|
|
@ -7,13 +7,14 @@ const DEFAULT_WIDTHS = [2, 4, 8, 12];
|
|||
export function DrawingControls({ textContent = {}, active, onToggleActive, eraseActive, onToggleErase, color, colors, onColorChange, width, widths = DEFAULT_WIDTHS, onWidthChange, onUndo, onClear, storageMode, onToggleStorageMode }) {
|
||||
return (
|
||||
<div className={`drawing-controls-panel ${active ? "is-open" : ""}`} aria-label={textContent.drawingLabel || "Dessin"}>
|
||||
<button className={`drawing-control-button ${active ? "active" : ""}`} type="button" aria-pressed={active} title={textContent.drawTitle || "Dessiner"} onClick={onToggleActive}>
|
||||
<button className={`drawing-control-button nds-icon-button ${active ? "active" : ""}`} data-size="sm" type="button" aria-pressed={active} title={textContent.drawTitle || "Dessiner"} onClick={onToggleActive}>
|
||||
<Icon name="edit" />
|
||||
</button>
|
||||
{active && (
|
||||
<>
|
||||
<button
|
||||
className={`drawing-control-button ${eraseActive ? "active" : ""}`}
|
||||
className={`drawing-control-button nds-icon-button ${eraseActive ? "active" : ""}`}
|
||||
data-size="sm"
|
||||
type="button"
|
||||
aria-pressed={eraseActive}
|
||||
title={textContent.eraseTitle || "Gommer"}
|
||||
|
|
@ -33,15 +34,16 @@ export function DrawingControls({ textContent = {}, active, onToggleActive, eras
|
|||
value={width}
|
||||
onSelect={onWidthChange}
|
||||
/>
|
||||
<button className="drawing-control-button" type="button" title={textContent.undoDrawingTitle || "Annuler le dernier trait"} onClick={onUndo}>
|
||||
<button className="drawing-control-button nds-icon-button" data-size="sm" type="button" title={textContent.undoDrawingTitle || "Annuler le dernier trait"} onClick={onUndo}>
|
||||
<Icon name="back" />
|
||||
</button>
|
||||
<button className="drawing-control-button danger" type="button" title={textContent.clearDrawingTitle || "Effacer les dessins"} onClick={onClear}>
|
||||
<button className="drawing-control-button nds-icon-button" data-size="sm" data-variant="danger" type="button" title={textContent.clearDrawingTitle || "Effacer les dessins"} onClick={onClear}>
|
||||
<Icon name="trash" />
|
||||
</button>
|
||||
{onToggleStorageMode && (
|
||||
<button
|
||||
className={`module-scroll-button drawing-storage-switch ${storageMode === "permanent" ? "active" : ""}`}
|
||||
className={`module-scroll-button nds-switch drawing-storage-switch ${storageMode === "permanent" ? "active" : ""}`}
|
||||
data-size="lg"
|
||||
type="button"
|
||||
aria-pressed={storageMode === "permanent"}
|
||||
aria-label={storageMode === "permanent" ? textContent.permanentTitle || "Annotations permanentes" : textContent.temporaryTitle || "Annotations temporaires"}
|
||||
|
|
@ -67,7 +69,7 @@ export function FormattingColorDropdown({ label, sections }) {
|
|||
closeOnMouseLeave
|
||||
preventMouseDown
|
||||
renderTrigger={({ toggle }) => (
|
||||
<button className="notepad-color-toggle is-rainbow" type="button" title={label} aria-label={label} onClick={toggle} />
|
||||
<button className="notepad-color-toggle nds-swatch is-rainbow" data-variant="rainbow" type="button" title={label} aria-label={label} onClick={toggle} />
|
||||
)}
|
||||
>
|
||||
{({ close }) => (
|
||||
|
|
@ -79,7 +81,7 @@ export function FormattingColorDropdown({ label, sections }) {
|
|||
{section.colors.map((color) => (
|
||||
<button
|
||||
key={`${section.label}-${color}`}
|
||||
className={`notepad-swatch ${section.value === color ? "active" : ""}`}
|
||||
className={`notepad-swatch nds-swatch ${section.value === color ? "active" : ""}`}
|
||||
type="button"
|
||||
title={`${section.label} ${color}`}
|
||||
aria-label={`${section.label} ${color}`}
|
||||
|
|
@ -110,7 +112,8 @@ export function DrawingColorDropdown({ label, colors, value, onSelect }) {
|
|||
preventMouseDown
|
||||
renderTrigger={({ toggle }) => (
|
||||
<button
|
||||
className="notepad-color-toggle is-rainbow"
|
||||
className="notepad-color-toggle nds-swatch is-rainbow"
|
||||
data-variant="rainbow"
|
||||
type="button"
|
||||
title={label}
|
||||
aria-label={label}
|
||||
|
|
@ -124,7 +127,7 @@ export function DrawingColorDropdown({ label, colors, value, onSelect }) {
|
|||
{colors.map((color) => (
|
||||
<button
|
||||
key={color}
|
||||
className={`notepad-swatch ${value === color ? "active" : ""}`}
|
||||
className={`notepad-swatch nds-swatch ${value === color ? "active" : ""}`}
|
||||
type="button"
|
||||
title={`${label} ${color}`}
|
||||
aria-label={`${label} ${color}`}
|
||||
|
|
@ -151,7 +154,7 @@ export function DrawingWidthDropdown({ label, widths, value, onSelect }) {
|
|||
closeOnMouseLeave
|
||||
preventMouseDown
|
||||
renderTrigger={({ toggle }) => (
|
||||
<button className="drawing-width-toggle" type="button" title={label} aria-label={label} onClick={toggle}>
|
||||
<button className="drawing-width-toggle nds-icon-button" data-size="sm" type="button" title={label} aria-label={label} onClick={toggle}>
|
||||
<span style={{ "--line-width": `${value}px` }} />
|
||||
</button>
|
||||
)}
|
||||
|
|
@ -161,7 +164,8 @@ export function DrawingWidthDropdown({ label, widths, value, onSelect }) {
|
|||
{widths.map((lineWidth) => (
|
||||
<button
|
||||
key={lineWidth}
|
||||
className={`drawing-width-button ${value === lineWidth ? "active" : ""}`}
|
||||
className={`drawing-width-button nds-icon-button ${value === lineWidth ? "active" : ""}`}
|
||||
data-size="sm"
|
||||
type="button"
|
||||
aria-pressed={value === lineWidth}
|
||||
title={`${label} ${lineWidth}`}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue