Repository navigation
feat: add source-owned local country flags - #161
Merged
Merged
Conversation
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.
Adds original, source-owned Flag implementations for Vue, React and Svelte with native img/fallback elements and caller-owned Tailwind appearance. Built-in country-only flags derive a fixed English country name when alt is omitted: yields Nigeria. Any explicit alt string wins, including alt="" for decoration and application-localized labels. No Boolean alt overload. Any nonempty custom src disables inferred naming even when country is supplied. Invalid/missing codes and failed images fall back truthfully; changing source retries. React immediate image failures are preserved without a post-render reset race.
Pinned MIT country-flag-icons@1.6.20 supplies 257 locally bundled flags; full license travels in flags.js. Checked-in English names make default SSR and hydration deterministic without runtime Intl, locale props, or remote calls. Registry size is 246,858 bytes raw / 69,835 gzip; CSP img-src data: is required. Names follow asset-specific XA/XC/XO code meanings.
Canonical installation/API/source/live examples: sailscastshq/docs.sailscasts.com#284. All three Storybooks demonstrate inferred/default, explicit decorative/label override, width classes, circular crop, custom source and failure cases. Pairlore explicitly keeps flags beside country names decorative: https://github.com/sailscastshq/pairlore/pull/242.
Validation: 611 unit tests; all-framework server rendering checks included in release:check; production build; canonical Tailwind; registry lineage; packed CLI; all three Storybook builds. Headless Vue/React/Svelte omitted/empty/string/custom-source-with-country/invalid/failure/retry checks pass in light/dark mobile. No merge, package release or manual deployment.