Conversation
Add Vitest, jsdom, and Testing Library coverage for the shared button behavior so network-specific fixes can land with regression tests and CI coverage.
Issue #533 reported that disabled share buttons only looked disabled while still allowing clicks. Set the native disabled attribute and bail out before link generation so the shared button abstraction matches button semantics.
Cover the full share-button matrix, JSONP-backed share counts, package exports, and shared button edge cases.\n\nAlso enable coverage reporting across the full src surface and ignore generated coverage artifacts.
Add a post-build smoke test that imports dist/index.js, requires dist/index.cjs, and verifies the published entry files and public export surface.\n\nRun the new test in CI between build and lint-package so publint and Are the Types Wrong continue validating the package.json exports map alongside the real build outputs.
Share counts are legacy, best-effort integrations whose upstream endpoints can disappear without notice.\n\nMark every public share count export as deprecated in the generated types, document the deprecation in the README, and note that the feature will be removed in v6.
Convert every icon module into a real React component backed by a shared internal IconBase instead of the createIcon runtime factory.\n\nPreserve the icon prop API and rendered output, move the shared icon logic out of hocs, and replace the factory-specific test with IconBase coverage.
…ents Convert each network share button into a plain component over ShareButton while preserving existing URL generation, popup sizing, and special behavior such as Email navigation and Tumblr option remapping. Replace the factory-level coverage with direct component tests for prop stripping and ref forwarding, then remove the now-unused createShareButton helper.
Clarify the v5 share-button surface without breaking compatibility by introducing a shared internal ShareButtonProps alias, documenting why htmlTitle exists alongside network-specific title props, and marking ThreadsShareButton's ignored hashtags, related, and via props as deprecated no-ops for planned v6 removal. Expand tests to cover htmlTitle/title coexistence and the continued no-op behavior of the legacy Threads props, and include the minor changeset in the same commit.
Update the badge background colors for the affected v5 share icons to match current brand colors without changing the legacy glyph paths. The SVG/glyph normalization work was intentionally deferred for a later v6-focused pass because some official logos now carry their own enclosing shapes.
Replace the oversized share button props table with per-button reference sections and link the supported networks from Features to their API docs. This keeps the README easier to scan while preserving shared prop guidance and only calling out extra required props where a button actually needs them.
Remove deprecated share count components from the demo so the example only shows supported share button usage. Also drop the unused demo share-count styling and update the demo page title to stop advertising share counts.
Render reset share buttons as inline-flex so icon-only share buttons do not include extra bottom space in the button bounding box from the inline baseline.
Infer the reset button border radius from bundled icon props so native focus outlines follow round and rounded icon shapes, and add a 2px outline offset to separate the ring from the icon edge.
Drop the stale README link to the old Codesandbox example and leave the maintained deployed demo and local demo instructions as the supported entry points.
Include test files in the main TypeScript project so editor diagnostics match the Vitest setup and jest-dom matcher augmentations are visible in test files. Split build-only compiler settings into a dedicated tsconfig for declaration generation, add direct Node types for Node-based tests, and tighten existing test typings that were previously hidden by the narrower typecheck scope.
Default share buttons to type=button so they do not accidentally submit enclosing forms. Also add fallback accessible names for unlabeled icon-only share buttons while keeping explicit aria-label and aria-labelledby props authoritative.
Label every icon-only button in the demo and add a regression test that asserts each rendered share button has an accessible name. Also teach jsx-a11y to treat the exported share button components as buttons and ignore generated assets so linting stays focused on source files.
Clarify that icon-only share buttons need an accessible name, that htmlTitle is only a tooltip, and that standalone icons should either be decorative with aria-hidden or carry their own accessible name.
Remove the jsx-a11y custom component registry for share buttons to avoid ongoing maintenance when exports change. Keep the generated-asset ignores and rely on the demo accessibility regression test for repo-owned example coverage.
Add XShareButton as the canonical X sharing component while keeping TwitterShareButton as a deprecated compatibility alias. Include a minor changeset because this adds a new public API export and marks the legacy export as deprecated in the shipped types.
Update X sharing examples and API docs to point users at XShareButton, while noting that TwitterShareButton remains available as a deprecated alias for backwards compatibility.
Reorder the demo share buttons to follow a rough social media popularity sequence so the example better matches how consumers are likely to scan the list. Refresh example.png in the same commit to keep the repository preview aligned with the updated demo.
🦋 Changeset detectedLatest commit: 5c06993 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Write the built demo to demo/dist instead of demo/ so build-demo no longer deletes the checked-in demo source files. Also switch the demo image reference to use new URL(..., import.meta.url).href, which avoids the TypeScript 5.9 asset import resolution failure seen in CI during check-types. Add a regression test for the demo build config and ignore only demo/dist.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
XShareButtonas the canonical X share export while keepingTwitterShareButtonas a deprecated compatibility alias