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
|
|
@ -4,16 +4,34 @@ import { Icon } from "./Icon.jsx";
|
|||
export function ToastPositionSwitch({ position, labels, onChange }) {
|
||||
const normalizedPosition = position === "left" ? "left" : "right";
|
||||
return (
|
||||
<button
|
||||
className="toast-position-switch"
|
||||
type="button"
|
||||
<div
|
||||
className="toast-position-switch nds-radio-button-group"
|
||||
data-size="xs"
|
||||
role="radiogroup"
|
||||
data-position={normalizedPosition}
|
||||
onClick={() => onChange(normalizedPosition === "left" ? "right" : "left")}
|
||||
aria-label={normalizedPosition === "left" ? labels.left : labels.right}
|
||||
title={labels.title}
|
||||
>
|
||||
<span><Icon name="toast-left" /></span>
|
||||
<span><Icon name="toast-right" /></span>
|
||||
</button>
|
||||
<button
|
||||
className={normalizedPosition === "left" ? "active" : ""}
|
||||
type="button"
|
||||
role="radio"
|
||||
aria-checked={normalizedPosition === "left"}
|
||||
aria-label={labels.left}
|
||||
onClick={() => onChange("left")}
|
||||
>
|
||||
<Icon name="toast-left" />
|
||||
</button>
|
||||
<button
|
||||
className={normalizedPosition === "right" ? "active" : ""}
|
||||
type="button"
|
||||
role="radio"
|
||||
aria-checked={normalizedPosition === "right"}
|
||||
aria-label={labels.right}
|
||||
onClick={() => onChange("right")}
|
||||
>
|
||||
<Icon name="toast-right" />
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue