feat: add presentational country flag component and docs (#DS-1405)#1711
feat: add presentational country flag component and docs (#DS-1405)#1711NikGurev wants to merge 12 commits into
Conversation
|
Visit the preview URL for this PR (updated for commit af3d09a): https://koobiq-next--prs-1711-6vzyyk8c.web.app (expires Mon, 13 Jul 2026 11:30:07 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c9e37e518febda70d0317d07e8ceb35ac43c534c |
🚨 E2E tests failedReview the report for details. 💡 Comment |
🚨 E2E tests failedReview the report for details. 💡 Comment |
🚨 E2E tests failedReview the report for details. 💡 Comment |
|
/approve-snapshots |
|
🔄 Updating snapshots. |
|
✅ Snapshots updated! |
|
/approve-snapshots |
|
🔄 Updating snapshots. |
|
✅ Snapshots updated! |
There was a problem hiding this comment.
Sample flag svg, so not quite filled into shaped
There was a problem hiding this comment.
Pull request overview
Adds a new @koobiq/components/flag package that provides <kbq-flag> — a small presentational wrapper for consumer-supplied flag graphics — and wires it into docs, examples, E2E, and the components-dev playground.
Changes:
- Introduces
KbqFlagcomponent (+ types, styles, NgModule export, unit tests, API extractor/guard output). - Adds docs content + multiple docs examples (including a virtual-scroll select example) and a components-dev demo app.
- Adds E2E route + Playwright visual-regression coverage and updates workspace config to include the new package.
Reviewed changes
Copilot reviewed 32 out of 36 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Locks the newly added country-flag-icons dependency. |
| tsconfig.json | Adds a path alias for @koobiq/components/flag. |
| tools/public_api_guard/components/flag.api.md | New API guard snapshot for the Flag package. |
| tools/api-extractor/config.json | Registers flag for API extraction. |
| packages/e2e/routes.ts | Registers the Flag E2E component route. |
| packages/docs-examples/example-module.ts | Registers Flag examples (and some additional non-Flag examples) for docs. |
| packages/docs-examples/components/flag/ng-package.json | Adds ng-packagr config for the Flag docs-examples subpackage. |
| packages/docs-examples/components/flag/index.ts | Declares/exports the Flag docs examples module and examples. |
| packages/docs-examples/components/flag/flag-stylized/flag-stylized-example.ts | Adds a stylized flag docs example. |
| packages/docs-examples/components/flag/flag-square/flag-square-example.ts | Adds a square-flag docs example. |
| packages/docs-examples/components/flag/flag-sizes/flag-sizes-example.ts | Adds a flag sizing guidance docs example. |
| packages/docs-examples/components/flag/flag-overview/flag-overview-example.ts | Adds an overview grid docs example. |
| packages/docs-examples/components/flag/flag-language/flag-language-example.ts | Adds an a11y guidance example (“flag is not a language”). |
| packages/docs-examples/components/flag/flag-fallback/flag-fallback-example.ts | Adds a fallback/placeholder example using hasFlag. |
| packages/docs-examples/components/flag/flag-circle/flag-circle-example.ts | Adds a circular-flag docs example. |
| packages/docs-examples/components/flag/flag-aspect-ratio/flag-aspect-ratio-example.ts | Adds a select + virtual scroll example demonstrating sizing/aspect ratio. |
| packages/components/flag/public-api.ts | Exposes Flag public API surface. |
| packages/components/flag/ng-package.json | Adds ng-packagr config for the new component package. |
| packages/components/flag/module.ts | Provides KbqFlagModule for NgModule consumers. |
| packages/components/flag/index.ts | Adds package entrypoint export. |
| packages/components/flag/flag.types.ts | Defines KbqFlagShape/KbqFlagShadow types. |
| packages/components/flag/flag.ts | Implements the KbqFlag component host bindings and inputs. |
| packages/components/flag/flag.spec.ts | Adds unit tests for projection, modifiers, and a11y host attributes. |
| packages/components/flag/flag.scss | Adds styling for sizing, shape, inset shadow, stylized mode, and empty placeholder. |
| packages/components/flag/flag.ru.md | Adds Russian docs for usage/a11y guidelines + examples. |
| packages/components/flag/flag.en.md | Adds English docs for usage/a11y guidelines + examples. |
| packages/components/flag/e2e.ts | Adds E2E demo component for visual coverage without external flag data. |
| packages/components/flag/e2e.playwright-spec.ts | Adds Playwright screenshot coverage (light/dark). |
| packages/components-dev/flag/tsconfig.app.json | Adds TS config for the flag dev app. |
| packages/components-dev/flag/module.ts | Adds dev app module wiring for Flag docs examples. |
| packages/components-dev/flag/main.ts | Bootstraps the Flag dev app. |
| package.json | Adds country-flag-icons dev dependency and dev:flag script. |
| apps/docs/src/app/structure.ts | Registers Flag in docs navigation structure. |
| angular.json | Adds a dev-flag Angular project configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ru: 'Flag', | ||
| en: 'Flag' | ||
| }, | ||
| svgPreview: '', |
#1715 поправили тут |
|
По |
|
В мире не менее (а то и более) распространены флаги с пропорцией 4:3 — не только из |
@rmnturov это select с виртуальным скроллом, известная проблема. Использовал его, так как из-за большого количества svg страница подтормаживала |
добавил кастомизацию через |
вынес кастомизацию в пример, border-radius кастомизируется через |
🚨 E2E tests failedReview the report for details. 💡 Comment |
|
/approve-snapshots |
|
🔄 Updating snapshots. |
|
✅ Snapshots updated! |
🚨 E2E tests failedReview the report for details. 💡 Comment |
|
/approve-snapshots |
|
🔄 Updating snapshots. |
- drop `size` tokens, add `stylized` and `isEmpty` inputs
🚨 E2E tests failedReview the report for details. 💡 Comment |
🚨 E2E tests failedReview the report for details. 💡 Comment |




Adds
KbqFlag(<kbq-flag>) — a small, presentational country-flag component. The component owns onlypresentation and accessibility; the flag graphic itself is supplied by the consumer as projected content.
Content projection, not data. The flag SVG is projected (
[innerHTML]or a child element); thelibrary ships no flag data and has no dependency on any flag package.
Inputs:
shape(rectangle/square/circle),shadow(inset/none, a theme-adaptiveinset hairline),
empty(neutralplaceholder), plus the a11y contract —
label→role="img"+ accessible name,decorative→aria-hidden.Sizing follows
font-size(height: 1em) with an aspect-ratio box; no hardcoded size presets.Zero coupling / trivial customization. Any custom or non-country flag is just different projected
SVG (or any element) — no API, no registration. The library stays data-free and dependency-free.
Simple and conventional. Rendering an inline
<svg>is the most common way to show vector icons onthe web — no image requests, no data-URL/base64 wrapping, no runtime fetch or icon-registry
indirection. Consumers just import a flag string and drop it in.