Commit Graph

61 Commits

Author SHA1 Message Date
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
moosme 8cf3775943 Merge pull request #1489 from marcjulian/feat/remove-unused-styles 2026-06-17 08:07:19 +02: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 cc3a7578de chore: remove unused spartan-* classes 2026-06-16 17:09:52 +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
Marc Stammerjohann 138a4d84c4 fix(native-select): apply system styles to option and optgroup 2026-06-15 11:21:06 +02: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
Robin Goetz fbdc1a1f8f fix(native-select): use system colors for options in dark mode (#1467)
Chromium renders native select option popups using the select's
translucent dark background, breaking contrast in dark mode. Style
options and optgroups with the Canvas/CanvasText system colors so the
dropdown adapts to the active color-scheme, matching shadcn.

Closes #1426
2026-06-13 22:00:38 +02: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
mehrabix cc3f381f34 fix(drawer): remove conflicting relative position from drawer content CSS
Remove relative from fixed z-50 to prevent position conflict in
maia, mira, and luma theme styles.
2026-06-13 21:59:40 +03:30
mehrabix eaa36f8e29 fix(drawer): add fixed z-50 to drawer content CSS for correct viewport positioning 2026-06-13 21:32:00 +03:30
Ashley Hunter 16ecd13eab test: surface vitest test counts in CI logs for the node projects
Add reporters: ['default'] to the mcp, cli, tools, registry and cli-smoke vite
configs (brain and helm already had it). Without a default reporter the @nx/vitest
NxReporter is the only one attached, so these projects printed no summary in CI -
which is how mcp's silently-undiscovered specs stayed invisible. The counts are
now shown so test execution is verifiable at a glance.
2026-06-13 17:35:00 +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
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 00f740cb64 feat(sidebar): adjust styles for rtl, add rtl example 2026-06-12 13:18:09 +02:00
Marc Stammerjohann d5fa2e1c0b feat(sheet): keep left/right the same behavior like other styles 2026-06-12 11:54:03 +02:00
Marc Stammerjohann d5a5aa1f7a feat(sheet): add style support, rtl and more examples 2026-06-12 11:13:43 +02:00
Marc Stammerjohann 3c03ca82d0 feat(dialog): add style support 2026-06-11 12:48:34 +02:00
Marc Stammerjohann a7e225c1fd feat(alert-dialog): add style support, rtl and more examples, add BrnDialogClose to hlmAlertDialogCancel (#1450)
* feat(alert-dialog): add style support, add BrnDialogClose to hlmAlertDialogCancel

* feat(alert-dialog): add rtl and more examples

* docs(alert-dialog): fix text

* feat(alert-dialog): align dialog width

* feat(alert-dialog): update snapshot

* chore: update snapshot comment
2026-06-11 12:01:07 +02:00
moosme e8fb6b0cfb Merge pull request #1441 from spartan-ng/wt/resizable-1412 2026-06-10 22:44:24 +02:00
Ashley Hunter 99b05147d1 fix(scroll-area): implement per-style support and match shadcn
Address review feedback on the PR. Wire the directive to ngx-scrollbar's
real CSS variables at shadcn's values (transparent 10px track, 7px
bg-border thumb) and default visibility to hover so the thumb only shows
on hover, scroll or focus like shadcn.

Move the container radius into the registry per style now that the demo
no longer hardcodes it: rounded-md for vega/nova/mira, square for lyra
via --radius 0, and rounded-2xl for maia/luma. Replace the dead
radix-era marker rules with a single spartan-scroll-area rule.

Declare ngx-scrollbar as a helm peer dependency since the directive now
imports from it, and mirror the changes in the CLI template.
2026-06-10 18:24:28 +01:00
Ashley Hunter 2abb581585 fix(resizable): align handle and focus styles with shadcn
Address review feedback on the style support. Set Lyra's --radius to 0
so the bordered container and handle render sharp like shadcn's Lyra
preset, and round the Lyra handle grip with the shared rounded-lg token
so the squaring comes from --radius rather than a special case.

Match shadcn's splitter focus ring by using ring-offset-background in
place of the fixed ring-offset-1 offset, in both the helm component and
the CLI template.
2026-06-10 18:09:51 +01:00
Marc Stammerjohann a9103a61af feat(sidebar): add style support 2026-06-10 16:40:32 +02:00
Toni Škobić f4d1ce3265 fix(button-group): Add RTL example and make border radius RTL compatible (#1424)
* docs(button-group): add rtl example

* fix(button-group): make border styles rtl

* fix: update other styles and fix radio indicator

* chore: format

* fix: use absolute pos for dropdown menu radio

* chore: format

* docs(button-group): rotate icon

* docs(button-group): rotate icon

* docs(button-group): provide directionality
2026-06-09 17:42:11 +02:00
Ashley Hunter 653e887581 Merge pull request #1433 from spartan-ng/feat/switch-style-rtl-1417
feat(switch): add style support and rtl example
2026-06-09 09:34:13 +01:00
Ashley Hunter 57a37326f7 feat(slider): support styles per registry style
Emit the spartan-slider-track, spartan-slider-range and spartan-slider-thumb
markers so the per-style track height, corner radius, thumb size and thumb border
defined in the registry styles apply at runtime across vega, nova, maia, lyra,
mira and luma, matching shadcn. Correct the mira track height to match shadcn.
Enable the docs theme switcher and show all styles.
2026-06-09 08:35:50 +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
Ashley Hunter d4da582d40 feat(repo)!: upgrade nx to 22 and angular to 21 (#1430)
* feat(repo)!: upgrade nx to 22 and angular to 21

Upgrade the workspace to Nx 22.7.5 and Angular 21.2.16, and widen the
published peer dependency ranges to support Angular 21 and 22 while
dropping Angular 20.

- nx and @nx/* to 22.7.5; @angular/* to 21.2.16 (framework) and 21.2.14
  (cli, build, devkit, cdk, ssr)
- brain, helm and trpc @angular/* peers to ">=21.0.0 <23.0.0"; the helm
  embla-carousel-angular peer uses the same range
- @spartan-ng/cli minimums raised to >=21 and @schematics/angular to
  21.2.14; the private tools lib aligned to nx 22 / angular 21
- analog 2.6.0, ng-packagr 21, angular-eslint 21, storybook 10, jest 30,
  @testing-library/angular 19 and related tooling
- replace the calendar select host-listener $event with a typed output
  subscription; constrain the ai-chat-link directive to anchors
- drive the menubar e2e arrow keys via native keydown and disable
  Chromium throttling; hold cypress at 14 (15 breaks realPress specs)

BREAKING CHANGE: Angular 20 is no longer supported. spartan/ui now
supports Angular 21 and 22.

* ci: lower unit test parallelism to fit the runner memory

The docs app's vitest + Analog suite peaks at a few GB; running it
alongside two other test projects under --parallel=3 exhausted the
GitHub runner memory and the worker was OOM-killed with no output.
Run at most two test projects concurrently.

* fix(trpc): drop invalid environment providers from the test env module

The Nx 22 migration wrapped provideZoneChangeDetection() in an @NgModule,
but EnvironmentProviders are not valid in @NgModule providers and Angular
21 throws NG0207 at runtime. Restore the plain initTestEnvironment setup
(matching the docs app); the explicit zone provider is unnecessary.

* ci: run the docs app test suite in isolation

Bundling the docs app's vitest + Analog suite into the parallel test run
made it fail in CI while it passes on its own, and the interleaved output
hid the cause. Run the other projects in parallel, then the docs app as a
separate step.

* fix(nx): point test cache inputs at the real jest preset file

The test targets' cache inputs referenced jest.preset.js, but the
workspace preset is jest.preset.cjs, so the input never matched and a
preset change would not invalidate the cache. Fix both the
@nx/vitest:test target (added by the Nx 22 migration) and the existing
@nx/jest:jest target.

* ci: log exit code and retry the docs app test suite once

The docs app's vitest + Analog suite intermittently crashes in CI right
after loading Angular's testing modules, with no error output. Log the
exit code to classify the crash (128+signal indicates a native crash)
and retry once so a flaky crash does not fail the run while the root
cause is investigated.

* ci: clarify docs app test retry after pinpointing the flaky crash

The crash is in app.spec.ts: booting the full app shell (Header/Footer
and their deep import graph) intermittently crashes the vitest worker
during the Analog transform in CI (exit 1, no output, not reproducible
locally). It happens before any test runs, so a vitest per-test retry
cannot help; re-running the suite once does.

* chore(repo): hold analog at 2.1.3 and drop unit-test ci workarounds

Analog 2.6.0 intermittently crashed the docs app's vitest worker in CI
(a flaky transform of the app shell), so keep analog at the nx-migration's
tested 2.1.3, revert the marked bumps that 2.6.0 required, and restore the
ai-chat-link directive selector. Also restore the original unit test ci
step, dropping the parallel, isolation and retry workarounds added while
chasing that crash.
2026-06-08 22:23:45 +02:00
moosme 9ee58f8795 Merge pull request #1420 from marcjulian/feat/button-styles-and-radius
feat: update radius calculation from pixel to percentage, add button …
2026-06-08 12:07:52 +02:00
moosme 55c78b54ef Merge pull request #1421 from marcjulian/docs/card-rtl
docs(card): update usage, add rtl, closes #1395
2026-06-08 11:48:33 +02:00
Marc Stammerjohann 07a26c57d5 feat(card): add --card-spacing css variable 2026-06-08 10:40:29 +02:00
Marc Stammerjohann 9a1d9baf3b feat(date-picker): add date-picker-trigger, use button styles (#1390)
* feat(date-picker): add date-picker-trigger, use button styles, add forceInvalid

* fix(date-picker): lint issue and update snapshot

* fix(date-picker): add trigger to test

* fix(date-picker): cleanup imports

* docs(date-picker): add for to label

* docs(date-picker): use trigger in blocks

* docs(date-picker): add rtl example

* feat(date-picker): use trigger in story

* feat(date-picker): add header and footer slot for calendar, update block example

*  add showTrigger input
2026-06-08 09:58:17 +02:00
Marc Stammerjohann d71d6c0036 feat: update radius calculation from pixel to percentage, add button active style 2026-06-05 12:24:12 +02:00
moosme 7bd4482127 Merge pull request #1379 from marcjulian/feat/style-support
feat: add style support, update combobox empty, clear button autocomplete/combobox
2026-06-03 15:43:34 +02:00
Marc Stammerjohann 7e9393aa1d feat(select): add style support, add forceInvalid, add rtl and invalid example 2026-06-03 11:28:45 +02:00
Marc Stammerjohann 551a7114fe feat(autocomplete): add style support, add forceInvalid input and invalid example 2026-06-02 16:33:26 +02:00
Marc Stammerjohann 3dcc615f63 feat(combobox): update styles 2026-06-02 13:47:37 +02:00
Marc Stammerjohann 125c65df41 feat(combobox): add style support, add rtl example 2026-06-02 12:34:40 +02:00
Ashley Hunter a90e2b1d87 fix: correct sidebar shadow and align vega button to shadcn
Remove the invalid hsl() wrapper around the sidebar menu button outline
shadow across all themes. The --sidebar-border and --sidebar-accent tokens
are already oklch() color values, so hsl(var(--sidebar-border)) produced
invalid CSS and the box-shadow was dropped. Use the bare var() reference to
match shadcn.

Also align the vega button with the shadcn vega preset:
- secondary variant hover uses color-mix instead of bg-secondary/80
- size-lg inline-icon padding uses pr-2/pl-2 instead of pr-3/pl-3
2026-06-01 22:20:14 +01:00
Marc Stammerjohann 9e527ee1a2 feat: add style support to native-select, sonner, field (#1375)
* feat(native-select): add style support, rtl example, add forceInvalid

* fix(native-select): center icon correctly considering the text-xs/relaxed for default size

* feat(sonner): add style support

* fix(select): trigger icon placement when no value/placeholder is available

* feat(field): add style support, add rtl example

* fix(field): rename to spartan-*

* docs(sonner): remove duration

* docs(field): fix translation value

* fix(sonner): merge toast options to keep the default styles
2026-06-01 14:09:41 +02:00
Marc Stammerjohann ae85c62f14 feat: support styles for input, input-group and textarea (#1352)
* feat(textarea): support styles, remove error variants, update examples

* feat(input): support styles, remove error variants, more examples

* update sidebar-input

* feat(input-group): support styles, update examples

* feat: update snaphot

* feat(input-group): remove invalid state as css selector check for descendant

* fix(input): test

* chore: update hlm files

* fix(input): lint issues

* fix(input): update tests, classes are now applied via spartan-input and in cli copied
2026-05-07 15:56:38 +02:00
Marc Stammerjohann 8b3232638d feat: add style support for empty, label and input-otp (#1350)
* feat(empty): add styles support

* feat(empty): add rtl and input group examples

* feat(label): support styles and add rtl example

* feat(input-otp): add styles support

* feat(input-otp): add rtl and other examples

* chore: copy hlm to cli

* feat(input-otp): update snapshot

* fix: class names
2026-05-05 17:04:01 +02:00
Marc Stammerjohann 73eecef272 feat(pagination): support styles and add rtl example (#1342)
* docs(command): remove unused button

* feat(pagination): support styles

* feat(pagination): add rtl example and flip icons

* feat(pagination): generate hlm to cli
2026-05-01 14:13:35 +02:00
Marc Stammerjohann b8c46db7ab feat: button group styles (#1329)
* feat: button-group styles

* feat(button-group): add data-slot

* feat(button-group): add missing separator classes

* feat(separator): update styles

* chore: add not-style-vega to avoid vega styles to bleed in other styles

* necessary for button group lyra styles

---------

Co-authored-by: Merlin <merlin.moos@oldendorff.com>
2026-04-24 12:05:30 +02:00
Marc Stammerjohann d14aff5d9a feat(toggle): add style support, update and add rtl example (#1327)
* feat(toggle): add style support, update and add rtl example

* docs(toggle): update examples, cleanup vega styles and update snapshot

* docs(toggle): remove unused code snippets

* chore: copy hlm to cli
2026-04-23 16:06:34 +02:00
Marc Stammerjohann d1eea0ca29 feat: skeleton and table style support and examples (#1315)
* feat(skeleton): support styles, add more examples and rtl

* feat(table): support styles, update selectors, add more examples and rtl

* docs: cleanup key
2026-04-14 09:51:11 +02:00
Marc Stammerjohann ea86c23f19 feat(accordion): add rtl example and update styles 2026-04-07 16:33:20 +02:00
Marc Stammerjohann e6c4966cc4 feat(accordion): add item disabled, wrap trigger into component
* add styles support
2026-04-07 16:27:10 +02:00