Commit Graph

642 Commits

Author SHA1 Message Date
moosme 9236788c8f Merge pull request #1495 from mehrabix/feat/provide-spartan-hlm
feat(utils): add provideSpartanHlm utility to fix CDK overlay z-index…
2026-06-18 08:29:44 +02:00
Leonidas f1cdfcbc9b chore: nightly release 2026-06-18 ⚡ 2026-06-18 04:04:01 +00:00
mehrabix f396e32df9 feat: add provideSpartanHlm utility to fix CDK overlay z-index conflict
In Angular 21, the CDK overlay defaults to using the popover attribute,
which causes overlay-based components (sheets, dialogs, tooltips) to
always render above position: fixed elements like hlm-toaster. This
adds a provideSpartanHlm() utility that configures OVERLAY_DEFAULT_CONFIG
with usePopover: false, and documents the issue in the sonner docs.

Closes #1280
2026-06-17 19:08:20 +03:30
moosme 01aeb5a231 feat(navigation-menu): add style support #1408 (#1490)
* feat(navigation-menu): add style support #1408

* fix: review

* feat(navigation-menu): add align input to navigation-menu-trigger

* add align example

* feat(navigation-menu): add navOffset

* docs(navigation-menu): update example ids

* feat(navigation-menu): add guard in updateAlign

* feat(navigation-menu): remove group from trigger

* feat(navigation-menu): remove unused data-popup-open classes

* navigation-menu doesn't have data-popup-open attribute

---------

Co-authored-by: Merlin <merlin.moos@oldendorff.com>
Co-authored-by: Marc Stammerjohann <8985933+marcjulian@users.noreply.github.com>
2026-06-17 15:43:07 +02:00
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
moosme 8cf3775943 Merge pull request #1489 from marcjulian/feat/remove-unused-styles 2026-06-17 08:07:19 +02:00
Leonidas b5e12f4140 chore: nightly release 2026-06-17 ⚡ 2026-06-17 04:12:35 +00: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 82b6f756de test(drawer): cover open/close and directional positioning
Exercises the getPositionStrategy() override for bottom/top/left/right and the
modal backdrop, guarding the drawer's adaptation to the new dialog lifecycle.
2026-06-16 23:56:56 +01:00
Ashley Hunter ed9328f867 test(select): cover keyboard open, commit-and-close, and focus model
Guards the regression where committing with Enter re-opened the panel, plus
Escape-to-close and the trigger keeping focus while navigating.
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 2e14efcde5 fix(drawer): adapt drawer to the new dialog/overlay lifecycle
The drawer landed on main against the old BrnDialog API. Reconcile it with
this branch's refactor:

- override getPositionStrategy() for the directional position instead of the
  removed mutablePositionStrategy/positionBuilder members (matches BrnSheet)
- constrain BrnDrawerContent<T extends Record<string, unknown>> to satisfy
  BrnDialogContent's tightened generic
- drop the removed closeDelay-era 'delay' input from the drawer close wrapper
  and its CLI template
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
moosme 263648ade1 feat(command): add style and rtl support #1399 (#1488)
* feat(command): add style and rtl support #1399

* fix: comments

* feat(command): remove custom data-hidden is built in

* remove important from rounded

* docs(command): fix typo

* fix(command): check has search input for separator

* otherwise shows multiple separator while searching in the scrollable example

---------

