Skip to content
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/thin-oranges-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

v38: Move pointerbox to deprecated still maintaining the main export
Copy link
Member

Choose a reason for hiding this comment

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

is there a reason we want to maintain the main export or can we move to deprecated under v38 major?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this was basically reverted because we have some main export usages

10 changes: 3 additions & 7 deletions packages/react/src/PointerBox/PointerBox.docs.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
{
"id": "pointer_box",
"name": "PointerBox",
"status": "alpha",
"status": "deprecated",
"a11yReviewed": "2025-01-08",
"stories": [
{
"id": "components-pointerbox--default"
}
],
"importPath": "@primer/react",
"stories": [],
"importPath": "@primer/react/deprecated",
"props": [
{
"name": "bg",
Expand Down
9 changes: 8 additions & 1 deletion packages/react/src/PointerBox/PointerBox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ import PointerBox from './PointerBox'
import type {ComponentProps} from '../utils/types'

export default {
title: 'Components/PointerBox',
title: 'Deprecated/Components/PointerBox',
parameters: {
docs: {
description: {
component: 'PointerBox is deprecated and will be removed in a future major release. Consider using Overlay.',
},
},
},
} as Meta<typeof PointerBox>

export const Default = () => <PointerBox>Pointer box content</PointerBox>
Expand Down
3 changes: 2 additions & 1 deletion packages/react/src/PointerBox/PointerBox.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {describe, expect, it} from 'vitest'
import {render} from '@testing-library/react'
import {PointerBox, ThemeProvider} from '..'
import {ThemeProvider} from '..'
import PointerBox from './PointerBox'
import theme from '../theme'

describe('PointerBox', () => {
Expand Down
8 changes: 8 additions & 0 deletions packages/react/src/PointerBox/PointerBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ type MutatedSxProps = {
}
} & SxProp

/**
* @deprecated PointerBox is deprecated and will be removed in a future major release.
* Consider using Overlay or Position + Box with a caret instead.
*/
export type PointerBoxProps = {
caret?: CaretProps['location']
bg?: CaretProps['bg']
Expand All @@ -24,6 +28,10 @@ export type PointerBoxProps = {
} & BoxProps &
MutatedSxProps

/**
* @deprecated PointerBox is deprecated and will be removed in a future major release.
* Consider using Overlay or Position + Box with a caret instead.
*/
function PointerBox(props: PointerBoxProps) {
// don't destructure these, just grab them
const themeContext = React.useContext(ThemeContext)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ exports[`@primer/react/deprecated > should not update exports without a semver c
"type OcticonProps",
"Pagehead",
"type PageheadProps",
"PointerBox",
"type PointerBoxProps",
"TabNav",
"type TabNavLinkProps",
"type TabNavProps",
Expand Down
4 changes: 4 additions & 0 deletions packages/react/src/deprecated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ export type {TabNavProps, TabNavLinkProps} from '../TabNav'
export {default as Tooltip} from '../Tooltip/Tooltip'
export type {TooltipProps} from '../Tooltip/Tooltip'
// end of v37.0.0

// Deprecated in v38.0.0
export {default as PointerBox} from '../PointerBox'
export type {PointerBoxProps} from '../PointerBox'
Loading