Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActionBar: Move to main directory (experimental → alpha) #4574

Merged
merged 9 commits into from
May 21, 2024
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
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,
Copy link
Member

Choose a reason for hiding this comment

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

nice!

"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'
Copy link
Member

Choose a reason for hiding this comment

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

Kudos for backward compatibility for imports!


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
Loading