Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# rc-segmented
# @rc-component/segmented

[![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![bundle size][bundlephobia-image]][bundlephobia-url]

[npm-image]: http://img.shields.io/npm/v/rc-segmented.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-segmented
[github-actions-image]: https://github.com/react-component/segmented/workflows/CI/badge.svg
[github-actions-url]: https://github.com/react-component/segmented/actions
[npm-image]: http://img.shields.io/npm/v/@rc-component/segmented.svg?style=flat-square
[npm-url]: http://npmjs.org/package/@rc-component/segmented
[github-actions-image]: https://github.com/react-component/segmented/actions/workflows/main.yml/badge.svg
[github-actions-url]: https://github.com/react-component/segmented/actions/workflows/main.yml
[codecov-image]: https://codecov.io/gh/react-component/segmented/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/react-component/segmented/branch/master
[download-image]: https://img.shields.io/npm/dm/rc-segmented.svg?style=flat-square
[download-url]: https://npmjs.org/package/rc-segmented
[bundlephobia-url]: https://bundlephobia.com/package/rc-segmented
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-segmented
[download-image]: https://img.shields.io/npm/dm/@rc-component/segmented.svg?style=flat-square
[download-url]: https://npmjs.org/package/@rc-component/segmented
[bundlephobia-url]: https://bundlephobia.com/package/@rc-component/segmented
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@rc-component/segmented

React Segmented Control.

Expand All @@ -23,13 +23,13 @@ https://react-component.github.io/segmented/

## Install

[![rc-segmented](https://nodei.co/npm/rc-segmented.png)](https://npmjs.org/package/rc-segmented)
[![@rc-component/segmented](https://nodei.co/npm/@rc-component/segmented.png)](https://npmjs.org/package/@rc-component/segmented)

## Usage

```js
import Segmented from 'rc-segmented';
import 'rc-segmented/assets/index.css'; // import 'rc-segmented/asssets/index.less';
import Segmented from '@rc-component/segmented';
import '@rc-component/segmented/assets/index.css'; // import '@rc-component/segmented/assets/index.less';
import { render } from 'react-dom';

render(
Expand All @@ -48,7 +48,7 @@ Please note that **onChange** API

| Property | Type | Default | Description |
| --------- | --------- | --------- | --------- |
| prefixCls | string | rc-segmented | prefixCls of this component |
| prefixCls | string | `rc-segmented` | prefixCls of this component |
| className | string | '' | additional class name of segmented |
| style | React.CSSProperties | | style properties of segmented |
| options | Array<string \| number \| [SegmentedOption](#SegmentedOption)> | [] | options for choices |
Expand Down Expand Up @@ -76,4 +76,4 @@ npm start

## License

rc-segmented is released under the MIT license.
@rc-component/segmented is released under the MIT license.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@babel/runtime": "^7.11.1",
"@rc-component/util": "^1.3.0",
"clsx": "^2.1.1",
"rc-motion": "^2.4.4"
"@rc-component/motion": "^1.1.4"
},
"devDependencies": {
"@rc-component/father-plugin": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/MotionThumb.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import CSSMotion from '@rc-component/motion';
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
import { composeRef } from '@rc-component/util/lib/ref';
import { clsx } from 'clsx';
import CSSMotion from 'rc-motion';
import * as React from 'react';
import type { SegmentedValue } from '.';

Expand Down
4 changes: 2 additions & 2 deletions tests/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import userEvent from '@testing-library/user-event';
import * as React from 'react';
import Segmented from '../src';

jest.mock('rc-motion/lib/util/motion', () => {
jest.mock('@rc-component/motion/lib/util/motion', () => {
return {
...jest.requireActual('rc-motion/lib/util/motion'),
...jest.requireActual('@rc-component/motion/lib/util/motion'),
supportTransition: true,
};
});
Expand Down
Loading