2089 Commits

Author SHA1 Message Date
Marc Stammerjohann d0081b77a8 fix(command): check has search input for separator
* otherwise shows multiple separator while searching in the scrollable example
2026-06-16 18:23:57 +02:00
Marc Stammerjohann 079d4a1cbb docs(command): fix typo 2026-06-16 18:16:01 +02:00
Marc Stammerjohann 63b1ec6b64 feat(command): remove custom data-hidden is built in
* remove important from rounded
2026-06-16 18:14:41 +02:00
Merlin 4812cc620b fix: comments 2026-06-16 17:52:47 +02:00
Merlin aa4dceca2c fix: resolve conflicts 2026-06-16 16:40:30 +02:00
Merlin c3ae65c868 feat(command): add style and rtl support #1399 2026-06-16 16:33:58 +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 05463a6955 fix: ignore copilot from contributors (#1487) 2026-06-16 16:13:34 +02:00
Leonidas 0475400815 chore: add new contributors to our 300 2026-06-16 11:12:27 +00: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
Juan Valero 50c54ac29c docs: add tailwind configuration guide for Jetbrains-based IDEs (#1482) 2026-06-16 00:40:21 +02: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
Robin Goetz 70fb0e929f fix(cli): handle interrupts in healthcheck prompt and harden generators (#1479)
* fix(cli): handle interrupts in healthcheck prompt and harden generators

Replace the raw-stdin prompt in the healthcheck generator with the standard
enquirer confirm prompt so Ctrl+C correctly aborts the run instead of leaving
the generator running. Isolate each healthcheck so one throwing does not abort
the rest, and report registry fetch failures instead of throwing.

Make getImportAlias throw on a present-but-invalid config rather than silently
falling back to the default alias, guard against the coerce() NPE in
version-utils, and switch migrate-hlm to readJson. Add unit tests across these
paths and stub network access so the suite runs offline.

Closes #906

* fix(cli): guard version healthcheck fix against missing dependencies section

The fix writeback read packageJson.dependencies[dep] directly, which threw when
a package.json had no dependencies section and the dependency lived only in
devDependencies. Guard both sections with optional chaining so the writeback is
symmetrical and never touches an undefined section.
2026-06-15 15:16:42 +02:00
Ahmad Mehrabi 715499fe4e feat(date-picker): add Jalali (Persian) calendar support (#1429)
* feat(date-picker): add Jalali (Persian) calendar support

- Add pure Jalali calendar math algorithms (no npm packages)
- Add JalaliDate class with valueOf() for reliable calendar comparison
- Add BrnJalaliDateAdapter implementing BrnDateAdapter<JalaliDate>
- Add comprehensive unit tests for all adapter methods
- Add Persian (Farsi) calendar i18n with RTL layout
- Add Jalali date picker example to docs page
- Add Storybook story with Persian locale
- Extend TranslateService to support 'fa' language

* feat(date-picker): add Jalali (Persian) calendar support

Add pure Jalali calendar math, JalaliDate class, and BrnJalaliDateAdapter with tests.

Move example from component docs to blocks/calendar page per PR review.

* refactor: clean up jalali date-time code

- Deduplicate JALALI_MONTHS array in calendar i18n files
- snake_case to camelCase in PersianDate (gregorianDaysInMonth, jalaliDaysInMonth)
- Expand cryptic param names (j_y to jalaliYear, g_y to gregorianYear, etc.)
- Remove parseInt() no-ops on typed number params
- Remove getMonthName (i18n concern, not calendrical)
- Destructure tuples with descriptive names across adapter/date/persian-date
- Fix month+day add drift: clamp day after month step before day arithmetic

* style: fix long line formatting to pass nx format check

* fix(date-picker): resolve merge conflicts from upstream and stashed changes

Merge descriptive variable names (_constrain, parseInt, getMonthName,
full descriptive names) with upstream descriptive names. All tests pass.

* refactor: remove parseInt unwrapping and getMonthName, add PersianDate tests
2026-06-15 15:05:30 +02:00
Leonidas 5435594148 chore: add new contributors to our 300 2026-06-15 12:16:48 +00: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
moosme 3fe00994c4 Merge pull request #1478 from marcjulian/fix/native-select-styles
fix(native-select): option and optgroup system color classes
2026-06-15 13:43:20 +02:00
Marc Stammerjohann 9e825894d1 feat(native-select): generate to cli 2026-06-15 11:24:11 +02: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
Ashley Hunter 603d213799 fix(resizable): end drag on touchcancel
A touch drag interrupted by the system fires touchcancel instead of touchend, so the drag teardown
(listeners + cursor) never ran until the next drag or destroy. Listen for touchcancel alongside
touchend and remove it in cleanup. Adds a regression test.
2026-06-15 08:04:00 +01:00
Leonidas 7da9d3e4c3 chore: nightly release 2026-06-15 ⚡ 2026-06-15 04:22:11 +00:00
Ashley Hunter 00ecbca7d2 build(repo): fix update-ui-docs-snapshot script for vitest
Replace the jest-era invocation (npm test ... --updateSnapshot --skip-cache) with the vitest/nx
equivalent so the snapshot can actually be regenerated.
2026-06-15 00:05:00 +01:00
Ashley Hunter 85bc4b74a2 test(repo): refresh ui-docs API snapshot for prefixed avatar exportAs
The generate-ui-docs snapshot captures each directive's exportAs, so the avatar exportAs rename
(avatarImage/avatarFallback -> brn*/hlm*) left it stale and failed the unit job. Diff is limited to
those four entries.
2026-06-15 00:05:00 +01: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 f533fa426c refactor(dialog): remove deprecated injectBrnDialogCtx
Drop the deprecated `injectBrnDialogCtx` in favour of `injectBrnDialogContext`, which the helm
dialog, docs app and storybook already use exclusively. Removing it before 1.0 avoids carrying the
alias on the stable line. The `BrnDialogContext` type it returned stays - it is still used inside
the service.
2026-06-14 23:43:51 +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 4ee05f9c50 fix(drawer): release drag listeners and reset timeout on destroy
_cleanup removed only the pointermove listener; the pointerup/pointercancel listeners (registered
with { once: true }) were left attached to document, so a destroy-during-drag - or a normal end
where pointercancel never fired - kept this directive pinned to document until the next global
pointer release. The 500ms _resetDrawer timeout was also fire-and-forget, leaving a stale style
write on detached elements when destroyed within that window.

Remove both listeners in _cleanup, and track the reset timeout so it can be cancelled on destroy.
The timeout is intentionally only cleared on destroy, not in _cleanup, so the normal snap-back
path (which schedules the timeout immediately before _cleanup runs) still clears the transition.
2026-06-14 23:09:41 +01:00
Ashley Hunter a16b251a26 fix(resizable): tear down drag listeners when destroyed mid-drag
startResize attaches mousemove/touchmove/mouseup/touchend listeners to document, removed only
in the drag-end handler. If the group is destroyed mid-drag (navigation, conditional removal),
those listeners stay attached to document - which is never garbage-collected - pinning the
directive and firing against a torn-down view, and the body cursor is left stuck on the resize
cursor.

Hoist the cleanup into a single teardown stored on the instance: it detaches the four document
listeners, cancels any queued animation frame and restores the cursor. It runs on normal
drag-end and from a DestroyRef.onDestroy hook, and also clears a stale in-flight drag before a
new one starts.
2026-06-14 23:02:40 +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
Ashley Hunter bf758cfac0 feat(cli): add drawer to the ui generator
Drawer shipped as a helm lib with docs but was missing from the CLI, so
`nx g @spartan-ng/cli:ui drawer` failed. Register it in the Primitive union and
dependency map, generate its templates + supported-ui-libraries entry, and add a
drift-guard spec asserting the CLI primitive set equals the installable helm
components (with a generator template each) so this cannot recur.
2026-06-14 22:24:06 +01:00
Ashley Hunter 90721eadc3 Merge pull request #1465 from mehrabix/feat/drawer-component
feat(drawer): add drawer component with brain primitive and helm styling
2026-06-14 21:57:29 +01:00
Ashley Hunter f94c1377a2 test(drawer): regenerate ui-docs snapshot after HlmDrawerHandle removal 2026-06-14 21:42:43 +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 112f9d12b2 fix(drawer): prevent pointer capture on tap to fix button clicks on touch
- Replace preventDefault() on pointerdown with conditional touch-action:
  none to avoid suppressing click events per Pointer Events spec
- Defer setPointerCapture to only when drag starts, not on every
  pointerdown — capture redirects synthetic clicks to the captured
  element instead of the button
- Add releasePointerCapture and touch-action restoration in cleanup
  so capture is released before the browser fires click
2026-06-14 15:26:00 +03:30
mehrabix 284c1f04db fix(drawer): correct close animation for left/top and prevent double-close
- Fix _animateAndClose target formula: use ±dimension instead of
  dimension + getTranslate() which produced wrong position for
  left/top drawers (negative transforms), causing drawer to stay
  half-closed
- Add animation: none inline style before close() to prevent
  Tailwind data-closed:slide-out-* keyframe animation from
  overriding inline transform (was visually reopening drawer)
- Add setPointerCapture for reliable pointercancel delivery
- Add DestroyRef.onDestroy cleanup to prevent pointermove listener
  leak if directive is destroyed mid-gesture
- Remove unused _scrollEl field
2026-06-14 14:50:21 +03:30
mehrabix e3271391f8 style(drawer): fix formatting for long line 2026-06-14 13:54:10 +03:30
mehrabix 224c3d268a fix(drawer): handle null event target in shouldDrag call 2026-06-14 13:50:18 +03:30
mehrabix 78399c9aec feat(drawer): rewrite drag handling to match vaul/shadcn implementation
Rewrite BrnDrawerHandle to match vaul v1.1.2 touch/swipe logic:
- Direction detection: 10px touch / 2px mouse swipe threshold, axis
  alignment check prevents horizontal drags on vertical drawers
- shouldDrag with scroll lock: 100ms cooldown after scroll detection,
  DOM walk for scrollable ancestors, 500ms cooldown after open
- Simple velocity: totalDistance / totalTime on release (threshold 0.4)
- Logarithmic rubber-band: dampenValue uses 8 * ln(v+1) - 16
- isAllowedToDrag latch: once drag starts, no re-check on subsequent moves
- Close threshold: 0.25 (25% of drawer dimension, matching vaul)
2026-06-14 13:38:10 +03:30
mehrabix 5d885f3931 feat(drawer): add scrollable content detection to prevent drag on scroll
Detect scrollable ancestors on pointerdown and skip drawer drag when
the scrollable content has remaining scroll in the drag direction.
Only prevent default on pointerdown when no scrollable element is
found, so browser scrolling is not blocked. Move preventDefault in
pointermove after the scroll check.
2026-06-14 13:15:53 +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
mehrabix 522153e44e fix(drawer): add showThemeToggle to drawer page
Co-authored-by: moosme <46927822+MerlinMoos@users.noreply.github.com>
2026-06-14 13:14:25 +03:30
Leonidas f377723a53 chore: nightly release 2026-06-14 ⚡ 2026-06-14 04:09:37 +00:00
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