feat(RelativeTime): remove support for sx prop#6827
Conversation
🦋 Changeset detectedLatest commit: 593bc3a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
size-limit report 📦
|
There was a problem hiding this comment.
Pull Request Overview
This PR removes support for the sx prop from the RelativeTime component as part of a migration strategy to eliminate styled-components dependencies. The changes include removing sx prop type definitions, updating component creation utilities, and adjusting Storybook configurations.
- Remove
sxprop support fromRelativeTimecomponent - Refactor component creation utilities to eliminate styled-components dependency
- Update Storybook controls to exclude sx-related properties
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/styled-react/src/index.tsx | Adds RelativeTime wrapper with sx support to maintain backward compatibility in styled-react package |
| packages/react/src/utils/create-component.ts | Removes styled-components and sx dependencies from component creation utility |
| packages/react/src/RelativeTime/RelativeTime.stories.tsx | Updates Storybook controls to exclude sx prop |
| packages/react/src/RelativeTime/RelativeTime.features.stories.tsx | Updates Storybook controls to exclude sx prop |
| packages/react/src/RelativeTime/RelativeTime.docs.json | Removes sx prop from component documentation |
| .changeset/short-cloths-deny.md | Documents the breaking change for version release |
…rt-for-sx-from-relative-time
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/2639 |
|
🟢 ci completed with status |
|
👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks! |
|
👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks! |
|
👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks! |
…nts to Private/ namespace
Add packages/react/src/Timeline/internal/timelineStoryHelpers.{tsx,module.css}
with six story-only helpers (VariantSection, RealisticTimeline, Examples,
BoldLink, InlineAvatar, MutedTime) for the Timeline event-story surfaces to
share. Never exported from the package index (stories don't ship), so no public
API surface. BoldLink/InlineAvatar/MutedTime shim live-GitHub styling Primer
doesn't express yet (tracked in github/primer#6826/#6827/#6828).
Retitle the Comments stories to Private/Components/Timeline/Events/Comments and
consume the shared VariantSection + RealisticTimeline. Pure refactor — Storybook
rendering unchanged.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Swap the Code Scanning story's local scaffolding for the shared internal helpers in ./internal/timelineStoryHelpers: VariantSection (captioned section), Examples / RealisticTimeline (wrappers), BoldLink (#6826), InlineAvatar (#6827), and MutedTime (#6828). EventFixed has no in-text links, so it uses the no-links RealisticTimeline wrapper; the link-bearing groups keep Examples. Delete the now-duplicated local classes (.Variant, .VariantLabel, .RealisticTimeline, .LinkWithBoldStyle, .InlineAvatar, .Timestamp). Pure refactor — no rendered output change; the workflow sub-row icon label and tool-version Label are untouched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nts to Private/ namespace
Add packages/react/src/Timeline/internal/timelineStoryHelpers.{tsx,module.css}
with six story-only helpers (VariantSection, RealisticTimeline, Examples,
BoldLink, InlineAvatar, MutedTime) for the Timeline event-story surfaces to
share. Never exported from the package index (stories don't ship), so no public
API surface. BoldLink/InlineAvatar/MutedTime shim live-GitHub styling Primer
doesn't express yet (tracked in github/primer#6826/#6827/#6828).
Retitle the Comments stories to Private/Components/Timeline/Events/Comments and
consume the shared VariantSection + RealisticTimeline. Pure refactor — Storybook
rendering unchanged.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Swap the Code Scanning story's local scaffolding for the shared internal helpers in ./internal/timelineStoryHelpers: VariantSection (captioned section), Examples / RealisticTimeline (wrappers), BoldLink (#6826), InlineAvatar (#6827), and MutedTime (#6828). EventFixed has no in-text links, so it uses the no-links RealisticTimeline wrapper; the link-bearing groups keep Examples. Delete the now-duplicated local classes (.Variant, .VariantLabel, .RealisticTimeline, .LinkWithBoldStyle, .InlineAvatar, .Timestamp). Pure refactor — no rendered output change; the workflow sub-row icon label and tool-version Label are untouched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Swap the Code Scanning story's local scaffolding for the shared internal helpers in ./internal/timelineStoryHelpers: VariantSection (captioned section), Examples / RealisticTimeline (wrappers), BoldLink (#6826), InlineAvatar (#6827), and MutedTime (#6828). EventFixed has no in-text links, so it uses the no-links RealisticTimeline wrapper; the link-bearing groups keep Examples. Delete the now-duplicated local classes (.Variant, .VariantLabel, .RealisticTimeline, .LinkWithBoldStyle, .InlineAvatar, .Timestamp). Pure refactor — no rendered output change; the workflow sub-row icon label and tool-version Label are untouched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Swap the Code Scanning story's local scaffolding for the shared internal helpers in ./internal/timelineStoryHelpers: VariantSection (captioned section), Examples / RealisticTimeline (wrappers), BoldLink (#6826), InlineAvatar (#6827), and MutedTime (#6828). EventFixed has no in-text links, so it uses the no-links RealisticTimeline wrapper; the link-bearing groups keep Examples. Delete the now-duplicated local classes (.Variant, .VariantLabel, .RealisticTimeline, .LinkWithBoldStyle, .InlineAvatar, .Timestamp). Pure refactor — no rendered output change; the workflow sub-row icon label and tool-version Label are untouched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closes #6773
Changelog
New
Changed
Removed
sxfromRelativeTimeRollout strategy
This component has no
sxusage in github-ui and can be safely migrated