Skip to content

Add BitModal component and interactive PA showcase#87

Merged
albx merged 10 commits intoalbx:mainfrom
mrdevrobot:main
Mar 31, 2026
Merged

Add BitModal component and interactive PA showcase#87
albx merged 10 commits intoalbx:mainfrom
mrdevrobot:main

Conversation

@mrdevrobot
Copy link
Copy Markdown
Contributor

This pull request introduces significant improvements to the documentation and sample usage of the BitBlazor component library, focusing on Bootstrap Italia integration and modal/dialog functionality. The main changes include adding a comprehensive usage guide for the BitModal component, updating the documentation to clarify font usage, and providing a new sample page demonstrating notification and alert patterns.

Documentation Enhancements:

  • Added a detailed usage guide for the BitModal component, including parameter tables, accessibility notes, usage examples, and references to Bootstrap Italia and WAI-ARIA best practices.
  • Updated the README.md to recommend including the default Bootstrap Italia fonts via an additional stylesheet link, improving visual consistency.

Sample Application Improvements:

  • Introduced a new sample page (Comunicazioni.razor) that demonstrates interactive notification cards, filtering, dismissible alerts, and an archive of past communications, showcasing practical use of BitBlazor components such as BitModal, BitAlert, BitBadge, and BitCard.

- Add BitModal razor component with Bootstrap Italia modal styles
- Support all documented sizes (Small, Large, ExtraLarge) via ModalSize enum
- Support positioning (Default, Centered, Left, Right) via ModalPosition enum
- Support variants (Default, Alert, LinkList, Popconfirm) via ModalType enum
- Support backdrop behavior (Default, Static, None) via ModalBackdrop enum
- Allow custom header, body, and footer via RenderFragment parameters
- Support two-way binding on IsVisible parameter
- Expose ARIA attributes (aria-labelledby, aria-label, aria-describedby)
- Include fade animation toggle, scrollable content, footer shadow options
- Add XML documentation for all public parameters
- Add unit tests (rendering + behavior) covering all variants and use cases
- Add BlazingStory stories for interactive documentation
- Add docs/components/modal.md reference documentation
- Replace boilerplate sample with interactive PA portal concept
- Bootstrap Italia themed layout: portal header, sidebar nav with icons
- Home: dashboard with stats cards, quick access grid, recent alerts
- Servizi: service catalog with BitCard grid (Anagrafe, Tributi, Edilizia)
- Modulistica: full form showcase (BitTextField, BitSelect, BitRadio,
  BitCheckbox, BitToggle, BitDatepicker, BitTimepicker, BitNumberField)
- Comunicazioni: dismissible alerts list with BitBadge category chips
- Sportello: BitModal showcase with 8+ variants (sizes, positions,
  types, backdrop modes) and KPI dashboard
- Add wwwroot/css/fonts.css to BitBlazor library with @font-face rules
  for Titillium Web (300/400/600/700), Lora (400/700) and Roboto Mono
  (400/700) — all weights include italic variants
- Font paths point to _content/BitBlazor/bootstrap-italia/fonts/ so no
  extra assets need to be copied by consumers
- Add optional fonts link to README Getting Started section
- Include fonts.css in Stories IFramePage.razor (canvas views)
- Include fonts.css in Sample App.razor; set Titillium Web as default
  font-family in app.css
- Replace hardcoded IsVisible=true with @bind-IsVisible + trigger button
- Add ViewModel with a bool property per story to track open/close state
- All close actions (footer buttons, X button, backdrop) now properly
  update the bound state via two-way binding
- Add new 'Backdrop - Static' story to demonstrate non-dismissible modal
- Footer buttons in stories without ShowCloseButton explicitly set the
  bool to false to close the modal
Copilot AI review requested due to automatic review settings March 14, 2026 07:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new BitModal component to the BitBlazor component library (Bootstrap Italia–styled), along with documentation, Storybook examples, and sample app pages demonstrating practical UI patterns. It also introduces an optional bundled font stylesheet to align typography with Bootstrap Italia defaults.

Changes:

  • Added BitModal component (plus related enums) and accompanying unit tests.
  • Added Storybook stories and docs page describing BitModal usage and accessibility.
  • Updated sample/stories apps to include Bootstrap Italia default fonts and added new interactive showcase pages/layout.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/BitBlazor.Test/Components/Modal/BitModalTest.Rendering.razor bUnit rendering coverage for modal structure, classes, aria attributes, header/footer/backdrop rendering.
