From 17d232a2ea1ee2028d4ac3cd1d9df996b213be51 Mon Sep 17 00:00:00 2001 From: Pavithra Kodmad Date: Thu, 9 May 2024 12:41:47 +1000 Subject: [PATCH 1/8] Move ActionBar to main directory --- .../react/src/{drafts => }/ActionBar/ActionBar.docs.json | 6 +++--- .../react/src/{drafts => }/ActionBar/ActionBar.stories.tsx | 0 .../react/src/{drafts => }/ActionBar/ActionBar.test.tsx | 0 packages/react/src/{drafts => }/ActionBar/ActionBar.tsx | 0 packages/react/src/{drafts => }/ActionBar/index.ts | 0 5 files changed, 3 insertions(+), 3 deletions(-) rename packages/react/src/{drafts => }/ActionBar/ActionBar.docs.json (94%) rename packages/react/src/{drafts => }/ActionBar/ActionBar.stories.tsx (100%) rename packages/react/src/{drafts => }/ActionBar/ActionBar.test.tsx (100%) rename packages/react/src/{drafts => }/ActionBar/ActionBar.tsx (100%) rename packages/react/src/{drafts => }/ActionBar/index.ts (100%) diff --git a/packages/react/src/drafts/ActionBar/ActionBar.docs.json b/packages/react/src/ActionBar/ActionBar.docs.json similarity index 94% rename from packages/react/src/drafts/ActionBar/ActionBar.docs.json rename to packages/react/src/ActionBar/ActionBar.docs.json index c73929c5802..7b8f2659f96 100644 --- a/packages/react/src/drafts/ActionBar/ActionBar.docs.json +++ b/packages/react/src/ActionBar/ActionBar.docs.json @@ -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", diff --git a/packages/react/src/drafts/ActionBar/ActionBar.stories.tsx b/packages/react/src/ActionBar/ActionBar.stories.tsx similarity index 100% rename from packages/react/src/drafts/ActionBar/ActionBar.stories.tsx rename to packages/react/src/ActionBar/ActionBar.stories.tsx diff --git a/packages/react/src/drafts/ActionBar/ActionBar.test.tsx b/packages/react/src/ActionBar/ActionBar.test.tsx similarity index 100% rename from packages/react/src/drafts/ActionBar/ActionBar.test.tsx rename to packages/react/src/ActionBar/ActionBar.test.tsx diff --git a/packages/react/src/drafts/ActionBar/ActionBar.tsx b/packages/react/src/ActionBar/ActionBar.tsx similarity index 100% rename from packages/react/src/drafts/ActionBar/ActionBar.tsx rename to packages/react/src/ActionBar/ActionBar.tsx diff --git a/packages/react/src/drafts/ActionBar/index.ts b/packages/react/src/ActionBar/index.ts similarity index 100% rename from packages/react/src/drafts/ActionBar/index.ts rename to packages/react/src/ActionBar/index.ts From 6de13928b03efb75137b1859040a558c11569167 Mon Sep 17 00:00:00 2001 From: Pavithra Kodmad Date: Thu, 9 May 2024 12:47:50 +1000 Subject: [PATCH 2/8] Export as named --- packages/react/src/ActionBar/index.ts | 1 + packages/react/src/index.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/packages/react/src/ActionBar/index.ts b/packages/react/src/ActionBar/index.ts index ae3069a0ae3..64bf265ed8f 100644 --- a/packages/react/src/ActionBar/index.ts +++ b/packages/react/src/ActionBar/index.ts @@ -7,3 +7,4 @@ const ActionBar = Object.assign(Bar, { }) export default ActionBar +export {ActionBar} diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index e3148feb8f4..30f2d09c796 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -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' From d31070f46da29d636d3556614c9178fd291af268 Mon Sep 17 00:00:00 2001 From: Pavithra Kodmad Date: Fri, 10 May 2024 21:23:37 +1000 Subject: [PATCH 3/8] Fix actionbar export in drafts --- packages/react/src/drafts/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react/src/drafts/index.ts b/packages/react/src/drafts/index.ts index b26c9a7abfa..944e3c3cfbe 100644 --- a/packages/react/src/drafts/index.ts +++ b/packages/react/src/drafts/index.ts @@ -67,8 +67,8 @@ 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 {default as ActionBar} from '../ActionBar' +export * from '../ActionBar' export {Stack} from '../Stack' export type {StackProps, StackItemProps} from '../Stack' From 69f13505772016c295970ab3a42c77439c3f7a37 Mon Sep 17 00:00:00 2001 From: Pavithra Kodmad Date: Fri, 10 May 2024 21:33:01 +1000 Subject: [PATCH 4/8] Fix lint errors --- packages/react/src/drafts/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/react/src/drafts/index.ts b/packages/react/src/drafts/index.ts index 944e3c3cfbe..4a869314e36 100644 --- a/packages/react/src/drafts/index.ts +++ b/packages/react/src/drafts/index.ts @@ -67,7 +67,6 @@ 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 {Stack} from '../Stack' From d0c662342f2d84c251d6502ea5f05e5c2c97fcd9 Mon Sep 17 00:00:00 2001 From: Pavithra Kodmad Date: Fri, 10 May 2024 21:37:40 +1000 Subject: [PATCH 5/8] Fix imports Fix imports --- .../react/src/ActionBar/ActionBar.stories.tsx | 14 +++++----- .../react/src/ActionBar/ActionBar.test.tsx | 2 +- packages/react/src/ActionBar/ActionBar.tsx | 26 +++++++++---------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/react/src/ActionBar/ActionBar.stories.tsx b/packages/react/src/ActionBar/ActionBar.stories.tsx index f2dd0563a0a..95a4f72f720 100644 --- a/packages/react/src/ActionBar/ActionBar.stories.tsx +++ b/packages/react/src/ActionBar/ActionBar.stories.tsx @@ -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, @@ -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', diff --git a/packages/react/src/ActionBar/ActionBar.test.tsx b/packages/react/src/ActionBar/ActionBar.test.tsx index 0b8195dd230..2f963d0bc00 100644 --- a/packages/react/src/ActionBar/ActionBar.test.tsx +++ b/packages/react/src/ActionBar/ActionBar.test.tsx @@ -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 'jest-axe' diff --git a/packages/react/src/ActionBar/ActionBar.tsx b/packages/react/src/ActionBar/ActionBar.tsx index e3f5b3b9879..aa2238aafc7 100644 --- a/packages/react/src/ActionBar/ActionBar.tsx +++ b/packages/react/src/ActionBar/ActionBar.tsx @@ -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 From 9152ebcc6e87a0c46fe1285149dd718660e50989 Mon Sep 17 00:00:00 2001 From: Pavithra Kodmad Date: Fri, 10 May 2024 21:49:03 +1000 Subject: [PATCH 6/8] Create wise-adults-lay.md --- .changeset/wise-adults-lay.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/wise-adults-lay.md diff --git a/.changeset/wise-adults-lay.md b/.changeset/wise-adults-lay.md new file mode 100644 index 00000000000..5577ae3e0e0 --- /dev/null +++ b/.changeset/wise-adults-lay.md @@ -0,0 +1,5 @@ +--- +"@primer/react": minor +--- + +ActionBar: Move to main directory From ac858c019502ff61440ef2a6a82b52185336e35a Mon Sep 17 00:00:00 2001 From: Siddharth Kshetrapal Date: Tue, 21 May 2024 10:34:14 +0200 Subject: [PATCH 7/8] Update wise-adults-lay.md --- .changeset/wise-adults-lay.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/wise-adults-lay.md b/.changeset/wise-adults-lay.md index 5577ae3e0e0..7168db572af 100644 --- a/.changeset/wise-adults-lay.md +++ b/.changeset/wise-adults-lay.md @@ -2,4 +2,4 @@ "@primer/react": minor --- -ActionBar: Move to main directory +ActionBar: Move to main directory. ActionBar can now be imported from `'@primer/react'` From f183b91ed0af186e2007be3197bef25cfa62a60a Mon Sep 17 00:00:00 2001 From: Siddharth Kshetrapal Date: Tue, 21 May 2024 11:28:32 +0200 Subject: [PATCH 8/8] update exports snapshot --- packages/react/src/__tests__/__snapshots__/exports.test.ts.snap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react/src/__tests__/__snapshots__/exports.test.ts.snap b/packages/react/src/__tests__/__snapshots__/exports.test.ts.snap index 4dbaf3f35d0..73706d20a0d 100644 --- a/packages/react/src/__tests__/__snapshots__/exports.test.ts.snap +++ b/packages/react/src/__tests__/__snapshots__/exports.test.ts.snap @@ -2,6 +2,8 @@ exports[`@primer/react should not update exports without a semver change 1`] = ` [ + "ActionBar", + "type ActionBarProps", "ActionList", "type ActionListDescriptionProps", "type ActionListDividerProps",