Skip to content
Draft
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/export-get-responsive-attributes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': minor
---

Experimental: Export `getResponsiveAttributes` helper for bridging responsive values to `data-*` attributes.
2 changes: 1 addition & 1 deletion packages/react/src/PageHeader/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Heading from '../Heading'
import {ArrowLeftIcon} from '@primer/octicons-react'
import type {LinkProps as BaseLinkProps} from '../Link'
import Link from '../Link'
import {getResponsiveAttributes} from '../internal/utils/getResponsiveAttributes'
import {getResponsiveAttributes} from '../utils/getResponsiveAttributes'

import type {ForwardRefComponent as PolymorphicForwardRefComponent} from '../utils/polymorphic'
import {areAllValuesTheSame, haveRegularAndWideSameValue} from '../utils/getBreakpointDeclarations'
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/PageLayout/PageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {isResponsiveValue} from '../hooks/useResponsiveValue'
import {useSlots} from '../hooks/useSlots'
import {useOverflow} from '../hooks/useOverflow'
import {warning} from '../utils/warning'
import {getResponsiveAttributes} from '../internal/utils/getResponsiveAttributes'
import {getResponsiveAttributes} from '../utils/getResponsiveAttributes'

import classes from './PageLayout.module.css'
import type {FCWithSlotMarker, WithSlotMarker} from '../utils/types'
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/SegmentedControl/SegmentedControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SegmentedControlIconButton from './SegmentedControlIconButton'
import {ActionList} from '../ActionList'
import {ActionMenu} from '../ActionMenu'
import type {ResponsiveValue} from '../hooks/useResponsiveValue'
import {getResponsiveAttributes} from '../internal/utils/getResponsiveAttributes'
import {getResponsiveAttributes} from '../utils/getResponsiveAttributes'
import type {WidthOnlyViewportRangeKeys} from '../utils/types/ViewportRangeKeys'
import {isElement} from 'react-is'
import classes from './SegmentedControl.module.css'
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/Stack/Stack.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type React from 'react'
import {forwardRef, type ElementType} from 'react'
import type {ResponsiveValue} from '../hooks/useResponsiveValue'
import {getResponsiveAttributes} from '../internal/utils/getResponsiveAttributes'
import {getResponsiveAttributes} from '../utils/getResponsiveAttributes'
import classes from './Stack.module.css'
import {clsx} from 'clsx'
import type {ForwardRefComponent as PolymorphicForwardRefComponent} from '../utils/polymorphic'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ exports[`@primer/react/experimental > should not update exports without a semver
"FilteredActionListLoadingTypes",
"type FilteredActionListProps",
"getAccessibleKeybindingHintString",
"getResponsiveAttributes",
"Hidden",
"type HiddenProps",
"InlineMessage",
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/experimental/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export type {

export * from '../Hidden'

export {getResponsiveAttributes} from '../utils/getResponsiveAttributes'

export * from './hooks'

export {NavList} from '../NavList'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {ResponsiveValue} from '../../hooks/useResponsiveValue'
import type {ResponsiveValue} from '../hooks/useResponsiveValue'

/**
* Transform the given property and values in to corresponding data attributes
Expand Down
Loading