tests/BitBlazor.Test/Components/Modal/BitModalTest.Behaviors.cs bUnit behavior coverage for close/backdrop click interactions and callbacks.
stories/BitBlazor.Stories/Components/Stories/Components/BitModal.stories.razor Storybook scenarios demonstrating modal variants (size, position, type, backdrop, fade).
stories/BitBlazor.Stories/Components/Pages/IFramePage.razor Loads the new fonts stylesheet in the stories host page.
src/BitBlazor/wwwroot/css/fonts.css Adds Bootstrap Italia font-face declarations for Titillium Web, Lora, Roboto Mono.
src/BitBlazor/Components/Modal/ModalType.cs New enum for modal visual variants.
src/BitBlazor/Components/Modal/ModalSize.cs New enum for modal sizing variants.
src/BitBlazor/Components/Modal/ModalPosition.cs New enum for modal positioning variants.
src/BitBlazor/Components/Modal/ModalBackdrop.cs New enum for backdrop behavior.
src/BitBlazor/Components/Modal/BitModal.razor.cs BitModal component logic: parameters, class computation, close/backdrop handlers, id generation.
src/BitBlazor/Components/Modal/BitModal.razor BitModal markup: backdrop, dialog, header/body/footer rendering with aria attributes.
samples/BitBlazor.Sample/BitBlazor.Sample/wwwroot/app.css Updates sample typography and adds a form-group spacing override for Bootstrap Italia.
samples/BitBlazor.Sample/BitBlazor.Sample/Components/Pages/Servizi.razor New “Servizi” catalog page for the sample portal experience.
samples/BitBlazor.Sample/BitBlazor.Sample/Components/Pages/Home.razor Replaces default template with a “Dashboard” page showcasing cards and alerts.
samples/BitBlazor.Sample/BitBlazor.Sample/Components/Layout/NavMenu.razor.css Sidebar styling tweaks for Bootstrap Italia link-list navigation.
samples/BitBlazor.Sample/BitBlazor.Sample/Components/Layout/NavMenu.razor Replaces template nav with Bootstrap Italia sidebar link-list + account section.
samples/BitBlazor.Sample/BitBlazor.Sample/Components/Layout/MainLayout.razor.css New portal layout styling (header/sidebar/content) for the sample.
samples/BitBlazor.Sample/BitBlazor.Sample/Components/Layout/MainLayout.razor New portal header/sidebar layout and localized error UI text.
samples/BitBlazor.Sample/BitBlazor.Sample/Components/App.razor Includes the new _content/BitBlazor/css/fonts.css stylesheet in the sample app.
samples/BitBlazor.Sample/BitBlazor.Sample.Client/Pages/Sportello.razor New interactive “Sportello Digitale” page showcasing multiple BitModal variants.
samples/BitBlazor.Sample/BitBlazor.Sample.Client/Pages/Modulistica.razor New “Modulistica” page demonstrating forms and related BitBlazor form components.
samples/BitBlazor.Sample/BitBlazor.Sample.Client/Pages/Comunicazioni.razor New interactive communications page demonstrating dismissible alerts and archive.
docs/components/modal.md New documentation page for BitModal (parameters, enums, examples, accessibility notes).
README.md Documents optional inclusion of the Bootstrap Italia default fonts stylesheet.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@albx
Copy link
Copy Markdown
Owner

albx commented Mar 14, 2026

@mrdevrobot hi and thanks for the PR 🥳 . I'll review it in the following days!

@albx albx self-requested a review March 14, 2026 17:08
@mrdevrobot
Copy link
Copy Markdown
Contributor Author

Ciao @albx if you have any concern let me know ;)
Once you merge this one I can take care of other tasks, I have a project for the PA and this idea would fit perfectly!

@albx
Copy link
Copy Markdown
Owner

albx commented Mar 19, 2026

Ciao @mrdevrobot! Sorry busy week...I will review the PR soon 🤞
It will be a pleasure if, once merged this contrib, you will take other issues, just let me know or drop a comment on the issue you'd like to start working on 🙂

Copy link
Copy Markdown
Owner

@albx albx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrdevrobot first of all thank you very much! I think it's a great job 🙂
I leave some comments in tests just to keep @bind-Visible approach explicit.
I have to finish review for component itself and documentation

- Use @bind-IsVisible (two-way binding) in all BitModalTest.Rendering tests
- Use .Bind() instead of separate .Add() for IsVisible/IsVisibleChanged in BitModalTest.Behaviors
- Fix fonts.css font URL paths to use relative paths (../bootstrap-italia/fonts/) instead of absolute _content/BitBlazor paths
@mrdevrobot
Copy link
Copy Markdown
Contributor Author

mrdevrobot commented Mar 23, 2026

@mrdevrobot first of all thank you very much! I think it's a great job 🙂 I leave some comments in tests just to keep @bind-Visible approach explicit. I have to finish review for component itself and documentation

Hi @albx I've fixed the binding meanwhile. Looking forward for the full Review ;)

Copy link
Copy Markdown
Owner

@albx albx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @mrdevrobot , just two things before approve and merge this PR:

  • For the stories switch to english just to stay consistent with the other components
  • Add a quick reference to the modal.md documentation in the README.md file inside the docs/ folder

After this two things, I will merge the PR and the modal will be part of the 0.3.0 version of BitBlazor 🥳

@albx albx linked an issue Mar 26, 2026 that may be closed by this pull request
Add a Modal entry to docs/README.md and translate BitModal story content from Italian to English. Update story texts (titles, button labels, body copy, aria labels), tidy attribute formatting, and adjust story structure/spacing in stories/BitBlazor.Stories/Components/Stories/Components/BitModal.stories.razor for consistency.
@mrdevrobot
Copy link
Copy Markdown
Contributor Author

@albx all corrections done ;)

@albx albx merged commit 1cefa4f into albx:main Mar 31, 2026
4 checks passed
@albx
Copy link
Copy Markdown
Owner

albx commented Mar 31, 2026

@mrdevrobot merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add the Modal component

3 participants