@vention/machine-ui 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +17 -1
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -8506,9 +8506,13 @@ const VentionSwitch = props => {
|
|
|
8506
8506
|
}
|
|
8507
8507
|
};
|
|
8508
8508
|
return jsxs("div", {
|
|
8509
|
+
role: "switch",
|
|
8510
|
+
"aria-busy": checked === "loading" ? true : undefined,
|
|
8511
|
+
"aria-checked": getAriaChecked(checked),
|
|
8512
|
+
"aria-disabled": disabled ? true : undefined,
|
|
8509
8513
|
className: classes.root,
|
|
8510
|
-
onClick: handleOnchange,
|
|
8511
8514
|
"data-testid": "vention-switch-root",
|
|
8515
|
+
onClick: handleOnchange,
|
|
8512
8516
|
children: [checked === "mixed" ? jsx(IconMinus, {
|
|
8513
8517
|
"data-testid": "vention-switch-minus",
|
|
8514
8518
|
className: classes.iconMinus
|
|
@@ -8671,6 +8675,18 @@ function getRootBorderColor(theme, checked) {
|
|
|
8671
8675
|
return theme.palette.icon.tertiary;
|
|
8672
8676
|
}
|
|
8673
8677
|
}
|
|
8678
|
+
function getAriaChecked(checked) {
|
|
8679
|
+
switch (checked) {
|
|
8680
|
+
case "on":
|
|
8681
|
+
return true;
|
|
8682
|
+
case "off":
|
|
8683
|
+
return false;
|
|
8684
|
+
case "mixed":
|
|
8685
|
+
return "mixed";
|
|
8686
|
+
case "loading":
|
|
8687
|
+
return false;
|
|
8688
|
+
}
|
|
8689
|
+
}
|
|
8674
8690
|
|
|
8675
8691
|
const ventionPopoverArrowSize = 10;
|
|
8676
8692
|
const VentionPopover = props => {
|