-
Notifications
You must be signed in to change notification settings - Fork 674
Remove sx prop support from the Timeline component
#6692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
4c601a5
5e333c2
6e29e68
0874751
97d2569
426d471
0571211
64fa0a9
687ed98
5cce2d0
eee3257
a702941
40a51a3
544afa7
aca51bd
5dee4cc
6363ead
87a4898
9396b07
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@primer/react': major | ||
| --- | ||
|
|
||
| Remove sx Props and BoxWithFallBack from Timeline component. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| .BadgeWithDoneBackground { | ||
| background-color: var(--bgColor-done-emphasis); | ||
| } | ||
|
|
||
| .LinkWithBoldStyle { | ||
| font-weight: var(--base-text-weight-semibold); | ||
| color: var(--fgColor-default); | ||
| margin-right: var(--base-size-4); | ||
| } | ||
|
|
||
| .LinkWithBoldStyle:hover { | ||
| color: var(--fgColor-accent); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,12 @@ import { | |
| SubNav as PrimerSubNav, | ||
| type SubNavProps as PrimerSubNavProps, | ||
| type SubNavLinkProps as PrimerSubNavLinkProps, | ||
| Timeline as PrimerTimeline, | ||
| type TimelineProps as PrimerTimelineProps, | ||
| type TimelineItemProps as PrimerTimelineItemProps, | ||
| type TimelineBadgeProps as PrimerTimelineBadgeProps, | ||
| type TimelineBodyProps as PrimerTimelineBodyProps, | ||
| type TimelineBreakProps as PrimerTimelineBreakProps, | ||
| ToggleSwitch as PrimerToggleSwitch, | ||
| type ToggleSwitchProps as PrimerToggleSwitchProps, | ||
| type SegmentedControlProps as PrimerSegmentedControlProps, | ||
|
|
@@ -84,13 +90,46 @@ const SubNav = Object.assign(SubNavImpl, { | |
| Link: SubNavLink, | ||
| }) | ||
|
|
||
| type TimelineProps = PrimerTimelineProps & SxProp | ||
| type TimelineItemProps = PrimerTimelineItemProps & SxProp | ||
| type TimelineBadgeProps = PrimerTimelineBadgeProps & SxProp | ||
| type TimelineBodyProps = PrimerTimelineBodyProps & SxProp | ||
| type TimelineBreakProps = PrimerTimelineBreakProps & SxProp | ||
|
|
||
| const TimelineImpl = forwardRef<HTMLDivElement, TimelineProps>(function Timeline(props, ref) { | ||
| return <Box as={PrimerTimeline} ref={ref} {...props} /> | ||
| }) | ||
|
|
||
| const TimelineItem = forwardRef<HTMLDivElement, TimelineItemProps>(function TimelineItem(props, ref) { | ||
| return <Box as={PrimerTimeline.Item} ref={ref} {...props} /> | ||
| }) | ||
|
|
||
| function TimelineBadge(props: TimelineBadgeProps) { | ||
| return <Box as={PrimerTimeline.Badge} {...props} /> | ||
| } | ||
|
|
||
| const TimelineBody = forwardRef<HTMLDivElement, TimelineBodyProps>(function TimelineBody(props, ref) { | ||
| return <Box as={PrimerTimeline.Body} ref={ref} {...props} /> | ||
| }) | ||
|
|
||
| const TimelineBreak = forwardRef<HTMLDivElement, TimelineBreakProps>(function TimelineBreak(props, ref) { | ||
| return <Box as={PrimerTimeline.Break} ref={ref} {...props} /> | ||
| }) | ||
|
|
||
| const Timeline = Object.assign(TimelineImpl, { | ||
| Item: TimelineItem, | ||
| Badge: TimelineBadge, | ||
| Body: TimelineBody, | ||
| Break: TimelineBreak, | ||
| }) | ||
|
|
||
| type ToggleSwitchProps = PrimerToggleSwitchProps & Omit<StyledProps, keyof PrimerToggleSwitchProps> | ||
|
|
||
| const ToggleSwitch = forwardRef<HTMLButtonElement, ToggleSwitchProps>(function ToggleSwitch(props, ref) { | ||
| return <Box as={PrimerToggleSwitch} ref={ref} {...props} /> | ||
| }) | ||
|
|
||
| export {SegmentedControl, StateLabel, SubNav, ToggleSwitch} | ||
| export {SegmentedControl, StateLabel, SubNav, Timeline, ToggleSwitch} | ||
|
||
|
|
||
| export { | ||
| ActionList, | ||
|
|
@@ -125,7 +164,6 @@ export { | |
| Text, | ||
| Textarea, | ||
| TextInput, | ||
| Timeline, | ||
| Token, | ||
| Tooltip, | ||
| Truncate, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Replacing BoxWithFallback with div removes the sx prop functionality, but the data-testid and other props are still being spread. Consider adding a comment explaining that sx props are no longer supported to help developers understand the breaking change.