From a3e818ae5f539400123b97797d771a8d1c136265 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Fri, 26 Jul 2024 14:10:42 -0500 Subject: [PATCH 01/12] refactor: move drafts to experimental --- packages/react/drafts/package.json | 9 -- packages/react/figma.config.json | 4 +- packages/react/package.json | 5 - packages/react/rollup.config.js | 3 - packages/react/src/AvatarPair/AvatarPair.tsx | 2 +- packages/react/src/DataTable/Table.tsx | 2 +- packages/react/src/TreeView/TreeView.tsx | 4 +- .../__snapshots__/exports.test.ts.snap | 114 ------------------ packages/react/src/__tests__/exports.test.ts | 14 --- .../__tests__/hooks/_useListEditing.test.tsx | 4 +- .../hooks/_useListInteraction.test.tsx | 2 +- packages/react/src/drafts/index.ts | 87 ------------- .../CSSComponent/Component.stories.tsx | 0 .../CSSComponent/component.module.css | 0 .../CSSComponent/index.tsx | 0 .../InlineAutocomplete.docs.json | 0 .../InlineAutocomplete.features.stories.tsx | 0 .../InlineAutocomplete.stories.tsx | 0 .../InlineAutocomplete.test.tsx | 0 .../InlineAutocomplete/InlineAutocomplete.tsx | 0 .../_AutocompleteSuggestions.tsx | 0 .../InlineAutocomplete/index.ts | 0 .../InlineAutocomplete/types.ts | 0 .../InlineAutocomplete/utils.ts | 0 .../MarkdownEditor/Actions.tsx | 0 .../MarkdownEditor/Footer.tsx | 0 .../MarkdownEditor/Label.tsx | 0 .../MarkdownEditor/MarkdownEditor.docs.json | 0 .../MarkdownEditor.features.stories.tsx | 0 .../MarkdownEditor/MarkdownEditor.stories.tsx | 0 .../MarkdownEditor/MarkdownEditor.test.tsx | 0 .../MarkdownEditor/MarkdownEditor.tsx | 0 .../MarkdownEditor/Toolbar.tsx | 0 .../MarkdownEditor/_ErrorMessage.tsx | 0 .../MarkdownEditor/_FormattingTools.tsx | 0 .../MarkdownEditor/_MarkdownEditorContext.ts | 0 .../MarkdownEditor/_MarkdownInput.tsx | 0 .../MarkdownEditor/_SavedReplies.tsx | 0 .../MarkdownEditor/_ToolbarButton.tsx | 0 .../MarkdownEditor/_ViewSwitch.tsx | 0 .../MarkdownEditor/_useFileHandling.ts | 0 .../MarkdownEditor/_useIndenting.ts | 0 .../MarkdownEditor/_useListEditing.ts | 0 .../MarkdownEditor/index.ts | 0 .../markdown-toolbar-element.d.ts | 0 .../suggestions/_useEmojiSuggestions.tsx | 0 .../suggestions/_useMentionSuggestions.tsx | 0 .../suggestions/_useReferenceSuggestions.tsx | 0 .../MarkdownEditor/suggestions/index.ts | 0 .../MarkdownEditor/utils.ts | 0 .../MarkdownViewer/MarkdownViewer.docs.json | 0 .../MarkdownViewer.features.stories.tsx | 0 .../MarkdownViewer/MarkdownViewer.stories.tsx | 0 .../MarkdownViewer/MarkdownViewer.test.tsx | 0 .../MarkdownViewer/MarkdownViewer.tsx | 0 .../MarkdownViewer/_useLinkInterception.ts | 0 .../MarkdownViewer/_useListInteraction.ts | 0 .../MarkdownViewer/index.ts | 0 .../SelectPanel2/SelectPanel.docs.json | 0 .../SelectPanel.examples.stories.tsx | 0 .../SelectPanel.features.stories.tsx | 0 .../SelectPanel.playground.stories.tsx | 0 .../SelectPanel2/SelectPanel.stories.tsx | 0 .../SelectPanel2/SelectPanel.test.tsx | 0 .../SelectPanel2/SelectPanel.tsx | 0 .../__tests__/SelectPanelLoading.test.tsx | 0 .../SelectPanel2/index.tsx | 0 .../SelectPanel2/mock-story-data.ts | 0 .../SelectPanel2/work-log.md | 0 .../Skeleton/Skeleton.examples.stories.tsx | 0 .../Skeleton/SkeletonAvatar.docs.json | 0 .../SkeletonAvatar.features.stories.tsx | 0 .../Skeleton/SkeletonAvatar.stories.tsx | 0 .../Skeleton/SkeletonAvatar.tsx | 0 .../Skeleton/SkeletonBox.docs.json | 0 .../Skeleton/SkeletonBox.features.stories.tsx | 0 .../Skeleton/SkeletonBox.stories.tsx | 0 .../Skeleton/SkeletonBox.tsx | 0 .../Skeleton/SkeletonText.docs.json | 0 .../SkeletonText.features.stories.tsx | 0 .../Skeleton/SkeletonText.stories.tsx | 0 .../Skeleton/SkeletonText.tsx | 0 .../Skeleton/index.ts | 0 .../TabPanels/TabPanels.docs.json | 0 .../TabPanels/TabPanels.features.stories.tsx | 0 .../TabPanels/TabPanels.stories.tsx | 0 .../TabPanels/TabPanels.tsx | 0 .../TabPanels/__tests__/TabPanels.test.tsx | 0 .../TabPanels/index.ts | 0 .../UnderlinePanels/UnderlinePanels.docs.json | 0 .../UnderlinePanels.features.stories.tsx | 0 .../UnderlinePanels.stories.tsx | 0 .../UnderlinePanels/UnderlinePanels.test.tsx | 0 .../UnderlinePanels/UnderlinePanels.tsx | 0 .../UnderlinePanels/index.ts | 0 .../{drafts => experimental}/hooks/index.ts | 0 .../hooks/useCombobox.ts | 0 .../hooks/useDynamicTextareaHeight.ts | 0 ...noreKeyboardActionsWhileComposing.test.tsx | 0 .../useIgnoreKeyboardActionsWhileComposing.ts | 0 .../hooks/useSafeAsyncCallback.ts | 0 .../hooks/useSyntheticChange.ts | 0 .../hooks/useUnifiedFileSelect.ts | 0 packages/react/src/experimental/index.ts | 86 ++++++++++++- .../utils/character-coordinates.ts | 0 105 files changed, 94 insertions(+), 242 deletions(-) delete mode 100644 packages/react/drafts/package.json delete mode 100644 packages/react/src/drafts/index.ts rename packages/react/src/{drafts => experimental}/CSSComponent/Component.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/CSSComponent/component.module.css (100%) rename packages/react/src/{drafts => experimental}/CSSComponent/index.tsx (100%) rename packages/react/src/{drafts => experimental}/InlineAutocomplete/InlineAutocomplete.docs.json (100%) rename packages/react/src/{drafts => experimental}/InlineAutocomplete/InlineAutocomplete.features.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/InlineAutocomplete/InlineAutocomplete.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/InlineAutocomplete/InlineAutocomplete.test.tsx (100%) rename packages/react/src/{drafts => experimental}/InlineAutocomplete/InlineAutocomplete.tsx (100%) rename packages/react/src/{drafts => experimental}/InlineAutocomplete/_AutocompleteSuggestions.tsx (100%) rename packages/react/src/{drafts => experimental}/InlineAutocomplete/index.ts (100%) rename packages/react/src/{drafts => experimental}/InlineAutocomplete/types.ts (100%) rename packages/react/src/{drafts => experimental}/InlineAutocomplete/utils.ts (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/Actions.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/Footer.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/Label.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/MarkdownEditor.docs.json (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/MarkdownEditor.features.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/MarkdownEditor.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/MarkdownEditor.test.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/MarkdownEditor.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/Toolbar.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/_ErrorMessage.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/_FormattingTools.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/_MarkdownEditorContext.ts (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/_MarkdownInput.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/_SavedReplies.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/_ToolbarButton.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/_ViewSwitch.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/_useFileHandling.ts (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/_useIndenting.ts (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/_useListEditing.ts (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/index.ts (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/markdown-toolbar-element.d.ts (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/suggestions/_useEmojiSuggestions.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/suggestions/_useMentionSuggestions.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/suggestions/_useReferenceSuggestions.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/suggestions/index.ts (100%) rename packages/react/src/{drafts => experimental}/MarkdownEditor/utils.ts (100%) rename packages/react/src/{drafts => experimental}/MarkdownViewer/MarkdownViewer.docs.json (100%) rename packages/react/src/{drafts => experimental}/MarkdownViewer/MarkdownViewer.features.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownViewer/MarkdownViewer.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownViewer/MarkdownViewer.test.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownViewer/MarkdownViewer.tsx (100%) rename packages/react/src/{drafts => experimental}/MarkdownViewer/_useLinkInterception.ts (100%) rename packages/react/src/{drafts => experimental}/MarkdownViewer/_useListInteraction.ts (100%) rename packages/react/src/{drafts => experimental}/MarkdownViewer/index.ts (100%) rename packages/react/src/{drafts => experimental}/SelectPanel2/SelectPanel.docs.json (100%) rename packages/react/src/{drafts => experimental}/SelectPanel2/SelectPanel.examples.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/SelectPanel2/SelectPanel.features.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/SelectPanel2/SelectPanel.playground.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/SelectPanel2/SelectPanel.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/SelectPanel2/SelectPanel.test.tsx (100%) rename packages/react/src/{drafts => experimental}/SelectPanel2/SelectPanel.tsx (100%) rename packages/react/src/{drafts => experimental}/SelectPanel2/__tests__/SelectPanelLoading.test.tsx (100%) rename packages/react/src/{drafts => experimental}/SelectPanel2/index.tsx (100%) rename packages/react/src/{drafts => experimental}/SelectPanel2/mock-story-data.ts (100%) rename packages/react/src/{drafts => experimental}/SelectPanel2/work-log.md (100%) rename packages/react/src/{drafts => experimental}/Skeleton/Skeleton.examples.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/Skeleton/SkeletonAvatar.docs.json (100%) rename packages/react/src/{drafts => experimental}/Skeleton/SkeletonAvatar.features.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/Skeleton/SkeletonAvatar.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/Skeleton/SkeletonAvatar.tsx (100%) rename packages/react/src/{drafts => experimental}/Skeleton/SkeletonBox.docs.json (100%) rename packages/react/src/{drafts => experimental}/Skeleton/SkeletonBox.features.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/Skeleton/SkeletonBox.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/Skeleton/SkeletonBox.tsx (100%) rename packages/react/src/{drafts => experimental}/Skeleton/SkeletonText.docs.json (100%) rename packages/react/src/{drafts => experimental}/Skeleton/SkeletonText.features.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/Skeleton/SkeletonText.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/Skeleton/SkeletonText.tsx (100%) rename packages/react/src/{drafts => experimental}/Skeleton/index.ts (100%) rename packages/react/src/{drafts => experimental}/TabPanels/TabPanels.docs.json (100%) rename packages/react/src/{drafts => experimental}/TabPanels/TabPanels.features.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/TabPanels/TabPanels.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/TabPanels/TabPanels.tsx (100%) rename packages/react/src/{drafts => experimental}/TabPanels/__tests__/TabPanels.test.tsx (100%) rename packages/react/src/{drafts => experimental}/TabPanels/index.ts (100%) rename packages/react/src/{drafts => experimental}/UnderlinePanels/UnderlinePanels.docs.json (100%) rename packages/react/src/{drafts => experimental}/UnderlinePanels/UnderlinePanels.features.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/UnderlinePanels/UnderlinePanels.stories.tsx (100%) rename packages/react/src/{drafts => experimental}/UnderlinePanels/UnderlinePanels.test.tsx (100%) rename packages/react/src/{drafts => experimental}/UnderlinePanels/UnderlinePanels.tsx (100%) rename packages/react/src/{drafts => experimental}/UnderlinePanels/index.ts (100%) rename packages/react/src/{drafts => experimental}/hooks/index.ts (100%) rename packages/react/src/{drafts => experimental}/hooks/useCombobox.ts (100%) rename packages/react/src/{drafts => experimental}/hooks/useDynamicTextareaHeight.ts (100%) rename packages/react/src/{drafts => experimental}/hooks/useIgnoreKeyboardActionsWhileComposing.test.tsx (100%) rename packages/react/src/{drafts => experimental}/hooks/useIgnoreKeyboardActionsWhileComposing.ts (100%) rename packages/react/src/{drafts => experimental}/hooks/useSafeAsyncCallback.ts (100%) rename packages/react/src/{drafts => experimental}/hooks/useSyntheticChange.ts (100%) rename packages/react/src/{drafts => experimental}/hooks/useUnifiedFileSelect.ts (100%) rename packages/react/src/{drafts => experimental}/utils/character-coordinates.ts (100%) diff --git a/packages/react/drafts/package.json b/packages/react/drafts/package.json deleted file mode 100644 index 3a2ed1c37ae..00000000000 --- a/packages/react/drafts/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "_comment1": "this is required only for typescript. once this is fixed https://github.com/microsoft/TypeScript/issues/33079 we can remove this hack", - "name": "@primer/react/drafts", - "types": "../lib-esm/drafts/index.d.ts", - "main": "../lib-esm/drafts/index.js", - "type": "module", - "sideEffects": false - } - \ No newline at end of file diff --git a/packages/react/figma.config.json b/packages/react/figma.config.json index 7c2c95b322d..b1d7c8bbaa1 100644 --- a/packages/react/figma.config.json +++ b/packages/react/figma.config.json @@ -3,11 +3,11 @@ "parser": "react", "importPaths": { "src/*": "@primer/react", - "src/drafts/*": "@primer/react/drafts", "src/experimental/*": "@primer/react/experimental", "src/deprecated/*": "@primer/react/deprecated" }, "include": ["src/**/*.figma.tsx", "src/**/*.tsx"], "exclude": ["test/**", "docs/**", "build/**"] } -} \ No newline at end of file +} + diff --git a/packages/react/package.json b/packages/react/package.json index 866cb1f19fb..d0de457d836 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -13,10 +13,6 @@ "import": "./lib-esm/experimental/index.js", "require": "./lib/experimental/index.js" }, - "./drafts": { - "import": "./lib-esm/drafts/index.js", - "require": "./lib/drafts/index.js" - }, "./deprecated": { "import": "./lib-esm/deprecated/index.js", "require": "./lib/deprecated/index.js" @@ -69,7 +65,6 @@ "css", "index.d.ts", "deprecated/package.json", - "drafts/package.json", "experimental/package.json", "!lib/__tests__", "!lib/stories", diff --git a/packages/react/rollup.config.js b/packages/react/rollup.config.js index 1ef5c35e8fb..911c565fdea 100644 --- a/packages/react/rollup.config.js +++ b/packages/react/rollup.config.js @@ -17,9 +17,6 @@ const input = new Set([ // "./experimental" 'src/experimental/index.ts', - // "./drafts" - 'src/drafts/index.ts', - // "./deprecated" 'src/deprecated/index.ts', diff --git a/packages/react/src/AvatarPair/AvatarPair.tsx b/packages/react/src/AvatarPair/AvatarPair.tsx index 58c40250321..a203ed3ab6c 100644 --- a/packages/react/src/AvatarPair/AvatarPair.tsx +++ b/packages/react/src/AvatarPair/AvatarPair.tsx @@ -4,7 +4,7 @@ import type {AvatarProps} from '../Avatar' import Avatar from '../Avatar' import {get} from '../constants' import Box, {type BoxProps} from '../Box' -import {SkeletonAvatar} from '../drafts/Skeleton/SkeletonAvatar' +import {SkeletonAvatar} from '../experimental/Skeleton/SkeletonAvatar' const StyledAvatarPair = styled(Box)` position: relative; diff --git a/packages/react/src/DataTable/Table.tsx b/packages/react/src/DataTable/Table.tsx index e6bd49a6d21..4e5d4b11989 100644 --- a/packages/react/src/DataTable/Table.tsx +++ b/packages/react/src/DataTable/Table.tsx @@ -12,7 +12,7 @@ import type {Column, CellAlignment} from './column' import type {UniqueRow} from './row' import {SortDirection} from './sorting' import {useTableLayout} from './useTable' -import {SkeletonText} from '../drafts/Skeleton/SkeletonText' +import {SkeletonText} from '../experimental/Skeleton/SkeletonText' import {ScrollableRegion} from '../ScrollableRegion' // ---------------------------------------------------------------------------- diff --git a/packages/react/src/TreeView/TreeView.tsx b/packages/react/src/TreeView/TreeView.tsx index 736842c6076..60172c3538d 100644 --- a/packages/react/src/TreeView/TreeView.tsx +++ b/packages/react/src/TreeView/TreeView.tsx @@ -21,8 +21,8 @@ import sx from '../sx' import {getAccessibleName} from './shared' import {getFirstChildElement, useRovingTabIndex} from './useRovingTabIndex' import {useTypeahead} from './useTypeahead' -import {SkeletonAvatar} from '../drafts/Skeleton/SkeletonAvatar' -import {SkeletonText} from '../drafts/Skeleton/SkeletonText' +import {SkeletonAvatar} from '../experimental/Skeleton/SkeletonAvatar' +import {SkeletonText} from '../experimental/Skeleton/SkeletonText' // ---------------------------------------------------------------------------- // Context diff --git a/packages/react/src/__tests__/__snapshots__/exports.test.ts.snap b/packages/react/src/__tests__/__snapshots__/exports.test.ts.snap index 863995da30e..4b096d44012 100644 --- a/packages/react/src/__tests__/__snapshots__/exports.test.ts.snap +++ b/packages/react/src/__tests__/__snapshots__/exports.test.ts.snap @@ -243,120 +243,6 @@ exports[`@primer/react/deprecated should not update exports without a semver cha ] `; -exports[`@primer/react/drafts should not update exports without a semver change 1`] = ` -[ - "ActionBar", - "type ActionBarProps", - "Announce", - "type AnnounceProps", - "AriaAlert", - "type AriaAlertProps", - "AriaStatus", - "type AriaStatusProps", - "Banner", - "type BannerProps", - "Blankslate", - "type BlankslateProps", - "callbackCancelledResult", - "type CallbackCancelledResult", - "type ChildrenPropTypes", - "type Column", - "type ComboboxCommitEvent", - "createColumnHelper", - "DataTable", - "type DataTableProps", - "default", - "default", - "default", - "Dialog", - "type DialogButtonProps", - "type DialogHeaderProps", - "type DialogHeight", - "type DialogProps", - "type DialogWidth", - "type Emoji", - "type FileType", - "type FileUploadResult", - "Hidden", - "type HiddenProps", - "InlineAutocomplete", - "type InlineAutocompleteProps", - "InlineMessage", - "type InlineMessageProps", - "type InteractiveMarkdownViewerProps", - "MarkdownEditor", - "type MarkdownEditorHandle", - "type MarkdownEditorProps", - "MarkdownViewer", - "type MarkdownViewerProps", - "type Mentionable", - "type NavigationProps", - "NavList", - "type NavListDividerProps", - "type NavListGroupProps", - "type NavListItemProps", - "type NavListLeadingVisualProps", - "type NavListProps", - "type NavListSubNavProps", - "type NavListTrailingVisualProps", - "PageHeader", - "type PageHeaderProps", - "type ParentLinkProps", - "type Reference", - "type SavedReply", - "ScrollableRegion", - "type ScrollableRegionProps", - "SelectPanel", - "type SelectPanelMessageProps", - "type SelectPanelProps", - "type SelectPanelSecondaryActionProps", - "type ShowSuggestionsEvent", - "SkeletonAvatar", - "SkeletonBox", - "SkeletonText", - "type SlotConfig", - "Stack", - "type StackItemProps", - "type StackProps", - "type Suggestion", - "type Suggestions", - "type SyntheticChangeEmitter", - "Table", - "type TableActionsProps", - "type TableBodyProps", - "type TableCellProps", - "type TableContainerProps", - "type TableHeaderProps", - "type TableHeadProps", - "type TableProps", - "type TableRowProps", - "type TableSubtitleProps", - "type TableTitleProps", - "TabPanels", - "type TabPanelsPanelProps", - "type TabPanelsProps", - "type TabPanelsTabProps", - "type TitleProps", - "Tooltip", - "TooltipContext", - "type TooltipDirection", - "type TooltipProps", - "type Trigger", - "type TriggerPropsType", - "UnderlinePanels", - "type UnderlinePanelsPanelProps", - "type UnderlinePanelsProps", - "type UnderlinePanelsTabProps", - "useCombobox", - "useDynamicTextareaHeight", - "useIgnoreKeyboardActionsWhileComposing", - "useOverflow", - "useSafeAsyncCallback", - "useSlots", - "useSyntheticChange", -] -`; - exports[`@primer/react/experimental should not update exports without a semver change 1`] = ` [ "ActionBar", diff --git a/packages/react/src/__tests__/exports.test.ts b/packages/react/src/__tests__/exports.test.ts index 3fc912b6df6..c02db9929df 100644 --- a/packages/react/src/__tests__/exports.test.ts +++ b/packages/react/src/__tests__/exports.test.ts @@ -42,20 +42,6 @@ describe('@primer/react/experimental', () => { }) }) -describe('@primer/react/drafts', () => { - it('should not update exports without a semver change', async () => { - const exports = project.getEntrypointExports(path.join(ROOT_DIR, 'src', 'drafts', 'index.ts')) - expect( - exports.map(exportInfo => { - if (exportInfo.type === 'type') { - return `type ${exportInfo.identifier}` - } - return exportInfo.identifier - }), - ).toMatchSnapshot() - }) -}) - describe('@primer/react/deprecated', () => { it('should not update exports without a semver change', async () => { const exports = project.getEntrypointExports(path.join(ROOT_DIR, 'src', 'deprecated', 'index.ts')) diff --git a/packages/react/src/__tests__/hooks/_useListEditing.test.tsx b/packages/react/src/__tests__/hooks/_useListEditing.test.tsx index 1cb29049dda..e6d4fe003f9 100644 --- a/packages/react/src/__tests__/hooks/_useListEditing.test.tsx +++ b/packages/react/src/__tests__/hooks/_useListEditing.test.tsx @@ -1,5 +1,5 @@ -import type {ListItem} from '../../drafts/MarkdownEditor/_useListEditing' -import {parseListItem, listItemToString} from '../../drafts/MarkdownEditor/_useListEditing' +import type {ListItem} from '../../experimental/MarkdownEditor/_useListEditing' +import {parseListItem, listItemToString} from '../../experimental/MarkdownEditor/_useListEditing' describe('parseListItem', () => { it('should return null for a line that is not a list item', () => { diff --git a/packages/react/src/__tests__/hooks/_useListInteraction.test.tsx b/packages/react/src/__tests__/hooks/_useListInteraction.test.tsx index 7bb9a697e17..aa2d3a4c08b 100644 --- a/packages/react/src/__tests__/hooks/_useListInteraction.test.tsx +++ b/packages/react/src/__tests__/hooks/_useListInteraction.test.tsx @@ -1,4 +1,4 @@ -import {parseCodeFenceBegin, isCodeFenceEnd} from '../../drafts/MarkdownViewer/_useListInteraction' +import {parseCodeFenceBegin, isCodeFenceEnd} from '../../experimental/MarkdownViewer/_useListInteraction' describe('parseCodeFenceBegin', () => { it('should return null for a line without a code fence', () => { diff --git a/packages/react/src/drafts/index.ts b/packages/react/src/drafts/index.ts deleted file mode 100644 index 16a78befb4a..00000000000 --- a/packages/react/src/drafts/index.ts +++ /dev/null @@ -1,87 +0,0 @@ -/** - * This is the place where we keep components that are not part of the public - * api yet (not in main bundle). We don't recommend using it in production. - * - * But, they are published on npm and you can import them for experimentation/feedback. - * example: import {ActionList} from '@primer/react/drafts - */ - -'use client' - -export {Blankslate} from '../Blankslate' -export type {BlankslateProps} from '../Blankslate' - -export {Banner} from '../Banner' -export type {BannerProps} from '../Banner' - -export {DataTable, Table, createColumnHelper} from '../DataTable' -export type { - DataTableProps, - TableProps, - TableHeadProps, - TableBodyProps, - TableRowProps, - TableHeaderProps, - TableCellProps, - TableContainerProps, - TableTitleProps, - TableSubtitleProps, - TableActionsProps, - Column, -} from '../DataTable' - -export * from '../Dialog/Dialog' - -export {default as InlineAutocomplete} from './InlineAutocomplete' -export type { - InlineAutocompleteProps, - ShowSuggestionsEvent, - Suggestion, - Suggestions, - Trigger, -} from './InlineAutocomplete' - -export {InlineMessage} from '../InlineMessage' -export type {InlineMessageProps} from '../InlineMessage' - -export {default as MarkdownViewer} from './MarkdownViewer' -export type {MarkdownViewerProps, InteractiveMarkdownViewerProps} from './MarkdownViewer' - -export {default as MarkdownEditor} from './MarkdownEditor' -export * from './MarkdownEditor' - -export * from '../PageHeader' - -export * from '../Hidden' - -export * from './hooks' - -export {NavList} from '../NavList' -export type { - NavListProps, - NavListItemProps, - NavListSubNavProps, - NavListGroupProps, - NavListLeadingVisualProps, - NavListTrailingVisualProps, - NavListDividerProps, -} from '../NavList' -export * from './SelectPanel2' -export {default as TabPanels} from './TabPanels' -export type {TabPanelsProps, TabPanelsTabProps, TabPanelsPanelProps} from './TabPanels' -export * from '../TooltipV2' -export * from '../ActionBar' - -export {ScrollableRegion} from '../ScrollableRegion' -export type {ScrollableRegionProps} from '../ScrollableRegion' - -export {Stack} from '../Stack' -export type {StackProps, StackItemProps} from '../Stack' - -export {Announce, AriaStatus, AriaAlert} from '../live-region' -export type {AnnounceProps, AriaStatusProps, AriaAlertProps} from '../live-region' - -export {UnderlinePanels} from './UnderlinePanels' -export type {UnderlinePanelsProps, UnderlinePanelsTabProps, UnderlinePanelsPanelProps} from './UnderlinePanels' - -export {SkeletonBox, SkeletonText, SkeletonAvatar} from './Skeleton' diff --git a/packages/react/src/drafts/CSSComponent/Component.stories.tsx b/packages/react/src/experimental/CSSComponent/Component.stories.tsx similarity index 100% rename from packages/react/src/drafts/CSSComponent/Component.stories.tsx rename to packages/react/src/experimental/CSSComponent/Component.stories.tsx diff --git a/packages/react/src/drafts/CSSComponent/component.module.css b/packages/react/src/experimental/CSSComponent/component.module.css similarity index 100% rename from packages/react/src/drafts/CSSComponent/component.module.css rename to packages/react/src/experimental/CSSComponent/component.module.css diff --git a/packages/react/src/drafts/CSSComponent/index.tsx b/packages/react/src/experimental/CSSComponent/index.tsx similarity index 100% rename from packages/react/src/drafts/CSSComponent/index.tsx rename to packages/react/src/experimental/CSSComponent/index.tsx diff --git a/packages/react/src/drafts/InlineAutocomplete/InlineAutocomplete.docs.json b/packages/react/src/experimental/InlineAutocomplete/InlineAutocomplete.docs.json similarity index 100% rename from packages/react/src/drafts/InlineAutocomplete/InlineAutocomplete.docs.json rename to packages/react/src/experimental/InlineAutocomplete/InlineAutocomplete.docs.json diff --git a/packages/react/src/drafts/InlineAutocomplete/InlineAutocomplete.features.stories.tsx b/packages/react/src/experimental/InlineAutocomplete/InlineAutocomplete.features.stories.tsx similarity index 100% rename from packages/react/src/drafts/InlineAutocomplete/InlineAutocomplete.features.stories.tsx rename to packages/react/src/experimental/InlineAutocomplete/InlineAutocomplete.features.stories.tsx diff --git a/packages/react/src/drafts/InlineAutocomplete/InlineAutocomplete.stories.tsx b/packages/react/src/experimental/InlineAutocomplete/InlineAutocomplete.stories.tsx similarity index 100% rename from packages/react/src/drafts/InlineAutocomplete/InlineAutocomplete.stories.tsx rename to packages/react/src/experimental/InlineAutocomplete/InlineAutocomplete.stories.tsx diff --git a/packages/react/src/drafts/InlineAutocomplete/InlineAutocomplete.test.tsx b/packages/react/src/experimental/InlineAutocomplete/InlineAutocomplete.test.tsx similarity index 100% rename from packages/react/src/drafts/InlineAutocomplete/InlineAutocomplete.test.tsx rename to packages/react/src/experimental/InlineAutocomplete/InlineAutocomplete.test.tsx diff --git a/packages/react/src/drafts/InlineAutocomplete/InlineAutocomplete.tsx b/packages/react/src/experimental/InlineAutocomplete/InlineAutocomplete.tsx similarity index 100% rename from packages/react/src/drafts/InlineAutocomplete/InlineAutocomplete.tsx rename to packages/react/src/experimental/InlineAutocomplete/InlineAutocomplete.tsx diff --git a/packages/react/src/drafts/InlineAutocomplete/_AutocompleteSuggestions.tsx b/packages/react/src/experimental/InlineAutocomplete/_AutocompleteSuggestions.tsx similarity index 100% rename from packages/react/src/drafts/InlineAutocomplete/_AutocompleteSuggestions.tsx rename to packages/react/src/experimental/InlineAutocomplete/_AutocompleteSuggestions.tsx diff --git a/packages/react/src/drafts/InlineAutocomplete/index.ts b/packages/react/src/experimental/InlineAutocomplete/index.ts similarity index 100% rename from packages/react/src/drafts/InlineAutocomplete/index.ts rename to packages/react/src/experimental/InlineAutocomplete/index.ts diff --git a/packages/react/src/drafts/InlineAutocomplete/types.ts b/packages/react/src/experimental/InlineAutocomplete/types.ts similarity index 100% rename from packages/react/src/drafts/InlineAutocomplete/types.ts rename to packages/react/src/experimental/InlineAutocomplete/types.ts diff --git a/packages/react/src/drafts/InlineAutocomplete/utils.ts b/packages/react/src/experimental/InlineAutocomplete/utils.ts similarity index 100% rename from packages/react/src/drafts/InlineAutocomplete/utils.ts rename to packages/react/src/experimental/InlineAutocomplete/utils.ts diff --git a/packages/react/src/drafts/MarkdownEditor/Actions.tsx b/packages/react/src/experimental/MarkdownEditor/Actions.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/Actions.tsx rename to packages/react/src/experimental/MarkdownEditor/Actions.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/Footer.tsx b/packages/react/src/experimental/MarkdownEditor/Footer.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/Footer.tsx rename to packages/react/src/experimental/MarkdownEditor/Footer.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/Label.tsx b/packages/react/src/experimental/MarkdownEditor/Label.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/Label.tsx rename to packages/react/src/experimental/MarkdownEditor/Label.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/MarkdownEditor.docs.json b/packages/react/src/experimental/MarkdownEditor/MarkdownEditor.docs.json similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/MarkdownEditor.docs.json rename to packages/react/src/experimental/MarkdownEditor/MarkdownEditor.docs.json diff --git a/packages/react/src/drafts/MarkdownEditor/MarkdownEditor.features.stories.tsx b/packages/react/src/experimental/MarkdownEditor/MarkdownEditor.features.stories.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/MarkdownEditor.features.stories.tsx rename to packages/react/src/experimental/MarkdownEditor/MarkdownEditor.features.stories.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/MarkdownEditor.stories.tsx b/packages/react/src/experimental/MarkdownEditor/MarkdownEditor.stories.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/MarkdownEditor.stories.tsx rename to packages/react/src/experimental/MarkdownEditor/MarkdownEditor.stories.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/MarkdownEditor.test.tsx b/packages/react/src/experimental/MarkdownEditor/MarkdownEditor.test.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/MarkdownEditor.test.tsx rename to packages/react/src/experimental/MarkdownEditor/MarkdownEditor.test.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/MarkdownEditor.tsx b/packages/react/src/experimental/MarkdownEditor/MarkdownEditor.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/MarkdownEditor.tsx rename to packages/react/src/experimental/MarkdownEditor/MarkdownEditor.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/Toolbar.tsx b/packages/react/src/experimental/MarkdownEditor/Toolbar.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/Toolbar.tsx rename to packages/react/src/experimental/MarkdownEditor/Toolbar.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/_ErrorMessage.tsx b/packages/react/src/experimental/MarkdownEditor/_ErrorMessage.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/_ErrorMessage.tsx rename to packages/react/src/experimental/MarkdownEditor/_ErrorMessage.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/_FormattingTools.tsx b/packages/react/src/experimental/MarkdownEditor/_FormattingTools.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/_FormattingTools.tsx rename to packages/react/src/experimental/MarkdownEditor/_FormattingTools.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/_MarkdownEditorContext.ts b/packages/react/src/experimental/MarkdownEditor/_MarkdownEditorContext.ts similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/_MarkdownEditorContext.ts rename to packages/react/src/experimental/MarkdownEditor/_MarkdownEditorContext.ts diff --git a/packages/react/src/drafts/MarkdownEditor/_MarkdownInput.tsx b/packages/react/src/experimental/MarkdownEditor/_MarkdownInput.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/_MarkdownInput.tsx rename to packages/react/src/experimental/MarkdownEditor/_MarkdownInput.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/_SavedReplies.tsx b/packages/react/src/experimental/MarkdownEditor/_SavedReplies.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/_SavedReplies.tsx rename to packages/react/src/experimental/MarkdownEditor/_SavedReplies.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/_ToolbarButton.tsx b/packages/react/src/experimental/MarkdownEditor/_ToolbarButton.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/_ToolbarButton.tsx rename to packages/react/src/experimental/MarkdownEditor/_ToolbarButton.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/_ViewSwitch.tsx b/packages/react/src/experimental/MarkdownEditor/_ViewSwitch.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/_ViewSwitch.tsx rename to packages/react/src/experimental/MarkdownEditor/_ViewSwitch.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/_useFileHandling.ts b/packages/react/src/experimental/MarkdownEditor/_useFileHandling.ts similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/_useFileHandling.ts rename to packages/react/src/experimental/MarkdownEditor/_useFileHandling.ts diff --git a/packages/react/src/drafts/MarkdownEditor/_useIndenting.ts b/packages/react/src/experimental/MarkdownEditor/_useIndenting.ts similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/_useIndenting.ts rename to packages/react/src/experimental/MarkdownEditor/_useIndenting.ts diff --git a/packages/react/src/drafts/MarkdownEditor/_useListEditing.ts b/packages/react/src/experimental/MarkdownEditor/_useListEditing.ts similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/_useListEditing.ts rename to packages/react/src/experimental/MarkdownEditor/_useListEditing.ts diff --git a/packages/react/src/drafts/MarkdownEditor/index.ts b/packages/react/src/experimental/MarkdownEditor/index.ts similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/index.ts rename to packages/react/src/experimental/MarkdownEditor/index.ts diff --git a/packages/react/src/drafts/MarkdownEditor/markdown-toolbar-element.d.ts b/packages/react/src/experimental/MarkdownEditor/markdown-toolbar-element.d.ts similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/markdown-toolbar-element.d.ts rename to packages/react/src/experimental/MarkdownEditor/markdown-toolbar-element.d.ts diff --git a/packages/react/src/drafts/MarkdownEditor/suggestions/_useEmojiSuggestions.tsx b/packages/react/src/experimental/MarkdownEditor/suggestions/_useEmojiSuggestions.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/suggestions/_useEmojiSuggestions.tsx rename to packages/react/src/experimental/MarkdownEditor/suggestions/_useEmojiSuggestions.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/suggestions/_useMentionSuggestions.tsx b/packages/react/src/experimental/MarkdownEditor/suggestions/_useMentionSuggestions.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/suggestions/_useMentionSuggestions.tsx rename to packages/react/src/experimental/MarkdownEditor/suggestions/_useMentionSuggestions.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/suggestions/_useReferenceSuggestions.tsx b/packages/react/src/experimental/MarkdownEditor/suggestions/_useReferenceSuggestions.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/suggestions/_useReferenceSuggestions.tsx rename to packages/react/src/experimental/MarkdownEditor/suggestions/_useReferenceSuggestions.tsx diff --git a/packages/react/src/drafts/MarkdownEditor/suggestions/index.ts b/packages/react/src/experimental/MarkdownEditor/suggestions/index.ts similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/suggestions/index.ts rename to packages/react/src/experimental/MarkdownEditor/suggestions/index.ts diff --git a/packages/react/src/drafts/MarkdownEditor/utils.ts b/packages/react/src/experimental/MarkdownEditor/utils.ts similarity index 100% rename from packages/react/src/drafts/MarkdownEditor/utils.ts rename to packages/react/src/experimental/MarkdownEditor/utils.ts diff --git a/packages/react/src/drafts/MarkdownViewer/MarkdownViewer.docs.json b/packages/react/src/experimental/MarkdownViewer/MarkdownViewer.docs.json similarity index 100% rename from packages/react/src/drafts/MarkdownViewer/MarkdownViewer.docs.json rename to packages/react/src/experimental/MarkdownViewer/MarkdownViewer.docs.json diff --git a/packages/react/src/drafts/MarkdownViewer/MarkdownViewer.features.stories.tsx b/packages/react/src/experimental/MarkdownViewer/MarkdownViewer.features.stories.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownViewer/MarkdownViewer.features.stories.tsx rename to packages/react/src/experimental/MarkdownViewer/MarkdownViewer.features.stories.tsx diff --git a/packages/react/src/drafts/MarkdownViewer/MarkdownViewer.stories.tsx b/packages/react/src/experimental/MarkdownViewer/MarkdownViewer.stories.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownViewer/MarkdownViewer.stories.tsx rename to packages/react/src/experimental/MarkdownViewer/MarkdownViewer.stories.tsx diff --git a/packages/react/src/drafts/MarkdownViewer/MarkdownViewer.test.tsx b/packages/react/src/experimental/MarkdownViewer/MarkdownViewer.test.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownViewer/MarkdownViewer.test.tsx rename to packages/react/src/experimental/MarkdownViewer/MarkdownViewer.test.tsx diff --git a/packages/react/src/drafts/MarkdownViewer/MarkdownViewer.tsx b/packages/react/src/experimental/MarkdownViewer/MarkdownViewer.tsx similarity index 100% rename from packages/react/src/drafts/MarkdownViewer/MarkdownViewer.tsx rename to packages/react/src/experimental/MarkdownViewer/MarkdownViewer.tsx diff --git a/packages/react/src/drafts/MarkdownViewer/_useLinkInterception.ts b/packages/react/src/experimental/MarkdownViewer/_useLinkInterception.ts similarity index 100% rename from packages/react/src/drafts/MarkdownViewer/_useLinkInterception.ts rename to packages/react/src/experimental/MarkdownViewer/_useLinkInterception.ts diff --git a/packages/react/src/drafts/MarkdownViewer/_useListInteraction.ts b/packages/react/src/experimental/MarkdownViewer/_useListInteraction.ts similarity index 100% rename from packages/react/src/drafts/MarkdownViewer/_useListInteraction.ts rename to packages/react/src/experimental/MarkdownViewer/_useListInteraction.ts diff --git a/packages/react/src/drafts/MarkdownViewer/index.ts b/packages/react/src/experimental/MarkdownViewer/index.ts similarity index 100% rename from packages/react/src/drafts/MarkdownViewer/index.ts rename to packages/react/src/experimental/MarkdownViewer/index.ts diff --git a/packages/react/src/drafts/SelectPanel2/SelectPanel.docs.json b/packages/react/src/experimental/SelectPanel2/SelectPanel.docs.json similarity index 100% rename from packages/react/src/drafts/SelectPanel2/SelectPanel.docs.json rename to packages/react/src/experimental/SelectPanel2/SelectPanel.docs.json diff --git a/packages/react/src/drafts/SelectPanel2/SelectPanel.examples.stories.tsx b/packages/react/src/experimental/SelectPanel2/SelectPanel.examples.stories.tsx similarity index 100% rename from packages/react/src/drafts/SelectPanel2/SelectPanel.examples.stories.tsx rename to packages/react/src/experimental/SelectPanel2/SelectPanel.examples.stories.tsx diff --git a/packages/react/src/drafts/SelectPanel2/SelectPanel.features.stories.tsx b/packages/react/src/experimental/SelectPanel2/SelectPanel.features.stories.tsx similarity index 100% rename from packages/react/src/drafts/SelectPanel2/SelectPanel.features.stories.tsx rename to packages/react/src/experimental/SelectPanel2/SelectPanel.features.stories.tsx diff --git a/packages/react/src/drafts/SelectPanel2/SelectPanel.playground.stories.tsx b/packages/react/src/experimental/SelectPanel2/SelectPanel.playground.stories.tsx similarity index 100% rename from packages/react/src/drafts/SelectPanel2/SelectPanel.playground.stories.tsx rename to packages/react/src/experimental/SelectPanel2/SelectPanel.playground.stories.tsx diff --git a/packages/react/src/drafts/SelectPanel2/SelectPanel.stories.tsx b/packages/react/src/experimental/SelectPanel2/SelectPanel.stories.tsx similarity index 100% rename from packages/react/src/drafts/SelectPanel2/SelectPanel.stories.tsx rename to packages/react/src/experimental/SelectPanel2/SelectPanel.stories.tsx diff --git a/packages/react/src/drafts/SelectPanel2/SelectPanel.test.tsx b/packages/react/src/experimental/SelectPanel2/SelectPanel.test.tsx similarity index 100% rename from packages/react/src/drafts/SelectPanel2/SelectPanel.test.tsx rename to packages/react/src/experimental/SelectPanel2/SelectPanel.test.tsx diff --git a/packages/react/src/drafts/SelectPanel2/SelectPanel.tsx b/packages/react/src/experimental/SelectPanel2/SelectPanel.tsx similarity index 100% rename from packages/react/src/drafts/SelectPanel2/SelectPanel.tsx rename to packages/react/src/experimental/SelectPanel2/SelectPanel.tsx diff --git a/packages/react/src/drafts/SelectPanel2/__tests__/SelectPanelLoading.test.tsx b/packages/react/src/experimental/SelectPanel2/__tests__/SelectPanelLoading.test.tsx similarity index 100% rename from packages/react/src/drafts/SelectPanel2/__tests__/SelectPanelLoading.test.tsx rename to packages/react/src/experimental/SelectPanel2/__tests__/SelectPanelLoading.test.tsx diff --git a/packages/react/src/drafts/SelectPanel2/index.tsx b/packages/react/src/experimental/SelectPanel2/index.tsx similarity index 100% rename from packages/react/src/drafts/SelectPanel2/index.tsx rename to packages/react/src/experimental/SelectPanel2/index.tsx diff --git a/packages/react/src/drafts/SelectPanel2/mock-story-data.ts b/packages/react/src/experimental/SelectPanel2/mock-story-data.ts similarity index 100% rename from packages/react/src/drafts/SelectPanel2/mock-story-data.ts rename to packages/react/src/experimental/SelectPanel2/mock-story-data.ts diff --git a/packages/react/src/drafts/SelectPanel2/work-log.md b/packages/react/src/experimental/SelectPanel2/work-log.md similarity index 100% rename from packages/react/src/drafts/SelectPanel2/work-log.md rename to packages/react/src/experimental/SelectPanel2/work-log.md diff --git a/packages/react/src/drafts/Skeleton/Skeleton.examples.stories.tsx b/packages/react/src/experimental/Skeleton/Skeleton.examples.stories.tsx similarity index 100% rename from packages/react/src/drafts/Skeleton/Skeleton.examples.stories.tsx rename to packages/react/src/experimental/Skeleton/Skeleton.examples.stories.tsx diff --git a/packages/react/src/drafts/Skeleton/SkeletonAvatar.docs.json b/packages/react/src/experimental/Skeleton/SkeletonAvatar.docs.json similarity index 100% rename from packages/react/src/drafts/Skeleton/SkeletonAvatar.docs.json rename to packages/react/src/experimental/Skeleton/SkeletonAvatar.docs.json diff --git a/packages/react/src/drafts/Skeleton/SkeletonAvatar.features.stories.tsx b/packages/react/src/experimental/Skeleton/SkeletonAvatar.features.stories.tsx similarity index 100% rename from packages/react/src/drafts/Skeleton/SkeletonAvatar.features.stories.tsx rename to packages/react/src/experimental/Skeleton/SkeletonAvatar.features.stories.tsx diff --git a/packages/react/src/drafts/Skeleton/SkeletonAvatar.stories.tsx b/packages/react/src/experimental/Skeleton/SkeletonAvatar.stories.tsx similarity index 100% rename from packages/react/src/drafts/Skeleton/SkeletonAvatar.stories.tsx rename to packages/react/src/experimental/Skeleton/SkeletonAvatar.stories.tsx diff --git a/packages/react/src/drafts/Skeleton/SkeletonAvatar.tsx b/packages/react/src/experimental/Skeleton/SkeletonAvatar.tsx similarity index 100% rename from packages/react/src/drafts/Skeleton/SkeletonAvatar.tsx rename to packages/react/src/experimental/Skeleton/SkeletonAvatar.tsx diff --git a/packages/react/src/drafts/Skeleton/SkeletonBox.docs.json b/packages/react/src/experimental/Skeleton/SkeletonBox.docs.json similarity index 100% rename from packages/react/src/drafts/Skeleton/SkeletonBox.docs.json rename to packages/react/src/experimental/Skeleton/SkeletonBox.docs.json diff --git a/packages/react/src/drafts/Skeleton/SkeletonBox.features.stories.tsx b/packages/react/src/experimental/Skeleton/SkeletonBox.features.stories.tsx similarity index 100% rename from packages/react/src/drafts/Skeleton/SkeletonBox.features.stories.tsx rename to packages/react/src/experimental/Skeleton/SkeletonBox.features.stories.tsx diff --git a/packages/react/src/drafts/Skeleton/SkeletonBox.stories.tsx b/packages/react/src/experimental/Skeleton/SkeletonBox.stories.tsx similarity index 100% rename from packages/react/src/drafts/Skeleton/SkeletonBox.stories.tsx rename to packages/react/src/experimental/Skeleton/SkeletonBox.stories.tsx diff --git a/packages/react/src/drafts/Skeleton/SkeletonBox.tsx b/packages/react/src/experimental/Skeleton/SkeletonBox.tsx similarity index 100% rename from packages/react/src/drafts/Skeleton/SkeletonBox.tsx rename to packages/react/src/experimental/Skeleton/SkeletonBox.tsx diff --git a/packages/react/src/drafts/Skeleton/SkeletonText.docs.json b/packages/react/src/experimental/Skeleton/SkeletonText.docs.json similarity index 100% rename from packages/react/src/drafts/Skeleton/SkeletonText.docs.json rename to packages/react/src/experimental/Skeleton/SkeletonText.docs.json diff --git a/packages/react/src/drafts/Skeleton/SkeletonText.features.stories.tsx b/packages/react/src/experimental/Skeleton/SkeletonText.features.stories.tsx similarity index 100% rename from packages/react/src/drafts/Skeleton/SkeletonText.features.stories.tsx rename to packages/react/src/experimental/Skeleton/SkeletonText.features.stories.tsx diff --git a/packages/react/src/drafts/Skeleton/SkeletonText.stories.tsx b/packages/react/src/experimental/Skeleton/SkeletonText.stories.tsx similarity index 100% rename from packages/react/src/drafts/Skeleton/SkeletonText.stories.tsx rename to packages/react/src/experimental/Skeleton/SkeletonText.stories.tsx diff --git a/packages/react/src/drafts/Skeleton/SkeletonText.tsx b/packages/react/src/experimental/Skeleton/SkeletonText.tsx similarity index 100% rename from packages/react/src/drafts/Skeleton/SkeletonText.tsx rename to packages/react/src/experimental/Skeleton/SkeletonText.tsx diff --git a/packages/react/src/drafts/Skeleton/index.ts b/packages/react/src/experimental/Skeleton/index.ts similarity index 100% rename from packages/react/src/drafts/Skeleton/index.ts rename to packages/react/src/experimental/Skeleton/index.ts diff --git a/packages/react/src/drafts/TabPanels/TabPanels.docs.json b/packages/react/src/experimental/TabPanels/TabPanels.docs.json similarity index 100% rename from packages/react/src/drafts/TabPanels/TabPanels.docs.json rename to packages/react/src/experimental/TabPanels/TabPanels.docs.json diff --git a/packages/react/src/drafts/TabPanels/TabPanels.features.stories.tsx b/packages/react/src/experimental/TabPanels/TabPanels.features.stories.tsx similarity index 100% rename from packages/react/src/drafts/TabPanels/TabPanels.features.stories.tsx rename to packages/react/src/experimental/TabPanels/TabPanels.features.stories.tsx diff --git a/packages/react/src/drafts/TabPanels/TabPanels.stories.tsx b/packages/react/src/experimental/TabPanels/TabPanels.stories.tsx similarity index 100% rename from packages/react/src/drafts/TabPanels/TabPanels.stories.tsx rename to packages/react/src/experimental/TabPanels/TabPanels.stories.tsx diff --git a/packages/react/src/drafts/TabPanels/TabPanels.tsx b/packages/react/src/experimental/TabPanels/TabPanels.tsx similarity index 100% rename from packages/react/src/drafts/TabPanels/TabPanels.tsx rename to packages/react/src/experimental/TabPanels/TabPanels.tsx diff --git a/packages/react/src/drafts/TabPanels/__tests__/TabPanels.test.tsx b/packages/react/src/experimental/TabPanels/__tests__/TabPanels.test.tsx similarity index 100% rename from packages/react/src/drafts/TabPanels/__tests__/TabPanels.test.tsx rename to packages/react/src/experimental/TabPanels/__tests__/TabPanels.test.tsx diff --git a/packages/react/src/drafts/TabPanels/index.ts b/packages/react/src/experimental/TabPanels/index.ts similarity index 100% rename from packages/react/src/drafts/TabPanels/index.ts rename to packages/react/src/experimental/TabPanels/index.ts diff --git a/packages/react/src/drafts/UnderlinePanels/UnderlinePanels.docs.json b/packages/react/src/experimental/UnderlinePanels/UnderlinePanels.docs.json similarity index 100% rename from packages/react/src/drafts/UnderlinePanels/UnderlinePanels.docs.json rename to packages/react/src/experimental/UnderlinePanels/UnderlinePanels.docs.json diff --git a/packages/react/src/drafts/UnderlinePanels/UnderlinePanels.features.stories.tsx b/packages/react/src/experimental/UnderlinePanels/UnderlinePanels.features.stories.tsx similarity index 100% rename from packages/react/src/drafts/UnderlinePanels/UnderlinePanels.features.stories.tsx rename to packages/react/src/experimental/UnderlinePanels/UnderlinePanels.features.stories.tsx diff --git a/packages/react/src/drafts/UnderlinePanels/UnderlinePanels.stories.tsx b/packages/react/src/experimental/UnderlinePanels/UnderlinePanels.stories.tsx similarity index 100% rename from packages/react/src/drafts/UnderlinePanels/UnderlinePanels.stories.tsx rename to packages/react/src/experimental/UnderlinePanels/UnderlinePanels.stories.tsx diff --git a/packages/react/src/drafts/UnderlinePanels/UnderlinePanels.test.tsx b/packages/react/src/experimental/UnderlinePanels/UnderlinePanels.test.tsx similarity index 100% rename from packages/react/src/drafts/UnderlinePanels/UnderlinePanels.test.tsx rename to packages/react/src/experimental/UnderlinePanels/UnderlinePanels.test.tsx diff --git a/packages/react/src/drafts/UnderlinePanels/UnderlinePanels.tsx b/packages/react/src/experimental/UnderlinePanels/UnderlinePanels.tsx similarity index 100% rename from packages/react/src/drafts/UnderlinePanels/UnderlinePanels.tsx rename to packages/react/src/experimental/UnderlinePanels/UnderlinePanels.tsx diff --git a/packages/react/src/drafts/UnderlinePanels/index.ts b/packages/react/src/experimental/UnderlinePanels/index.ts similarity index 100% rename from packages/react/src/drafts/UnderlinePanels/index.ts rename to packages/react/src/experimental/UnderlinePanels/index.ts diff --git a/packages/react/src/drafts/hooks/index.ts b/packages/react/src/experimental/hooks/index.ts similarity index 100% rename from packages/react/src/drafts/hooks/index.ts rename to packages/react/src/experimental/hooks/index.ts diff --git a/packages/react/src/drafts/hooks/useCombobox.ts b/packages/react/src/experimental/hooks/useCombobox.ts similarity index 100% rename from packages/react/src/drafts/hooks/useCombobox.ts rename to packages/react/src/experimental/hooks/useCombobox.ts diff --git a/packages/react/src/drafts/hooks/useDynamicTextareaHeight.ts b/packages/react/src/experimental/hooks/useDynamicTextareaHeight.ts similarity index 100% rename from packages/react/src/drafts/hooks/useDynamicTextareaHeight.ts rename to packages/react/src/experimental/hooks/useDynamicTextareaHeight.ts diff --git a/packages/react/src/drafts/hooks/useIgnoreKeyboardActionsWhileComposing.test.tsx b/packages/react/src/experimental/hooks/useIgnoreKeyboardActionsWhileComposing.test.tsx similarity index 100% rename from packages/react/src/drafts/hooks/useIgnoreKeyboardActionsWhileComposing.test.tsx rename to packages/react/src/experimental/hooks/useIgnoreKeyboardActionsWhileComposing.test.tsx diff --git a/packages/react/src/drafts/hooks/useIgnoreKeyboardActionsWhileComposing.ts b/packages/react/src/experimental/hooks/useIgnoreKeyboardActionsWhileComposing.ts similarity index 100% rename from packages/react/src/drafts/hooks/useIgnoreKeyboardActionsWhileComposing.ts rename to packages/react/src/experimental/hooks/useIgnoreKeyboardActionsWhileComposing.ts diff --git a/packages/react/src/drafts/hooks/useSafeAsyncCallback.ts b/packages/react/src/experimental/hooks/useSafeAsyncCallback.ts similarity index 100% rename from packages/react/src/drafts/hooks/useSafeAsyncCallback.ts rename to packages/react/src/experimental/hooks/useSafeAsyncCallback.ts diff --git a/packages/react/src/drafts/hooks/useSyntheticChange.ts b/packages/react/src/experimental/hooks/useSyntheticChange.ts similarity index 100% rename from packages/react/src/drafts/hooks/useSyntheticChange.ts rename to packages/react/src/experimental/hooks/useSyntheticChange.ts diff --git a/packages/react/src/drafts/hooks/useUnifiedFileSelect.ts b/packages/react/src/experimental/hooks/useUnifiedFileSelect.ts similarity index 100% rename from packages/react/src/drafts/hooks/useUnifiedFileSelect.ts rename to packages/react/src/experimental/hooks/useUnifiedFileSelect.ts diff --git a/packages/react/src/experimental/index.ts b/packages/react/src/experimental/index.ts index e4cd5fbb900..13452c8c361 100644 --- a/packages/react/src/experimental/index.ts +++ b/packages/react/src/experimental/index.ts @@ -1,5 +1,89 @@ +/** + * This is the place where we keep components that are not part of the public + * api yet (not in main bundle). We don't recommend using it in production. + * + * But, they are published on npm and you can import them for experimentation/feedback. + * example: import {ActionList} from '@primer/react/drafts + */ + 'use client' -export * from '../drafts' +export {Blankslate} from '../Blankslate' +export type {BlankslateProps} from '../Blankslate' + +export {Banner} from '../Banner' +export type {BannerProps} from '../Banner' + +export {DataTable, Table, createColumnHelper} from '../DataTable' +export type { + DataTableProps, + TableProps, + TableHeadProps, + TableBodyProps, + TableRowProps, + TableHeaderProps, + TableCellProps, + TableContainerProps, + TableTitleProps, + TableSubtitleProps, + TableActionsProps, + Column, +} from '../DataTable' + +export * from '../Dialog/Dialog' + +export {default as InlineAutocomplete} from './InlineAutocomplete' +export type { + InlineAutocompleteProps, + ShowSuggestionsEvent, + Suggestion, + Suggestions, + Trigger, +} from './InlineAutocomplete' + +export {InlineMessage} from '../InlineMessage' +export type {InlineMessageProps} from '../InlineMessage' + +export {default as MarkdownViewer} from './MarkdownViewer' +export type {MarkdownViewerProps, InteractiveMarkdownViewerProps} from './MarkdownViewer' + +export {default as MarkdownEditor} from './MarkdownEditor' +export * from './MarkdownEditor' + +export * from '../PageHeader' + +export * from '../Hidden' + +export * from './hooks' + +export {NavList} from '../NavList' +export type { + NavListProps, + NavListItemProps, + NavListSubNavProps, + NavListGroupProps, + NavListLeadingVisualProps, + NavListTrailingVisualProps, + NavListDividerProps, +} from '../NavList' +export * from './SelectPanel2' +export {default as TabPanels} from './TabPanels' +export type {TabPanelsProps, TabPanelsTabProps, TabPanelsPanelProps} from './TabPanels' +export * from '../TooltipV2' +export * from '../ActionBar' + +export {ScrollableRegion} from '../ScrollableRegion' +export type {ScrollableRegionProps} from '../ScrollableRegion' + +export {Stack} from '../Stack' +export type {StackProps, StackItemProps} from '../Stack' + +export {Announce, AriaStatus, AriaAlert} from '../live-region' +export type {AnnounceProps, AriaStatusProps, AriaAlertProps} from '../live-region' + +export {UnderlinePanels} from './UnderlinePanels' +export type {UnderlinePanelsProps, UnderlinePanelsTabProps, UnderlinePanelsPanelProps} from './UnderlinePanels' + +export {SkeletonBox, SkeletonText, SkeletonAvatar} from './Skeleton' export {FeatureFlags} from '../FeatureFlags' export type {FeatureFlagsProps} from '../FeatureFlags' diff --git a/packages/react/src/drafts/utils/character-coordinates.ts b/packages/react/src/experimental/utils/character-coordinates.ts similarity index 100% rename from packages/react/src/drafts/utils/character-coordinates.ts rename to packages/react/src/experimental/utils/character-coordinates.ts From 3846a939963bd6efd7645211f257ae1739b08fa6 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Fri, 26 Jul 2024 14:11:11 -0500 Subject: [PATCH 02/12] chore: add changeset --- .changeset/hot-baboons-allow.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/hot-baboons-allow.md diff --git a/.changeset/hot-baboons-allow.md b/.changeset/hot-baboons-allow.md new file mode 100644 index 00000000000..391fdbf0f5b --- /dev/null +++ b/.changeset/hot-baboons-allow.md @@ -0,0 +1,5 @@ +--- +'@primer/react': major +--- + +Remove the drafts entry point. Use experimental instead From ee788b69589a9a50c0d1f84ac904f545d67b5b14 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Mon, 29 Jul 2024 10:14:36 -0500 Subject: [PATCH 03/12] refactor: rename drafts to experimental --- contributor-docs/deprecating-components.md | 2 +- docs/content/NavList.mdx | 20 ++++++------- docs/content/SplitPageLayout.mdx | 26 ++++++++--------- docs/content/TreeView.mdx | 8 +++--- docs/content/UnderlineNav.mdx | 6 ++-- docs/content/drafts/Dialog.mdx | 2 +- docs/content/drafts/Hidden.mdx | 4 +-- docs/content/drafts/PageHeader.mdx | 28 +++++++++---------- docs/content/drafts/TabPanels.mdx | 2 +- .../react/src/ActionBar/ActionBar.stories.tsx | 2 +- .../src/Banner/Banner.examples.stories.tsx | 2 +- .../src/Banner/Banner.features.stories.tsx | 2 +- packages/react/src/Banner/Banner.stories.tsx | 2 +- .../Blankslate.features.stories.tsx | 2 +- .../src/Blankslate/Blankslate.stories.tsx | 2 +- .../DataTable/DataTable.features.stories.tsx | 2 +- .../react/src/DataTable/DataTable.stories.tsx | 2 +- .../src/Hidden/Hidden.examples.stories.tsx | 2 +- .../src/Hidden/Hidden.features.stories.tsx | 2 +- packages/react/src/Hidden/Hidden.stories.tsx | 2 +- .../InlineMessage.features.stories.tsx | 2 +- .../InlineMessage/InlineMessage.stories.tsx | 2 +- .../ScrollableRegion.stories.tsx | 2 +- .../CSSComponent/Component.stories.tsx | 2 +- .../SelectPanel.examples.stories.tsx | 2 +- .../SelectPanel.features.stories.tsx | 2 +- .../SelectPanel.playground.stories.tsx | 2 +- .../SelectPanel2/SelectPanel.stories.tsx | 2 +- .../Skeleton/Skeleton.examples.stories.tsx | 2 +- .../SkeletonAvatar.features.stories.tsx | 2 +- .../Skeleton/SkeletonAvatar.stories.tsx | 2 +- .../Skeleton/SkeletonBox.features.stories.tsx | 2 +- .../Skeleton/SkeletonBox.stories.tsx | 2 +- .../SkeletonText.features.stories.tsx | 2 +- .../Skeleton/SkeletonText.stories.tsx | 2 +- .../TabPanels/TabPanels.features.stories.tsx | 2 +- .../TabPanels/TabPanels.stories.tsx | 2 +- .../UnderlinePanels.features.stories.tsx | 2 +- .../UnderlinePanels.stories.tsx | 2 +- .../live-region/Announce.features.stories.tsx | 2 +- .../src/live-region/Announce.stories.tsx | 2 +- .../AriaAlert.features.stories.tsx | 2 +- .../src/live-region/AriaAlert.stories.tsx | 2 +- .../AriaStatus.features.stories.tsx | 2 +- .../src/live-region/AriaStatus.stories.tsx | 2 +- 45 files changed, 85 insertions(+), 85 deletions(-) diff --git a/contributor-docs/deprecating-components.md b/contributor-docs/deprecating-components.md index c09bd5bf898..6d2f25eb568 100644 --- a/contributor-docs/deprecating-components.md +++ b/contributor-docs/deprecating-components.md @@ -62,7 +62,7 @@ Note: Component v1 is referred to the component that is going to be moved to the - [ ] Make sure to update the import code block. I.e. `import { ActionList } from "@primer/react/deprecated"`. - [ ] Move the new components docs from draft folder to the main docs folder `docs/content/` and update the title by removing `v2`, status as well as the storybook and the source code link. - - [ ] Make sure to update `jsx live drafts` -> `jsx live` + - [ ] Make sure to update `jsx live experimental` -> `jsx live` - [ ] Make sure to update the import code block. I.e. `import { ActionList } from "@primer/react"`. - [ ] Update the navigation on `docs/src/@primer/gatsby-theme-doctocat/nav.yml` accordingly. diff --git a/docs/content/NavList.mdx b/docs/content/NavList.mdx index b4c23ccd828..874a5506f1d 100644 --- a/docs/content/NavList.mdx +++ b/docs/content/NavList.mdx @@ -20,7 +20,7 @@ import {NavList} from '@primer/react' ### Simple -```jsx live drafts +```jsx live experimental Home @@ -32,7 +32,7 @@ import {NavList} from '@primer/react' ### With leading icons -```jsx live drafts +```jsx live experimental @@ -57,7 +57,7 @@ import {NavList} from '@primer/react' ### With other leading visuals -```jsx live drafts +```jsx live experimental @@ -82,7 +82,7 @@ import {NavList} from '@primer/react' ### With trailing visuals -```jsx live drafts +```jsx live experimental Inbox @@ -95,7 +95,7 @@ import {NavList} from '@primer/react' ### With a heading -```jsx live drafts +```jsx live experimental <> Workflows @@ -113,7 +113,7 @@ import {NavList} from '@primer/react' ### With aria-label -```jsx live drafts +```jsx live experimental Overview @@ -125,7 +125,7 @@ import {NavList} from '@primer/react' ### With groups -```jsx live drafts +```jsx live experimental @@ -142,7 +142,7 @@ import {NavList} from '@primer/react' ### With sub-items -```jsx live drafts +```jsx live experimental Branches Tags @@ -166,7 +166,7 @@ If a `NavList.Item` contains a `NavList.SubNav`, the `NavList.Item` will render ### With nested sub-items -```jsx live drafts +```jsx live experimental Branches Tags @@ -196,7 +196,7 @@ We only allow for up to 4 levels of nested subnavs. If more than 4 levels is req ### With a divider -```jsx live drafts +```jsx live experimental Dashboard diff --git a/docs/content/SplitPageLayout.mdx b/docs/content/SplitPageLayout.mdx index 2dcf3ab46e0..eef677bb16d 100644 --- a/docs/content/SplitPageLayout.mdx +++ b/docs/content/SplitPageLayout.mdx @@ -27,7 +27,7 @@ If you need a more flexible layout component, consider using the [PageLayout](/P ### Minimal -```jsx live drafts +```jsx live experimental @@ -48,7 +48,7 @@ If you need a more flexible layout component, consider using the [PageLayout](/P ### With overflowing pane content -```jsx live drafts +```jsx live experimental @@ -77,7 +77,7 @@ If you need a more flexible layout component, consider using the [PageLayout](/P ### With pane hidden on narrow viewports -```jsx live drafts +```jsx live experimental @@ -98,7 +98,7 @@ If you need a more flexible layout component, consider using the [PageLayout](/P ### With content hidden on narrow viewports -```jsx live drafts +```jsx live experimental @@ -119,7 +119,7 @@ If you need a more flexible layout component, consider using the [PageLayout](/P ### With resizable pane -```jsx live drafts +```jsx live experimental @@ -140,7 +140,7 @@ If you need a more flexible layout component, consider using the [PageLayout](/P ### Without dividers -```jsx live drafts +```jsx live experimental @@ -161,7 +161,7 @@ If you need a more flexible layout component, consider using the [PageLayout](/P ### With pane on right -```jsx live drafts +```jsx live experimental @@ -182,7 +182,7 @@ If you need a more flexible layout component, consider using the [PageLayout](/P ### With condensed padding -```jsx live drafts +```jsx live experimental @@ -203,7 +203,7 @@ If you need a more flexible layout component, consider using the [PageLayout](/P ### Without padding -```jsx live drafts +```jsx live experimental @@ -224,7 +224,7 @@ If you need a more flexible layout component, consider using the [PageLayout](/P ### Without header or footer -```jsx live drafts +```jsx live experimental @@ -239,7 +239,7 @@ If you need a more flexible layout component, consider using the [PageLayout](/P ### With heading -```jsx live drafts +```jsx live experimental @@ -255,7 +255,7 @@ If you need a more flexible layout component, consider using the [PageLayout](/P ### With non-sticky pane -```jsx live drafts +```jsx live experimental @@ -276,7 +276,7 @@ If you need a more flexible layout component, consider using the [PageLayout](/P ### With a custom sticky header -```jsx live drafts +```jsx live experimental