Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

refactor: visually hidden component

Brad Barbinaca3281fd42a
diff --git a/apps/carbon/app/components/Form/Boolean.tsx b/apps/carbon/app/components/Form/Boolean.tsx
index 4502040b51..595ebb5ecc 100644
--- a/apps/carbon/app/components/Form/Boolean.tsx
+++ b/apps/carbon/app/components/Form/Boolean.tsx
@@ -7,7 +7,6 @@ import {
} from "@carbon/react";
import type { SwitchProps, SystemStyleObject } from "@chakra-ui/react";
import {
- VisuallyHidden,
chakra,
omitThemingProps,
useCheckbox,
@@ -72,7 +71,7 @@ const Boolean = forwardRef<HTMLInputElement, FormBooleanProps>(
className="chakra-switch"
__css={containerStyles}
>
- <VisuallyHidden>
+ <span className="sr-only">
<input
ref={ref}
type="checkbox"
@@ -86,7 +85,7 @@ const Boolean = forwardRef<HTMLInputElement, FormBooleanProps>(
onChange?.(e.target.checked);
}}
/>
- </VisuallyHidden>
+ </span>
<HStack>
<chakra.span
{...getCheckboxProps()}
diff --git a/apps/carbon/app/components/Table/Table.tsx b/apps/carbon/app/components/Table/Table.tsx
index 4f046442ee..ff11d83fa1 100644
--- a/apps/carbon/app/components/Table/Table.tsx
+++ b/apps/carbon/app/components/Table/Table.tsx
@@ -16,7 +16,6 @@ import {
Th,
Thead,
Tr,
- VisuallyHidden,
} from "@chakra-ui/react";
import type {
ColumnDef,
@@ -776,7 +775,7 @@ function getActionColumn<T>(
return [
{
id: "Actions",
- header: () => <VisuallyHidden>Actions</VisuallyHidden>,
+ header: () => <span className="sr-only">Actions</span>,
cell: (item) => (
<div className="flex justify-end">
<ActionMenu>{renderContextMenu(item.row.original)}</ActionMenu>
diff --git a/apps/carbon/app/components/Table/components/IndeterminateCheckbox/IndeterminateCheckbox.tsx b/apps/carbon/app/components/Table/components/IndeterminateCheckbox/IndeterminateCheckbox.tsx
index 864d90e2ff..e872cfb4a0 100644
--- a/apps/carbon/app/components/Table/components/IndeterminateCheckbox/IndeterminateCheckbox.tsx
+++ b/apps/carbon/app/components/Table/components/IndeterminateCheckbox/IndeterminateCheckbox.tsx
@@ -1,4 +1,4 @@
-import { Checkbox, VisuallyHidden } from "@chakra-ui/react";
+import { Checkbox } from "@chakra-ui/react";
type IndeterminateCheckboxProps = {
checked: boolean;
@@ -18,7 +18,7 @@ const IndeterminateCheckbox = ({
ml={2}
{...rest}
>
- <VisuallyHidden>Select Row</VisuallyHidden>
+ <span className="sr-only">Select Row</span>
</Checkbox>
);
};