Commit Graph

25 Commits

Author SHA1 Message Date
Ashley Hunter d2f40d3014 Merge pull request #1471 from PatrickLarocque/fix/overlay-lifecycle
refactor!: split dialog and overlay portal lifecycles
2026-06-17 10:16:35 +01:00
Ashley Hunter d4a0a31eb0 test(popover): cover animation-aware teardown and overlay behaviour
Panel stays mounted through the exit animation then disposes, reopen cancels a
pending teardown, no-animation disposes promptly; plus non-modal (no backdrop),
autoFocus opt-out, outside-pointer gating, unique overlay ids, and the
destroyed-output guard.
2026-06-16 23:56:56 +01:00
Ashley Hunter 4140fc6d9a test(popover): cover autofocus, focus restore, and nested dismissal
Regression coverage for the overlay lifecycle work: autoFocus moves focus to
the first tabbable element on open, leaves focus on the trigger when the
content has none (the select/combobox keyboard model), restores focus to the
trigger on Escape, and a nested popover does not dismiss its parent while it is
the topmost overlay.
2026-06-16 23:41:50 +01:00
Ashley Hunter 23f20bf4dd feat: restore overlay focus-into-content on open via opt-in autoFocus
Moving popover-backed controls off CDK Dialog dropped the dialog's
autoFocus: 'first-tabbable', so popovers no longer moved focus to their
content on open (form fields were left unfocused, comboboxes could not be
typed into immediately).

Add an opt-in autoFocus option to BrnOverlay that focuses the first tabbable
element once the content renders, and enable it in the popover defaults. The
select keeps focus on its trigger because its listbox has no tabbable element,
preserving the aria-activedescendant keyboard model. Re-expose the autoFocus
input on the helm popover wrapper and its CLI template, and refresh the docs
API snapshot.
2026-06-16 23:23:29 +01:00
Ashley Hunter 0c3b653902 Merge origin/main into fix/overlay-lifecycle
Resolve brn-dialog.service.ts conflict: drop the deprecated injectBrnDialogCtx
alias (removed on main during the pre-1.0 audit) and keep the typed
injectBrnDialogContext with the unknown default.
2026-06-16 23:22:47 +01:00
Marc Stammerjohann a0687ae64b feat(popover): add header, title and description 2026-06-16 17:21:28 +02:00
Ashley Hunter 8cf9a9c868 style(repo): order host after hostDirectives in data-slot components
The data-slot additions inserted the `host` key directly after `selector`, violating the
workspace `@nx/workspace-component-directive-key-order` rule (host must follow hostDirectives).
Reorder the affected calendar/input/navigation-menu/popover/progress/slider metadata; no behavior
change.
2026-06-14 23:40:43 +01:00
Ashley Hunter c5b3a1df4c feat(repo): add data-slot attributes to remaining helm components
Standardize the `data-slot` styling contract across the helm layer so themes and
consumers have a consistent, public styling hook on every component. Adds the
attribute to switch, switch-thumb, input, slider (track/range/thumb), progress,
progress-indicator, calendar, navigation-menu (root/list/item/trigger/link) and
popover (root/content), matching the shadcn slot names.
2026-06-14 22:44:04 +01:00
Patrick 803614a7bb test: update overlay api snapshots 2026-06-13 14:48:23 -04:00
Patrick ba74c53c97 refactor: split dialog and overlay primitives 2026-06-13 14:32:40 -04:00
Patrick 179ec6af8f fix: coordinate overlay lifecycle with animations
Replace fixed close delays with lifecycle-driven disposal so overlays remain responsive.
Wait only for exit animations that actually start and centralize Escape, backdrop, and
outside-pointer dismissal.

BREAKING CHANGE: remove the closeDelay input and configuration option. Remove explicit delay
values; closed-state exit animations are now detected automatically.
2026-06-13 14:32:40 -04:00
Ashley Hunter 1b743f8019 test: migrate from jest to vitest with browser testing for brain/helm
Replace Jest with Vitest across the workspace. The brain and helm Angular suites
now run in a real browser (Playwright/Chromium via Vitest browser mode) so they
exercise real layout, focus, pointer events and computed styles that jsdom could
not. The cli, tools, mcp, registry and cli-smoke suites run on Vitest's node
environment.

- Add per-project vite configs and switch test targets to @nx/vitest:test
- Convert jest APIs to vi.* and jest module mocks to vi.mock with importOriginal
- Replace jest-axe with a browser-native axe-core helper and toHaveNoViolations
- Regenerate snapshots in vitest format (content unchanged, format-only)
- Remove all jest packages, configs, the preset and the @nx/jest target default
- Install Playwright Chromium in the CI unit job for the browser suites

Also fixes a brain avatar test that asserted inside a fire-and-forget setTimeout,
which passed vacuously under jsdom and only surfaced once a real browser loaded
the image.
2026-06-13 15:16:45 +01:00
Ashley Hunter bbf5dfadc7 feat(popover): add style support and rtl example
Make BrnDialog overlays inherit the trigger's ambient direction so popover renders RTL.

