@radix-ng/primitives 1.0.0-beta.5 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/composite/README.md +3 -0
  2. package/fesm2022/radix-ng-primitives-accordion.mjs +12 -36
  3. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  4. package/fesm2022/radix-ng-primitives-composite.mjs +515 -0
  5. package/fesm2022/radix-ng-primitives-composite.mjs.map +1 -0
  6. package/fesm2022/radix-ng-primitives-drawer.mjs +442 -2
  7. package/fesm2022/radix-ng-primitives-drawer.mjs.map +1 -1
  8. package/fesm2022/radix-ng-primitives-menu.mjs +38 -16
  9. package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
  10. package/fesm2022/radix-ng-primitives-menubar.mjs +68 -36
  11. package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
  12. package/fesm2022/radix-ng-primitives-navigation-menu.mjs +281 -88
  13. package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
  14. package/fesm2022/radix-ng-primitives-popover.mjs +40 -15
  15. package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
  16. package/fesm2022/radix-ng-primitives-popper.mjs +73 -65
  17. package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
  18. package/fesm2022/radix-ng-primitives-radio.mjs +63 -27
  19. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  20. package/fesm2022/radix-ng-primitives-roving-focus.mjs +40 -8
  21. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
  22. package/fesm2022/radix-ng-primitives-scroll-area.mjs +56 -25
  23. package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
  24. package/fesm2022/radix-ng-primitives-select.mjs +3 -0
  25. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  26. package/fesm2022/radix-ng-primitives-tabs.mjs +50 -21
  27. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  28. package/fesm2022/radix-ng-primitives-toggle-group.mjs +66 -21
  29. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  30. package/fesm2022/radix-ng-primitives-toggle.mjs +29 -11
  31. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  32. package/fesm2022/radix-ng-primitives-toolbar.mjs +50 -24
  33. package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
  34. package/navigation-menu/README.md +5 -2
  35. package/package.json +5 -1
  36. package/types/radix-ng-primitives-accordion.d.ts +9 -13
  37. package/types/radix-ng-primitives-composite.d.ts +152 -0
  38. package/types/radix-ng-primitives-drawer.d.ts +40 -2
  39. package/types/radix-ng-primitives-menu.d.ts +5 -3
  40. package/types/radix-ng-primitives-menubar.d.ts +10 -5
  41. package/types/radix-ng-primitives-navigation-menu.d.ts +65 -33
  42. package/types/radix-ng-primitives-popover.d.ts +9 -5
  43. package/types/radix-ng-primitives-popper.d.ts +1 -0
  44. package/types/radix-ng-primitives-radio.d.ts +11 -9
  45. package/types/radix-ng-primitives-roving-focus.d.ts +15 -1
  46. package/types/radix-ng-primitives-scroll-area.d.ts +4 -1
  47. package/types/radix-ng-primitives-tabs.d.ts +8 -5
  48. package/types/radix-ng-primitives-toggle-group.d.ts +27 -16
  49. package/types/radix-ng-primitives-toggle.d.ts +5 -5
  50. package/types/radix-ng-primitives-toolbar.d.ts +22 -14
@@ -456,29 +456,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
456
456
  class RdxPopoverBackdrop {
457
457
  constructor() {
458
458
  this.rootContext = injectRdxPopoverRootContext();
459
+ const host = inject(ElementRef).nativeElement;
460
+ host.style.setProperty('-webkit-user-select', 'none');
459
461
  // Register the backdrop as owned DOM footprint for primitive-specific checks. The focus manager's
460
462
  // marker keep-set stays narrow and does not keep sibling backdrop roots.
461
463
  const floatingContext = inject(RDX_FLOATING_ROOT_CONTEXT, { optional: true });
462
464
  if (floatingContext) {
463
- const host = inject(ElementRef).nativeElement;
464
465
  floatingContext.addFloatingElement(host);
465
466
  inject(DestroyRef).onDestroy(() => floatingContext.removeFloatingElement(host));
466
467
  }
467
468
  }
468
469
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopoverBackdrop, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
469
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxPopoverBackdrop, isStandalone: true, selector: "[rdxPopoverBackdrop]", host: { properties: { "attr.data-closed": "rootContext.isOpen() ? undefined : \"\"", "attr.data-ending-style": "rootContext.transitionStatus() === \"ending\" ? \"\" : undefined", "attr.data-instant": "rootContext.instant() ? \"\" : undefined", "attr.data-open": "rootContext.isOpen() ? \"\" : undefined", "attr.data-starting-style": "rootContext.transitionStatus() === \"starting\" ? \"\" : undefined", "attr.data-state": "rootContext.isOpen() ? \"open\" : \"closed\"" } }, ngImport: i0 }); }
470
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxPopoverBackdrop, isStandalone: true, selector: "[rdxPopoverBackdrop]", host: { attributes: { "role": "presentation" }, properties: { "attr.data-closed": "rootContext.isOpen() ? undefined : \"\"", "attr.data-ending-style": "rootContext.transitionStatus() === \"ending\" ? \"\" : undefined", "attr.data-instant": "rootContext.instant() ? \"\" : undefined", "attr.data-open": "rootContext.isOpen() ? \"\" : undefined", "attr.data-starting-style": "rootContext.transitionStatus() === \"starting\" ? \"\" : undefined", "attr.data-state": "rootContext.isOpen() ? \"open\" : \"closed\"", "style.pointer-events": "rootContext.openChangeReason() === \"trigger-hover\" ? \"none\" : null", "style.user-select": "\"none\"" } }, ngImport: i0 }); }
470
471
  }
471
472
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopoverBackdrop, decorators: [{
472
473
  type: Directive,
473
474
  args: [{
474
475
  selector: '[rdxPopoverBackdrop]',
475
476
  host: {
477
+ role: 'presentation',
476
478
  '[attr.data-closed]': 'rootContext.isOpen() ? undefined : ""',
477
479
  '[attr.data-ending-style]': 'rootContext.transitionStatus() === "ending" ? "" : undefined',
478
480
  '[attr.data-instant]': 'rootContext.instant() ? "" : undefined',
479
481
  '[attr.data-open]': 'rootContext.isOpen() ? "" : undefined',
480
482
  '[attr.data-starting-style]': 'rootContext.transitionStatus() === "starting" ? "" : undefined',
481
- '[attr.data-state]': 'rootContext.isOpen() ? "open" : "closed"'
483
+ '[attr.data-state]': 'rootContext.isOpen() ? "open" : "closed"',
484
+ '[style.pointer-events]': 'rootContext.openChangeReason() === "trigger-hover" ? "none" : null',
485
+ '[style.user-select]': '"none"'
482
486
  }
483
487
  }]
484
488
  }], ctorParameters: () => [] });
@@ -586,13 +590,17 @@ class RdxPopoverPopup {
586
590
  closeInteractionType: () => rootContext.closeInteractionType()
587
591
  };
588
592
  })
589
- ], hostDirectives: [{ directive: i1.RdxPopperContent }, { directive: i2.RdxFloatingNodeRegistration }, { directive: i3.RdxFloatingFocusManager }], ngImport: i0 }); }
593
+ ], hostDirectives: [{ directive: i1.RdxPopperContent }, { directive: i2.RdxFloatingNodeRegistration }, { directive: i3.RdxFloatingFocusManager, inputs: ["initialFocus", "initialFocus", "returnFocus", "finalFocus"] }], ngImport: i0 }); }
590
594
  }
