Skip to content

Commit

Permalink
ActionBar: Move to main directory (experimental → alpha) (#4574)
Browse files Browse the repository at this point in the history
* 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 <siddharthkp@github.com>
  • Loading branch information
pksjce and siddharthkp committed May 21, 2024
1 parent 732e67a commit 9c01a93
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 26 deletions.
5 changes: 5 additions & 0 deletions .changeset/wise-adults-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

ActionBar: Move to main directory. ActionBar can now be imported from `'@primer/react'`
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"id": "actionbar",
"name": "ActionBar",
"status": "draft",
"a11yReviewed": false,
"status": "alpha",
"a11yReviewed": true,
"stories": [],
"importPath": "@primer/react/experimental",
"importPath": "@primer/react",
"props": [
{
"name": "size",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import type {Meta} from '@storybook/react'
import ActionBar from '.'
import Text from '../../Text'
import Text from '../Text'
import {
PencilIcon,
BoldIcon,
Expand All @@ -18,12 +18,12 @@ import {
ReplyIcon,
ThreeBarsIcon,
} from '@primer/octicons-react'
import {MarkdownInput} from '../MarkdownEditor/_MarkdownInput'
import {ViewSwitch} from '../MarkdownEditor/_ViewSwitch'
import type {MarkdownViewMode} from '../MarkdownEditor/_ViewSwitch'
import {Box, Dialog, Button, Avatar, ActionMenu, IconButton, ActionList} from '../..'
import {Divider} from '../../deprecated/ActionList/Divider'
import mockData from '../SelectPanel2/mock-story-data'
import {MarkdownInput} from '../drafts/MarkdownEditor/_MarkdownInput'
import {ViewSwitch} from '../drafts/MarkdownEditor/_ViewSwitch'
import type {MarkdownViewMode} from '../drafts/MarkdownEditor/_ViewSwitch'
import {Box, Dialog, Button, Avatar, ActionMenu, IconButton, ActionList} from '../'
import {Divider} from '../deprecated/ActionList/Divider'
import mockData from '../drafts/SelectPanel2/mock-story-data'

export default {
title: 'Drafts/Components/ActionBar',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import {behavesAsComponent} from '../../utils/testing'
import {behavesAsComponent} from '../utils/testing'
import {render as HTMLRender} from '@testing-library/react'
import axe from 'axe-core'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import type {RefObject, MutableRefObject} from 'react'
import React, {useState, useCallback, useRef, forwardRef} from 'react'
import {KebabHorizontalIcon} from '@primer/octicons-react'
import {ActionList} from '../../ActionList'
import useIsomorphicLayoutEffect from '../../utils/useIsomorphicLayoutEffect'
import {ActionList} from '../ActionList'
import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect'
import styled from 'styled-components'
import sx from '../../sx'
import {useOnEscapePress} from '../../hooks/useOnEscapePress'
import type {ResizeObserverEntry} from '../../hooks/useResizeObserver'
import {useResizeObserver} from '../../hooks/useResizeObserver'

import {useOnOutsideClick} from '../../hooks/useOnOutsideClick'
import type {IconButtonProps} from '../../Button'
import {IconButton} from '../../Button'
import Box from '../../Box'
import {ActionMenu} from '../../ActionMenu'
import {useFocusZone, FocusKeys} from '../../hooks/useFocusZone'
import sx from '../sx'
import {useOnEscapePress} from '../hooks/useOnEscapePress'
import type {ResizeObserverEntry} from '../hooks/useResizeObserver'
import {useResizeObserver} from '../hooks/useResizeObserver'

import {useOnOutsideClick} from '../hooks/useOnOutsideClick'
import type {IconButtonProps} from '../Button'
import {IconButton} from '../Button'
import Box from '../Box'
import {ActionMenu} from '../ActionMenu'
import {useFocusZone, FocusKeys} from '../hooks/useFocusZone'

type ChildSize = {
text: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ const ActionBar = Object.assign(Bar, {
})

export default ActionBar
export {ActionBar}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

exports[`@primer/react should not update exports without a semver change 1`] = `
[
"ActionBar",
"type ActionBarProps",
"ActionList",
"type ActionListDescriptionProps",
"type ActionListDividerProps",
Expand Down
3 changes: 1 addition & 2 deletions packages/react/src/drafts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ export * from './SelectPanel2'
export {default as TabPanels} from './TabPanels'
export type {TabPanelsProps, TabPanelsTabProps, TabPanelsPanelProps} from './TabPanels'
export * from '../TooltipV2'
export {default as ActionBar} from './ActionBar'
export * from './ActionBar'
export * from '../ActionBar'

export {Stack} from '../Stack'
export type {StackProps, StackItemProps} from '../Stack'
3 changes: 3 additions & 0 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ export type {
export {UnderlineNav} from './UnderlineNav'
export type {UnderlineNavProps, UnderlineNavItemProps} from './UnderlineNav'

export {ActionBar} from './ActionBar'
export type {ActionBarProps} from './ActionBar'

// eslint-disable-next-line no-restricted-imports
export {SSRProvider, useSSRSafeId} from './utils/ssr'
export {default as sx, merge} from './sx'
Expand Down

0 comments on commit 9c01a93

Please sign in to comment.