diff --git a/.dumirc.ts b/.dumirc.ts index 1cdc580..8b56eeb 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -1,18 +1,20 @@ import { defineConfig } from 'dumi'; +import path from 'path'; const basePath = process.env.GH_PAGES ? '/segmented/' : '/'; const publicPath = process.env.GH_PAGES ? '/segmented/' : '/'; export default defineConfig({ - favicons: [ - 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', - ], + favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'], themeConfig: { name: 'Segmented', - logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4' + logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4', }, outputPath: '.doc', exportStatic: {}, base: basePath, publicPath, + alias: { + 'rc-segmented': path.resolve(__dirname, 'src/index.tsx'), + }, }); diff --git a/package.json b/package.json index f30bc83..e6a381e 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "devDependencies": { "@rc-component/father-plugin": "^2.0.1", "@rc-component/np": "^1.0.0", - "@testing-library/jest-dom": "^5.16.5", + "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^14.2.1", "@testing-library/user-event": "^14.5.2", "@types/jest": "^29.2.4", diff --git a/src/index.tsx b/src/index.tsx index 8b6c83f..50f36c2 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -151,8 +151,6 @@ const InternalSegmentedOption: React.FC<{
{label} @@ -308,6 +306,7 @@ const Segmented = React.forwardRef( role="radiogroup" aria-label="segmented control" tabIndex={disabled ? undefined : 0} + aria-orientation={vertical ? 'vertical' : 'horizontal'} style={style} {...divProps} className={clsx( diff --git a/tests/__snapshots__/index.test.tsx.snap b/tests/__snapshots__/index.test.tsx.snap index 32bb125..47c132a 100644 --- a/tests/__snapshots__/index.test.tsx.snap +++ b/tests/__snapshots__/index.test.tsx.snap @@ -3,6 +3,7 @@ exports[`rc-segmented render empty segmented 1`] = `