Co-authored-by: Merlin <merlin.moos@oldendorff.com>
Co-authored-by: Marc Stammerjohann <8985933+marcjulian@users.noreply.github.com>
2026-06-16 18:48:35 +02:00
Marc Stammerjohann a0687ae64b feat(popover): add header, title and description 2026-06-16 17:21:28 +02:00
Marc Stammerjohann 27305c73c0 feat: dropdown and context menu styles, rtl example (#1486)
* feat(dropdown-menu): add style support, add sub trigger

* feat(dropdown-menu): update snapshot

* feat(context-menu): add rtl and more examples, enable styles

* remove spartan-context-* classes as it reuses dropdown-menu

* feat(menubar): remove unused spartan-menubar-* styles, update examples

* fix(dropdown-menu): remove duplicate styles which dropdown-menu-item already applies

* docs(context-menu): fix id

* docs: update examples

* feat(dropdown-menu): make checkbox/radio group scoped

* fix(dropdown-menu): fix rtl styles

* feat(dropdown-menu): add internal comment

* feat(dropdown-menu): add ng-icon styles for item-indicator

* docs(menubar): update preview
2026-06-16 16:33:33 +02:00
moosme 61a546f24a Merge pull request #1476 from spartan-ng/pre-1.0-audit
chore(repo): pre-1.0 audit - overlay leak fixes, data-slot, CLI drawer, naming
2026-06-16 11:43:11 +02:00
Leonidas bd321c9ab0 chore: nightly release 2026-06-16 ⚡ 2026-06-16 04:12:33 +00:00
moosme 457b7190cc feat(menubar): add style support (#1474)
* feat(menubar): add style support

* fix: review

---------

Co-authored-by: Merlin <merlin.moos@oldendorff.com>
2026-06-15 15:52:30 +02:00
copilot-swe-agent[bot] aaf29b4e05 chore(repo): merge main into pre-1.0-audit (resolve drawer brain version conflict) 2026-06-15 11:47:09 +00:00
Marc Stammerjohann 90d06b2f1b feat(native-select): update option and optgroup selector 2026-06-15 11:23:37 +02:00
Marc Stammerjohann 138a4d84c4 fix(native-select): apply system styles to option and optgroup 2026-06-15 11:21:06 +02:00
Leonidas 7da9d3e4c3 chore: nightly release 2026-06-15 ⚡ 2026-06-15 04:22:11 +00:00
Ashley Hunter 66fafc4b16 fix(repo): drop redundant data-slot duplicating the brain layer
The data-slot pass added host/template data-slot to helm navigation-menu and slider, but the brain
directives those wrappers compose (BrnNavigationMenu* via hostDirectives, BrnSlider/brnSliderTrack/
brnSliderRange/brnSliderThumb in the slider template) already emit the identical data-slot on the
same elements. The helm copies were dead duplication and a future drift hazard. Removed them; the
slots remain in the DOM via the brain layer (verified in browser). The genuinely-new slots
(switch, input, progress, popover, calendar root) stay - the brain layer provides none for those.
2026-06-14 23:54:05 +01: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 e1b26056ec refactor(breadcrumb): drop deprecated HlmBreadCrumbImports alias
Remove the mis-cased `HlmBreadCrumbImports` alias in favour of the canonical
`HlmBreadcrumbImports`, dropping it before 1.0 rather than carrying it on the stable line. The
NgModule migration map is repointed to the canonical name so `nx g @spartan-ng/cli:migrate-module-
imports` still rewrites `HlmBreadCrumbModule` to an export that exists.
2026-06-14 23:40:36 +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
Ashley Hunter 935e4c2404 fix(avatar): give image/fallback distinct prefixed exportAs names
BrnAvatarImage/BrnAvatarFallback and their helm wrappers all used the same
unprefixed exportAs ('avatarImage'/'avatarFallback'). Since the helm directive
host-applies the brain one on the same <img>, a template ref was ambiguous, and
the names broke the brn*/hlm* convention every other exportAs follows. Rename to
brnAvatarImage/brnAvatarFallback and hlmAvatarImage/hlmAvatarFallback before the
exportAs surface is locked at 1.0. Regenerated the CLI avatar templates to match.
2026-06-14 22:26:34 +01:00
mehrabix 94a57f4eee Merge remote-tracking branch 'origin/main' into feat/drawer-component 2026-06-14 18:49:54 +03:30
mehrabix 4188133dd8 fix(drawer): remove dead HlmDrawerHandle, fix iOS touch-action, fix _openTime cooldown
- Remove unused HlmDrawerHandle directive
- Add static touch-action: none to .spartan-drawer-content in all
  style files so iOS Safari does not hijack the gesture before the
  pointerdown handler fires
- Set _openTime via effect on dialog state open instead of on first
  pointerdown, so the 500ms cooldown starts when the drawer opens
  rather than eating the user's first drag
2026-06-14 18:40:26 +03:30
mehrabix fac0ed879b refactor(drawer): refactor drag handling and component structure
Improve drag smoothness and reliability by implementing position
tracking in BrnDrawerHandle. Simplify the component structure by moving
the handle logic to a host directive on HlmDrawerContent and removing
manual pointer-events management.
2026-06-14 13:14:40 +03:30
mehrabix dec0ce4401 feat(drawer): add RTL example, pointer-events guard, and fix input spacing
Add RTL preview example with EN/AR/HE translations,
pointer-events:none on body while drawer is open (removed with 300ms
delay on close), and replace div.px-4 with hlm-field-group for proper
spacing.
2026-06-14 13:14:33 +03:30
Leonidas f377723a53 chore: nightly release 2026-06-14 ⚡ 2026-06-14 04:09:37 +00:00
Robin Goetz b4d7c6aa64 feat(slider): support styles for ticks (#1469)
Emit the spartan-slider-ticks marker so the ticks container padding, which
offsets ticks to the thumb center, is defined per registry style instead of a
fixed px-1.5. The previous fixed padding assumed a 12px thumb, so ticks were
misaligned for styles with larger thumbs (luma, vega, mira, maia). Set the
padding to each style's thumb radius across luma, vega, lyra, nova, mira and
maia, for both horizontal and vertical orientations.

Closes #1455
2026-06-13 21:53:06 +02:00
Patrick 803614a7bb test: update overlay api snapshots 2026-06-13 14:48:23 -04:00
Patrick c7fb7469d6 fix: restore overlay dismissal semantics 2026-06-13 14:32:40 -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
mehrabix 2e3059c8a2 feat(drawer): add drawer component with brain primitive and helm styling 2026-06-13 21:31:07 +03:30
Ashley Hunter e0f236ba47 fix: run mcp tests and stop passWithNoTests masking missing test discovery
The mcp vite config lacked `root: __dirname`, so the @nx/vitest executor (which
runs from the workspace root) resolved `src/**/*.spec.ts` against the workspace
root, found nothing, and `passWithNoTests` passed it silently - mcp's 19 tests
never ran.

Pin mcp's root, and drop `passWithNoTests` from every project that has specs
(mcp, cli, tools, brain, helm) so a future test-discovery break fails loudly
instead of going green. registry keeps the flag - it genuinely has no specs.
2026-06-13 17:16:45 +01: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
Leonidas f29b10bb68 chore: nightly release 2026-06-13 ⚡ 2026-06-13 03:47:26 +00:00
moosme 33299063ad Merge pull request #1462 from marcjulian/feat/sheet-styles
feat(sheet): add style support, rtl and more examples
2026-06-12 16:10:13 +02:00
moosme 23e2d705c8 Merge pull request #1454 from marcjulian/feat/sidebar-styles
feat(sidebar): add style support and rtl example
2026-06-12 16:09:43 +02:00
Marc Stammerjohann 8ed6eb64d2 fix(sidebar): add data-side to sidebar-container for styles 2026-06-12 12:17:40 +02:00
Marc Stammerjohann d5a5aa1f7a feat(sheet): add style support, rtl and more examples 2026-06-12 11:13:43 +02:00
Marc Stammerjohann 90773f3b3c fix(tooltip): spartan-tooltip-content to be replaced for styles 2026-06-12 09:56:08 +02:00
Leonidas 1d4b389e6e chore: nightly release 2026-06-12 ⚡ 2026-06-12 04:02:56 +00:00
Ashley Hunter 98b0395f41 Merge pull request #1456 from spartan-ng/feat/cli-smoke-harness 2026-06-11 21:33:30 +01:00