Skip to content

Commit 9c01a93

Browse files
pksjcesiddharthkp
andauthored
ActionBar: Move to main directory (experimental → alpha) (#4574)
* Move ActionBar to main directory * Export as named * Fix actionbar export in drafts * Fix lint errors * Fix imports Fix imports * Create wise-adults-lay.md * Update wise-adults-lay.md * update exports snapshot --------- Co-authored-by: Siddharth Kshetrapal <[email protected]>
1 parent 732e67a commit 9c01a93

File tree

9 files changed

+36
-26
lines changed

9 files changed

+36
-26
lines changed

.changeset/wise-adults-lay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/react": minor
3+
---
4+
5+
ActionBar: Move to main directory. ActionBar can now be imported from `'@primer/react'`

packages/react/src/drafts/ActionBar/ActionBar.docs.json renamed to packages/react/src/ActionBar/ActionBar.docs.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"id": "actionbar",
33
"name": "ActionBar",
4-
"status": "draft",
5-
"a11yReviewed": false,
4+
"status": "alpha",
5+
"a11yReviewed": true,
66
"stories": [],
7-
"importPath": "@primer/react/experimental",
7+
"importPath": "@primer/react",
88
"props": [
99
{
1010
"name": "size",

packages/react/src/drafts/ActionBar/ActionBar.stories.tsx renamed to packages/react/src/ActionBar/ActionBar.stories.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import type {Meta} from '@storybook/react'
33
import ActionBar from '.'
4-
import Text from '../../Text'
4+
import Text from '../Text'
55
import {
66
PencilIcon,
77
BoldIcon,
@@ -18,12 +18,12 @@ import {
1818
ReplyIcon,
1919
ThreeBarsIcon,
2020
} from '@primer/octicons-react'
21-
import {MarkdownInput} from '../MarkdownEditor/_MarkdownInput'
22-
import {ViewSwitch} from '../MarkdownEditor/_ViewSwitch'
23-
import type {MarkdownViewMode} from '../MarkdownEditor/_ViewSwitch'
24-
import {Box, Dialog, Button, Avatar, ActionMenu, IconButton, ActionList} from '../..'
25-
import {Divider} from '../../deprecated/ActionList/Divider'
26-
import mockData from '../SelectPanel2/mock-story-data'
21+
import {MarkdownInput} from '../drafts/MarkdownEditor/_MarkdownInput'
22+
import {ViewSwitch} from '../drafts/MarkdownEditor/_ViewSwitch'
23+
import type {MarkdownViewMode} from '../drafts/MarkdownEditor/_ViewSwitch'
24+
import {Box, Dialog, Button, Avatar, ActionMenu, IconButton, ActionList} from '../'
25+
import {Divider} from '../deprecated/ActionList/Divider'
26+
import mockData from '../drafts/SelectPanel2/mock-story-data'
2727

2828
export default {
2929
title: 'Drafts/Components/ActionBar',

packages/react/src/drafts/ActionBar/ActionBar.test.tsx renamed to packages/react/src/ActionBar/ActionBar.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import {behavesAsComponent} from '../../utils/testing'
2+
import {behavesAsComponent} from '../utils/testing'
33
import {render as HTMLRender} from '@testing-library/react'
44
import axe from 'axe-core'
55

packages/react/src/drafts/ActionBar/ActionBar.tsx renamed to packages/react/src/ActionBar/ActionBar.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import type {RefObject, MutableRefObject} from 'react'
22
import React, {useState, useCallback, useRef, forwardRef} from 'react'
33
import {KebabHorizontalIcon} from '@primer/octicons-react'
4-
import {ActionList} from '../../ActionList'
5-
import useIsomorphicLayoutEffect from '../../utils/useIsomorphicLayoutEffect'
4+
import {ActionList} from '../ActionList'
5+
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect'
66
import styled from 'styled-components'
7-
import sx from '../../sx'
8-
import {useOnEscapePress} from '../../hooks/useOnEscapePress'
9-
import type {ResizeObserverEntry} from '../../hooks/useResizeObserver'
10-
import {useResizeObserver} from '../../hooks/useResizeObserver'
11-
12-
import {useOnOutsideClick} from '../../hooks/useOnOutsideClick'
13-
import type {IconButtonProps} from '../../Button'
14-
import {IconButton} from '../../Button'
15-
import Box from '../../Box'
16-
import {ActionMenu} from '../../ActionMenu'
17-
import {useFocusZone, FocusKeys} from '../../hooks/useFocusZone'
7+
import sx from '../sx'
8+
import {useOnEscapePress} from '../hooks/useOnEscapePress'
9+
import type {ResizeObserverEntry} from '../hooks/useResizeObserver'
10+
import {useResizeObserver} from '../hooks/useResizeObserver'
11+
12+
import {useOnOutsideClick} from '../hooks/useOnOutsideClick'
13+
import type {IconButtonProps} from '../Button'
14+
import {IconButton} from '../Button'
15+
import Box from '../Box'
16+
import {ActionMenu} from '../ActionMenu'
17+
import {useFocusZone, FocusKeys} from '../hooks/useFocusZone'
1818

1919
type ChildSize = {
2020
text: string

packages/react/src/drafts/ActionBar/index.ts renamed to packages/react/src/ActionBar/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ const ActionBar = Object.assign(Bar, {
77
})
88

99
export default ActionBar
10+
export {ActionBar}

packages/react/src/__tests__/__snapshots__/exports.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
exports[`@primer/react should not update exports without a semver change 1`] = `
44
[
5+
"ActionBar",
6+
"type ActionBarProps",
57
"ActionList",
68
"type ActionListDescriptionProps",
79
"type ActionListDividerProps",

packages/react/src/drafts/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ export * from './SelectPanel2'
6767
export {default as TabPanels} from './TabPanels'
6868
export type {TabPanelsProps, TabPanelsTabProps, TabPanelsPanelProps} from './TabPanels'
6969
export * from '../TooltipV2'
70-
export {default as ActionBar} from './ActionBar'
71-
export * from './ActionBar'
70+
export * from '../ActionBar'
7271

7372
export {Stack} from '../Stack'
7473
export type {StackProps, StackItemProps} from '../Stack'

packages/react/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ export type {
193193
export {UnderlineNav} from './UnderlineNav'
194194
export type {UnderlineNavProps, UnderlineNavItemProps} from './UnderlineNav'
195195

196+
export {ActionBar} from './ActionBar'
197+
export type {ActionBarProps} from './ActionBar'
198+
196199
// eslint-disable-next-line no-restricted-imports
197200
export {SSRProvider, useSSRSafeId} from './utils/ssr'
198201
export {default as sx, merge} from './sx'

0 commit comments

Comments
 (0)