diff --git a/package.json b/package.json index afc7ecc..efbe221 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ }, "devDependencies": { "@rc-component/father-plugin": "^2.0.1", + "@rc-component/np": "^1.0.0", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^14.2.1", "@testing-library/user-event": "^14.5.2", @@ -73,7 +74,6 @@ "jest": "^29.3.1", "jest-environment-jsdom": "^29.3.1", "less": "^3.10.3", - "np": "^7.0.0", "prettier": "^2.0.5", "pretty-quick": "^3.0.0", "react": "^18.0.0", @@ -91,4 +91,4 @@ "tnpm": { "mode": "npm" } -} +} \ No newline at end of file diff --git a/src/index.tsx b/src/index.tsx index 6b09e9f..db48a62 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -147,7 +147,8 @@ const InternalSegmentedOption: React.FC<{ segmentedClassNames?.label, )} title={title} - aria-selected={checked} + role="radio" + aria-checked={checked} style={styles?.label} > {label} diff --git a/tests/__snapshots__/index.test.tsx.snap b/tests/__snapshots__/index.test.tsx.snap index cba0121..32bb125 100644 --- a/tests/__snapshots__/index.test.tsx.snap +++ b/tests/__snapshots__/index.test.tsx.snap @@ -32,8 +32,9 @@ exports[`rc-segmented render label with ReactNode 1`] = ` type="radio" />