Commit Graph

27 Commits

Author SHA1 Message Date
Ashley Hunter 7182249f21 test: expose brain axe helper via @spartan-ng/brain/testing alias
Replace the cross-entry-point relative import (../../../src/testing/axe) in the
checkbox, collapsible and switch specs with a @spartan-ng/brain/testing path
alias, mirroring the @angular/core/testing convention. The helper stays test
only: no ng-package.json, excluded from the lib build and dependency checks, so
it is never published.
2026-06-13 15:33:21 +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
Marc Stammerjohann 34e835e843 feat: update duplicate outputs, replace ngModel (#1428)
* feat: migrate duplicate output from model + output to input + linkedSignal + output, closes #1385

# Conflicts:
#	libs/helm/switch/src/lib/hlm-switch.ts

* feat(pagination): replace ngModel

* fix(toggle-group): select fires twice onChange and change.emit

* feat: rename value/checked input and linkedSignal
2026-06-09 18:51:22 +02:00
Ashley Hunter d872c74580 feat(switch): add size input
Expose a size input ('default' | 'sm') on the brain and helm switch, bound to the
button's data-size attribute, so the size-keyed registry style rules resolve and
a smaller switch can be rendered. Replaces the previously hardcoded
data-size="default". Add brn-switch specs covering the data-size reflection and
the thumb data-state, and update the ui-docs snapshot for the new input.
2026-06-09 08:35:41 +01:00
Ashley Hunter af74a9941b feat(switch): support styles per registry style
Emit the spartan-switch and spartan-switch-thumb markers so the per-style track
size, border width, corner radius and thumb size/offset defined in the registry
styles apply at runtime across vega, nova, maia, lyra, mira and luma, matching
shadcn. Add a data-size attribute to the brn-switch button and a data-state
attribute to the thumb so the registry's size- and state-keyed rules resolve, and
make the checked thumb translate direction-aware (ltr/rtl) so it animates
correctly under RTL. Enable the docs theme switcher and show all styles.
2026-06-09 08:35:41 +01:00
Sammy Mohamed 3f743e19f7 feat: better form control integration (#1053)
* feat: better form control integration

- general a11y described by service
- hint and error stories
- datepicker value type
- mock resizeObserver causing select failure
- form desciption test failures

* feat: autocomplete and combobox

- re-implemented form integration based on latest implementation

* fix: error state

* fix: formatting

* chore: update snapshot

* fix: format

* fix: update snapshot

* fix: autocomplete stories

* fix: test

* fix: remove not needed effects

* fix: call onTouched when autocomplete focus out

* fix: evaluate only error state in field

* fix: fix slider classes and field integration

* fix: set correct error styles to input group

* feat: add native select field control support

* fix: implement field control

* fix: emit touched when blurred for combobox

* fix: add invalid support for combobox multiple

* fix: fix autcomplete search and input styles

* feat: improve control state data attributes and hlm-error

- render hlm-error if error presetn
- add touched, dirty and matches-spartan-invalid attributes

* feat: apply field control as host directive

* test: fix some control error stories WIP

* fix: lint issues w/ type imports and sort order

* chore: remove form-field package as it is replaced by field

* chore: update snapshot

* fix: fix autocomplete providers array and error story

* fix: fix select, field error and input group

* docs: fix reactive forms examples WIP

* feat: add healthcheck and migration for hlm-form-field to hlm-field

* fix: add value accessor to date-picker multi

* docs: update field for/id

* fix: fix checkbox and rename CVA providers

* fix: add and fix tests

* docs(field): update headings

* feat(autocomplete): add inputId

* feat(combobox): add input/button id

* chore: update snapshot

* docs(date-picker): use hlm field

* docs(field): add native-select example, simplify selectId

* docs: use hlm-field for date-picker blocks

* feat: update form field usage in autocomplete story

* fix(input): unit test and remove unused ngControl

* fix: comment out missing errorState in select

* feat: remove ng-* classes

* feat: remove unused code

* fix: comment out error in unit tests

* feat: set label for attribute automatically

* refactor: rename variable

* docs: add brain input and textarea docs

* fix: apply button styles in storybook

* fix: fix select test and add missing attributes

* feat: add attributes to switch

* fix: fix field e2e tests and lint errors

* chore: fix format

* fix: add optional chain

* feat(select): add controls and aria labels to brn-select-trigger

* fix: update default value for select demo

* docs(select): add form example

* chore: update snapshot

* fix(select): add optional chain for aria-invalid

* feat(select): update e2e test form attributes

* fix(input): form unit test

* fix(select): update unit test template, add HlmFieldControlDescribedBy to select trigger button

* fix(combobox): use new combobox template for unit test

* add hlmFieldControlDescribedBy to combobox trigger button

* chore: remove console log from unit test

* fix(checkbox): use buttonName instead of id

* fix: lint issue w/ import

* test: fix unit tests

* docs: add field date picker preview

* docs: fix blocks and reactive forms

* docs: improve control, field and forms docs

* feat: add provider for error matcher

* chore: rename var

* fix: replace aria-invalid in registry styles

* feat: move state to brn, add to combo tigger

* chore: format

* feat(combobox): apply form attributes on brnComboboxTrigger

* remove need for applyControlState

* chore: update snapshot

* docs: update container width for the responsive select demo

* fix: remove aria invalid and fix chips focus styles

* feat(field): move HlmFieldControlDescribedBy and HlmFieldA11yService into brain package

* chore: update snapshot

* feat(field): update id input handling, update styles

* docs: update form examples to required

* feat: add forceInvalid to brn-field and brn-checkbox

* allow overrides to data-invalid and data-matches-spartan-invalid

* fix: add error if ngControl.control is not defined

---------

Co-authored-by: Merlin <merlin.moos@oldendorff.com>
Co-authored-by: Toni Škobić <toni.skobic@gmail.com>
Co-authored-by: Marc Stammerjohann <8985933+marcjulian@users.noreply.github.com>
2026-03-31 12:41:44 +02:00
Marc Stammerjohann 11d5b4390c chore: add types to inputs for the docs api (#1062) 2025-12-04 12:37:22 +01:00
moosme 51a579aa36 feat(repo): nx upgrade (#1002)
* feat(repo): nx upgrade

* fix: sidebar

* fix: node version

* fix: relax dependency versions

* fix: remove naming conventions

* fix: format

* fix: remove chromatic

---------

Co-authored-by: Merlin <merlin.moos@oldendorff.com>
2025-11-20 10:14:26 +01:00
Merlin Moos fd3229abe6 fix: add order 2025-11-12 23:08:18 +01:00
Merlin 6d60dc9d7d feat: add lint rule template last 2025-11-12 15:05:31 +01:00
Merlin 424f0162ad feat: fix tests 2025-09-29 16:44:58 +02:00
Merlin c6e6387739 refactor: align eslint rules 2025-09-29 15:59:20 +02:00
Merlin 9e34f79ded refactor: consistent type import 2025-09-29 14:42:31 +02:00
moosme adf55dbdd3 refactor: polish imports (#890)
Co-authored-by: Merlin <merlin.moos@oldendorff.com>
2025-09-27 17:52:14 -04:00
moosme 24582c3657 feat(switch,checkbox)Add health checks (#875) 2025-09-19 09:41:17 +02:00
moosme 5a326b435b fix: fix event bubbling issues and other control value accessor bugs (#874)
* chore: nightly release 2025-08-24 ⚡

* chore: nightly release 2025-08-25 ⚡

* chore: nightly release 2025-08-26 ⚡

* fix: prevent event bubbling

---------

Co-authored-by: Leonidas <leonidas@spartan.ng>
Co-authored-by: Merlin <merlin.moos@oldendorff.com>
2025-09-15 14:00:57 +02:00
moosme 5def645d0c Id generation (#864)
* chore: nightly release 2025-08-24 ⚡

* chore: nightly release 2025-08-25 ⚡

* chore: nightly release 2025-08-26 ⚡

* chore: nightly release 2025-08-27 ⚡

* chore: nightly release 2025-08-28 ⚡

* feat: start component id by 1 #863

---------

Co-authored-by: Leonidas <leonidas@spartan.ng>
2025-08-31 18:21:00 +02:00
Ashley Hunter 5e46bf2d48 docs(switch): switch polish (#847) 2025-08-24 12:39:58 +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
Marc Stammerjohann b90984b2f6 refactor: enforce eslint prefer onpush change detection (#688) 2025-05-14 02:41:54 +02:00
Robin Goetz 2235e726de fix(switch): touched and improve docs (#687) 2025-05-07 22:13:39 +02:00
Robin Goetz 308c536ced fix(switch): fix accessibility issues (#671) 2025-04-29 23:36:55 +02:00
Ashley Hunter 9b654631cc build: nx version updates (#672) 2025-04-27 12:54:23 +02:00
Ashley Hunter 2a8c5d1eef feat: angular 19 (#612) 2025-03-17 22:58:33 +01:00
Ashley Hunter 5313d244ec build: rxjs 6 support (#525)
* build: rxjs 6 support lint rule

* build: rxjs 6 support

* build: rxjs 6 support
2024-12-11 16:00:32 +01:00
Ashley Hunter be4a87dc87 refactor: migrating remaining brain libraries to secondary entrypoints (#523)
* refactor: migrating remaining brain libraries to secondary entrypoints

* refactor: migrating remaining brain libraries to secondary entrypoints
2024-12-10 18:40:46 +01:00