diff --git a/.changeset/sharp-papayas-destroy.md b/.changeset/sharp-papayas-destroy.md new file mode 100644 index 00000000000..0478de96629 --- /dev/null +++ b/.changeset/sharp-papayas-destroy.md @@ -0,0 +1,5 @@ +--- +'@primer/react': major +--- + +Update CounterLabel component to no longer support sx diff --git a/packages/react/src/CounterLabel/CounterLabel.docs.json b/packages/react/src/CounterLabel/CounterLabel.docs.json index 9bcb9cfd08a..74f7e60a7fe 100644 --- a/packages/react/src/CounterLabel/CounterLabel.docs.json +++ b/packages/react/src/CounterLabel/CounterLabel.docs.json @@ -27,11 +27,6 @@ "type": "string", "description": "Class name(s) for custom styling.", "defaultValue": "" - }, - { - "name": "sx", - "type": "BetterSystemStyleObject", - "deprecated": true } ], "subcomponents": [] diff --git a/packages/react/src/CounterLabel/CounterLabel.tsx b/packages/react/src/CounterLabel/CounterLabel.tsx index fd47aa3c0f8..2f5101ace46 100644 --- a/packages/react/src/CounterLabel/CounterLabel.tsx +++ b/packages/react/src/CounterLabel/CounterLabel.tsx @@ -2,16 +2,14 @@ import {clsx} from 'clsx' import type {HTMLAttributes} from 'react' import type React from 'react' import {forwardRef} from 'react' -import type {SxProp} from '../sx' import {VisuallyHidden} from '../VisuallyHidden' import classes from './CounterLabel.module.css' -import {BoxWithFallback} from '../internal/components/BoxWithFallback' export type CounterLabelProps = React.PropsWithChildren< HTMLAttributes & { scheme?: 'primary' | 'secondary' className?: string - } & SxProp + } > const CounterLabel = forwardRef( @@ -26,9 +24,9 @@ const CounterLabel = forwardRef( return ( <> - + {children} - + {label} ) diff --git a/packages/styled-react/src/index.tsx b/packages/styled-react/src/index.tsx index ad5b6b0e7e0..d68fb6d6ec4 100644 --- a/packages/styled-react/src/index.tsx +++ b/packages/styled-react/src/index.tsx @@ -5,6 +5,8 @@ import { type SxProp, Checkbox as PrimerCheckbox, type CheckboxProps as PrimerCheckboxProps, + CounterLabel as PrimerCounterLabel, + type CounterLabelProps as PrimerCounterLabelProps, StateLabel as PrimerStateLabel, type StateLabelProps as PrimerStateLabelProps, SubNav as PrimerSubNav, @@ -71,6 +73,12 @@ const Checkbox = forwardRef(function Checkbox(p return }) +type CounterLabelProps = PrimerCounterLabelProps & SxProp + +const CounterLabel = forwardRef(function CounterLabel(props, ref) { + return +}) + type StateLabelProps = PrimerStateLabelProps & SxProp const StateLabel = forwardRef(function StateLabel(props, ref) { @@ -99,7 +107,7 @@ const ToggleSwitch = forwardRef(function T return }) -export {LinkButton, type LinkButtonProps, Checkbox, SegmentedControl, StateLabel, SubNav, ToggleSwitch} +export {LinkButton, type LinkButtonProps, Checkbox, CounterLabel, SegmentedControl, StateLabel, SubNav, ToggleSwitch} export { ActionList, @@ -110,7 +118,6 @@ export { Button, CheckboxGroup, CircleBadge, - CounterLabel, Details, Dialog, Flash,