Closes #1409
2026-06-09 20:13:40 +01:00
Felix Hagemans 54b7ece8b0 fix(popover): propagate attachTo and restoreFocus in hlm-popover component 2026-02-26 08:44:45 +01:00
Marc Stammerjohann e5d5e2a5cc feat: replace *brn*Content w/ *hlm*Portal (#1180)
* feat(dialog): add hlmDialogPortal to expose *brnDialogContent

* feat(alert-dialog): add hlmAlertDialogPortal to expose *brnAlertDialogContent

* feat(popover): add hlmPopoverPortal to expose *brnPopoverContent

* feat(sheet): add hlmSheetPortal to expose *brnSheetContent

* feat(navigation-menu): add hlmNavigationMenuPortal to expose *brnNavigationMenuContent

* chore: add dialog portal healtcheck and migration

* chore: dogfood dialog portal migration

* chore: fix imports

* chore: use importAlias for popover helm import

* chore: remove importAlias in healthcheck

* feat(popover): update hlm-popover-content selector

* feat(sheet): add showCloseButton input and use hlmBtn for close button

* feat(navigation-menu): update HlmNavigationMenuContent selector

* feat(autocomplete): update HlmAutocompleteContent selector and add autocomplete portal

* chore: add no-scrollbar util to tailwind preset used by autocomplete/combobox/command

* feat(combobox): update HlmComboboxContent selector and use combobox portal

* chore: update snapshot

* fix: storybook imports

* fix(sheet): apply data-slot on button directly and fix test

* otherwise hlmBtn slot is used

* fix(popover): storybook template error
2026-02-04 11:38:58 +01:00
Ashley Hunter 3c0ab73226 refactor: replace hlm with new classes utility (#1086)
* feat: adding classes util

* fix: improving hlm

* fix: classes

* fix: classes tests and linting

* feat: adding tests

* fix: perf

* fix: perf improvements

* test: fixing tests
2025-12-22 16:06:40 +01:00
Marc Stammerjohann 29192af454 feat: improve dialog, alert-dialog, sheet and popover (#1059)
* feat(dialog): change dialogs to directive

* docs(popover): add name to  popover template selector

* feat(dialog): simplify dialog overlay

* feat(dialog): use BrnDialogTitle as hostDirective, add data-slot

* feat(dialog): use hostDirectives, change components to directives

* add data-slot

* feat(alert-dialog): use directives, add data-slot

* feat(sheet): use directives, add data-slot

* feat(dialog): add hlm trigger directive

* feat(popover): remove unused popover-close

* feat(popover): add hlm-popover

* feat: update snapshot and selectors

* feat(dialog): add healthcheck and migration

* feat(popover): expose more inputs/outputs

* feat(dialog): dogfeeding healthcheck and migration

* feat(dialog): add types to inputs

* feat(popover): expose more inputs

* feat(dialog): use hlmDialogTrigger

* feat(dialog): remove unused importAlias

* feat(dialog): add input types
2025-12-04 10:20:12 +01:00
Merlin 64f82d8b79 feat(item): run format all 2025-10-22 15:40:07 +02:00
moosme adf55dbdd3 refactor: polish imports (#890)
Co-authored-by: Merlin <merlin.moos@oldendorff.com>
2025-09-27 17:52:14 -04:00
Marc Stammerjohann 9f4484fabf feat: add prettier tailwind function sorting config and docs (#842)
* chore: rename prettier config

* chore: configure tailwind to sort hlm and cva functions

* docs: add sorting classes section to installation guide

* explain how to sort classes in hlm and cva functions
* update TailwindCSS to Tailwind CSS

* chore: format hlm and cva tailwind classes
2025-09-01 12:11:35 +02:00
moosme 556a3a5133 Export hlm from brain to helm (#856)
* chore: nightly release 2025-08-24 ⚡

* chore: nightly release 2025-08-25 ⚡

* chore: nightly release 2025-08-26 ⚡

* feat: move hlm from brain to hlm #843

* feat: add utils installation #843

* feat: move tailwind-merge to dependencies #840

* fix: fix tests and add utils test

---------

Co-authored-by: Leonidas <leonidas@spartan.ng>
2025-08-31 18:14:40 +02:00
Ashley Hunter b1ed68e0d0 refactor: use the latest angular naming conventions (#766)
* refactor: use the latest angular naming conventions

* build: merge

* docs: fixing unexpected component rename

Co-authored-by: Ajit Panigrahi <ajitzero@gmail.com>

* build: fix generated code

* build: fixing build

* build: fix directive

* feat: adding helm migration

* build: health check detection improvements

* build: checking file type

* build: fix formatting

---------

Co-authored-by: Ajit Panigrahi <ajitzero@gmail.com>
2025-07-30 22:32:02 +02:00
MerlinMoos ced805c807 fix: make access modifier consistent #755 (#758)
* fix: make access modifier consistent #755

* fix: run format

* fix: resolve build issues

---------

Co-authored-by: Merlin Moos <merlin.moos@oldendorff.com>
2025-07-22 17:43:20 +02:00
Jeevan fb3d95a340 Remove standalone property (#701)
* feat: remove standalone property from various directives and components in the Helm UI library

* feat: enable strictStandalone option in Angular compiler settings
2025-06-10 22:00:48 +02:00
Ashley Hunter 0eeeb17b1a refactor: helm secondary entrypoints 2025-05-29 20:59:16 +01:00