Skip to content

Commit

Permalink
Divider: migrate from reakit to @ariakit/react (#55622)
Browse files Browse the repository at this point in the history
* `components/Divider`: refactor from `reakit` to `@ariakit/react`

* add changelog entry

* types: exlude `as` & `render` from `SeparatorProps`

* storybook: disable `wrapElement` controls

* storybook: remove `ref` from props table

* move changelog entry to UNRELEASED
  • Loading branch information
flootr committed Nov 6, 2023
1 parent f63b75a commit e848ed2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 4 additions & 0 deletions packages/components/CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Internal

- Migrate `Divider` from `reakit` to `ariakit` ([#55622](https://github.com/WordPress/gutenberg/pull/55622))

## 25.11.0 (2023-11-02)

### Enhancements
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/divider/component.tsx
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
// eslint-disable-next-line no-restricted-imports
import { Separator } from 'reakit';
import * as Ariakit from '@ariakit/react';
import type { ForwardedRef } from 'react';

/**
Expand All @@ -20,8 +20,8 @@ function UnconnectedDivider(
const contextProps = useContextSystem( props, 'Divider' );

return (
<Separator
as={ DividerView }
<Ariakit.Separator
render={ <DividerView /> }
{ ...contextProps }
ref={ forwardedRef }
/>
Expand Down
8 changes: 8 additions & 0 deletions packages/components/src/divider/stories/index.story.tsx
Expand Up @@ -23,6 +23,14 @@ const meta: Meta< typeof Divider > = {
marginEnd: {
control: { type: 'text' },
},
wrapElement: {
control: { type: null },
},
ref: {
table: {
disable: true,
},
},
},
parameters: {
controls: { expanded: true },
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/divider/types.ts
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
// eslint-disable-next-line no-restricted-imports
import type { SeparatorProps } from 'reakit';
import type { SeparatorProps } from '@ariakit/react';

/**
* Internal dependencies
Expand All @@ -11,7 +11,7 @@ import type { SpaceInput } from '../utils/space';

export type DividerProps = Omit<
SeparatorProps,
'children' | 'unstable_system' | 'orientation'
'children' | 'unstable_system' | 'orientation' | 'as' | 'render'
> & {
/**
* Adjusts all margins on the inline dimension.
Expand Down

1 comment on commit e848ed2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in e848ed2.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6773530127
📝 Reported issues:

Please sign in to comment.