591
595
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopoverPopup, decorators: [{
592
596
  type: Directive,
593
597
  args: [{
594
598
  selector: '[rdxPopoverPopup]',
595
- hostDirectives: [RdxPopperContent, RdxFloatingNodeRegistration, RdxFloatingFocusManager],
599
+ hostDirectives: [
600
+ RdxPopperContent,
601
+ RdxFloatingNodeRegistration,
602
+ { directive: RdxFloatingFocusManager, inputs: ['initialFocus', 'returnFocus: finalFocus'] }
603
+ ],
596
604
  providers: [
597
605
  provideFloatingFocusManagerConfig(() => {
598
606
  const rootContext = injectRdxPopoverRootContext();
@@ -663,22 +671,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
663
671
  class RdxPopoverDescription {
664
672
  constructor() {
665
673
  this.rootContext = injectRdxPopoverRootContext();
666
- this.id = injectId('rdx-popover-description-');
667
- this.rootContext.setDescriptionId(this.id);
674
+ this.generatedId = injectId('rdx-popover-description-');
675
+ this.idInput = input(undefined, { ...(ngDevMode ? { debugName: "idInput" } : /* istanbul ignore next */ {}), alias: 'id' });
676
+ this.id = computed(() => this.idInput() ?? this.generatedId, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
677
+ effect((onCleanup) => {
678
+ const id = this.id();
679
+ this.rootContext.setDescriptionId(id);
680
+ onCleanup(() => this.rootContext.setDescriptionId(undefined));
681
+ });
668
682
  inject(DestroyRef).onDestroy(() => this.rootContext.setDescriptionId(undefined));
669
683
  }
670
684
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopoverDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
671
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxPopoverDescription, isStandalone: true, selector: "[rdxPopoverDescription]", host: { properties: { "id": "id" } }, ngImport: i0 }); }
685
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxPopoverDescription, isStandalone: true, selector: "[rdxPopoverDescription]", inputs: { idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "id": "id()" } }, ngImport: i0 }); }
672
686
  }
673
687
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopoverDescription, decorators: [{
674
688
  type: Directive,
675
689
  args: [{
676
690
  selector: '[rdxPopoverDescription]',
677
691
  host: {
678
- '[id]': 'id'
692
+ '[id]': 'id()'
679
693
  }
680
694
  }]
681
- }], ctorParameters: () => [] });
695
+ }], ctorParameters: () => [], propDecorators: { idInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
682
696
 
683
697
  /**
684
698
  * Structural directive that teleports the popover content into a container (default `document.body`)
@@ -778,22 +792,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
778
792
  class RdxPopoverTitle {
779
793
  constructor() {
780
794
  this.rootContext = injectRdxPopoverRootContext();
781
- this.id = injectId('rdx-popover-title-');
782
- this.rootContext.setTitleId(this.id);
795
+ this.generatedId = injectId('rdx-popover-title-');
796
+ this.idInput = input(undefined, { ...(ngDevMode ? { debugName: "idInput" } : /* istanbul ignore next */ {}), alias: 'id' });
797
+ this.id = computed(() => this.idInput() ?? this.generatedId, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
798
+ effect((onCleanup) => {
799
+ const id = this.id();
800
+ this.rootContext.setTitleId(id);
801
+ onCleanup(() => this.rootContext.setTitleId(undefined));
802
+ });
783
803
  inject(DestroyRef).onDestroy(() => this.rootContext.setTitleId(undefined));
784
804
  }
785
805
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopoverTitle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
786
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RdxPopoverTitle, isStandalone: true, selector: "[rdxPopoverTitle]", host: { properties: { "id": "id" } }, ngImport: i0 }); }
806
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: RdxPopoverTitle, isStandalone: true, selector: "[rdxPopoverTitle]", inputs: { idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "id": "id()" } }, ngImport: i0 }); }
787
807
  }
788
808
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RdxPopoverTitle, decorators: [{
789
809
  type: Directive,
790
810
  args: [{
791
811
  selector: '[rdxPopoverTitle]',
792
812
  host: {
793
- '[id]': 'id'
813
+ '[id]': 'id()'
794
814
  }
795
815
  }]
796
- }], ctorParameters: () => [] });
816
+ }], ctorParameters: () => [], propDecorators: { idInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
797
817
 
798
818
  /**
799
819
  * A button that opens the popover.
@@ -842,6 +862,11 @@ class RdxPopoverTrigger {
842
862
  });
843
863
  this.isPressed = computed(() => this.triggerInteraction.isActive() && this.rootContext()?.openChangeReason() === 'trigger-press', ...(ngDevMode ? [{ debugName: "isPressed" }] : /* istanbul ignore next */ []));
844
864
  this.generatedId = injectId('rdx-popover-trigger-');
865
+ effect(() => {
866
+ if (!this.handle() && !this.parentRootContext) {
867
+ rdxDevError('popover/trigger-missing-root', '`rdxPopoverTrigger` must be used inside `rdxPopoverRoot` or receive a `handle` connected to a root.', 'components/popover');
868
+ }
869
+ });
845
870
  effect((onCleanup) => {
846
871
  const handle = this.handle();
847
872
  if (handle) {