@radix-ng/primitives 0.2.0 → 0.4.0

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 (123) hide show
  1. package/avatar/README.md +1 -0
  2. package/avatar/index.d.ts +4 -0
  3. package/avatar/src/avatar-fallback.directive.d.ts +34 -0
  4. package/avatar/src/avatar-image.directive.d.ts +17 -0
  5. package/avatar/src/avatar.config.d.ts +12 -0
  6. package/avatar/src/avatar.directive.d.ts +22 -0
  7. package/avatar/src/avatar.token.d.ts +4 -0
  8. package/checkbox/index.d.ts +1 -1
  9. package/checkbox/src/checkbox-indicator.directive.d.ts +4 -4
  10. package/checkbox/src/checkbox.directive.d.ts +3 -3
  11. package/checkbox/src/checkbox.token.d.ts +3 -3
  12. package/esm2022/avatar/index.mjs +5 -0
  13. package/esm2022/avatar/radix-ng-primitives-avatar.mjs +5 -0
  14. package/esm2022/avatar/src/avatar-fallback.directive.mjs +61 -0
  15. package/esm2022/avatar/src/avatar-image.directive.mjs +50 -0
  16. package/esm2022/avatar/src/avatar.config.mjs +17 -0
  17. package/esm2022/avatar/src/avatar.directive.mjs +38 -0
  18. package/esm2022/avatar/src/avatar.token.mjs +6 -0
  19. package/esm2022/checkbox/index.mjs +2 -2
  20. package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +5 -5
  21. package/esm2022/checkbox/src/checkbox.directive.mjs +11 -11
  22. package/esm2022/checkbox/src/checkbox.token.mjs +4 -4
  23. package/esm2022/label/src/label.directive.mjs +5 -5
  24. package/esm2022/overlay/index.mjs +5 -0
  25. package/esm2022/overlay/radix-ng-primitives-overlay.mjs +5 -0
  26. package/esm2022/overlay/src/overlay-arrow.directive.mjs +59 -0
  27. package/esm2022/overlay/src/overlay-arrow.token.mjs +3 -0
  28. package/esm2022/overlay/src/overlay-trigger.directive.mjs +279 -0
  29. package/esm2022/overlay/src/overlay-trigger.token.mjs +9 -0
  30. package/esm2022/overlay/src/overlay.directive.mjs +51 -0
  31. package/esm2022/overlay/src/overlay.token.mjs +3 -0
  32. package/esm2022/progress/src/progress-indicator.directive.mjs +5 -5
  33. package/esm2022/progress/src/progress.directive.mjs +7 -7
  34. package/esm2022/progress/src/progress.token.mjs +4 -4
  35. package/esm2022/radio/index.mjs +2 -2
  36. package/esm2022/radio/src/radio-group.directive.mjs +14 -14
  37. package/esm2022/radio/src/radio-group.token.mjs +4 -4
  38. package/esm2022/radio/src/radio-indicator.directive.mjs +5 -5
  39. package/esm2022/radio/src/radio-item.directive.mjs +11 -11
  40. package/esm2022/radio/src/radio-item.token.mjs +4 -4
  41. package/esm2022/roving-focus/src/roving-focus-group.directive.mjs +8 -8
  42. package/esm2022/roving-focus/src/roving-focus-group.token.mjs +4 -4
  43. package/esm2022/roving-focus/src/roving-focus-item.directive.mjs +8 -8
  44. package/esm2022/roving-focus/src/roving-focus-item.token.mjs +4 -4
  45. package/esm2022/separator/src/separator.directive.mjs +6 -6
  46. package/esm2022/switch/index.mjs +2 -2
  47. package/esm2022/switch/src/switch-thumb.directive.mjs +5 -5
  48. package/esm2022/switch/src/switch.directive.mjs +11 -11
  49. package/esm2022/switch/src/switch.token.mjs +4 -4
  50. package/esm2022/toggle/index.mjs +2 -0
  51. package/esm2022/toggle/radix-ng-primitives-toggle.mjs +5 -0
  52. package/esm2022/toggle/src/toggle.directive.mjs +65 -0
  53. package/esm2022/tooltip/index.mjs +5 -0
  54. package/esm2022/tooltip/radix-ng-primitives-tooltip.mjs +5 -0
  55. package/esm2022/tooltip/src/tooltip-arrow.directive.mjs +17 -0
  56. package/esm2022/tooltip/src/tooltip-trigger.directive.mjs +148 -0
  57. package/esm2022/tooltip/src/tooltip-trigger.token.mjs +6 -0
  58. package/esm2022/tooltip/src/tooltip.config.mjs +31 -0
  59. package/esm2022/tooltip/src/tooltip.directive.mjs +46 -0
  60. package/esm2022/visually-hidden/src/visually-hidden.directive.mjs +5 -5
  61. package/fesm2022/radix-ng-primitives-avatar.mjs +167 -0
  62. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -0
  63. package/fesm2022/radix-ng-primitives-checkbox.mjs +32 -32
  64. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  65. package/fesm2022/radix-ng-primitives-label.mjs +5 -5
  66. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  67. package/fesm2022/radix-ng-primitives-overlay.mjs +399 -0
  68. package/fesm2022/radix-ng-primitives-overlay.mjs.map +1 -0
  69. package/fesm2022/radix-ng-primitives-progress.mjs +12 -12
  70. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  71. package/fesm2022/radix-ng-primitives-radio.mjs +48 -48
  72. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  73. package/fesm2022/radix-ng-primitives-roving-focus.mjs +15 -15
  74. package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
  75. package/fesm2022/radix-ng-primitives-separator.mjs +5 -5
  76. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  77. package/fesm2022/radix-ng-primitives-switch.mjs +34 -34
  78. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  79. package/fesm2022/radix-ng-primitives-toggle.mjs +72 -0
  80. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -0
  81. package/fesm2022/radix-ng-primitives-tooltip.mjs +242 -0
  82. package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -0
  83. package/fesm2022/radix-ng-primitives-visually-hidden.mjs +5 -5
  84. package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
  85. package/label/src/label.directive.d.ts +3 -3
  86. package/overlay/README.md +1 -0
  87. package/overlay/index.d.ts +4 -0
  88. package/overlay/src/overlay-arrow.directive.d.ts +29 -0
  89. package/overlay/src/overlay-arrow.token.d.ts +3 -0
  90. package/overlay/src/overlay-trigger.directive.d.ts +163 -0
  91. package/overlay/src/overlay-trigger.token.d.ts +7 -0
  92. package/overlay/src/overlay.directive.d.ts +29 -0
  93. package/overlay/src/overlay.token.d.ts +3 -0
  94. package/package.json +29 -4
  95. package/progress/src/progress-indicator.directive.d.ts +4 -4
  96. package/progress/src/progress.directive.d.ts +3 -3
  97. package/progress/src/progress.token.d.ts +3 -3
  98. package/radio/index.d.ts +1 -1
  99. package/radio/src/radio-group.directive.d.ts +3 -3
  100. package/radio/src/radio-group.token.d.ts +3 -3
  101. package/radio/src/radio-indicator.directive.d.ts +5 -5
  102. package/radio/src/radio-item.directive.d.ts +4 -4
  103. package/radio/src/radio-item.token.d.ts +3 -3
  104. package/roving-focus/src/roving-focus-group.directive.d.ts +7 -7
  105. package/roving-focus/src/roving-focus-group.token.d.ts +3 -3
  106. package/roving-focus/src/roving-focus-item.directive.d.ts +3 -3
  107. package/roving-focus/src/roving-focus-item.token.d.ts +3 -3
  108. package/separator/src/separator.directive.d.ts +3 -3
  109. package/switch/index.d.ts +1 -1
  110. package/switch/src/switch-thumb.directive.d.ts +4 -4
  111. package/switch/src/switch.directive.d.ts +3 -3
  112. package/switch/src/switch.token.d.ts +3 -3
  113. package/toggle/README.md +3 -0
  114. package/toggle/index.d.ts +1 -0
  115. package/toggle/src/toggle.directive.d.ts +30 -0
  116. package/tooltip/README.md +1 -0
  117. package/tooltip/index.d.ts +4 -0
  118. package/tooltip/src/tooltip-arrow.directive.d.ts +6 -0
  119. package/tooltip/src/tooltip-trigger.directive.d.ts +79 -0
  120. package/tooltip/src/tooltip-trigger.token.d.ts +4 -0
  121. package/tooltip/src/tooltip.config.d.ts +46 -0
  122. package/tooltip/src/tooltip.directive.d.ts +17 -0
  123. package/visually-hidden/src/visually-hidden.directive.d.ts +3 -3
@@ -0,0 +1,79 @@
1
+ import { OnInit, TemplateRef } from '@angular/core';
2
+ import { Placement } from '@floating-ui/dom';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "@radix-ng/primitives/overlay";
5
+ export declare class RdxTooltipTriggerDirective implements OnInit {
6
+ /**
7
+ * Access the overlay trigger directive
8
+ */
9
+ private readonly overlayTrigger;
10
+ /**
11
+ * Access the global tooltip configuration
12
+ */
13
+ private readonly tooltipConfig;
14
+ /**
15
+ * Define the tooltip to display when the trigger is activated.
16
+ */
17
+ templateRef: TemplateRef<void>;
18
+ /**
19
+ * Define if the trigger should be disabled.
20
+ * @default false
21
+ */
22
+ disabled: boolean;
23
+ /**
24
+ * Define the placement of the tooltip relative to the trigger.
25
+ * @default 'bottom'
26
+ */
27
+ placement: Placement;
28
+ /**
29
+ * Define the offset of the tooltip relative to the trigger.
30
+ * @default 0
31
+ */
32
+ offset: number;
33
+ /**
34
+ * Define the delay before the tooltip is displayed.
35
+ * @default 0
36
+ */
37
+ showDelay: number;
38
+ /**
39
+ * Define the delay before the tooltip is hidden.
40
+ * @default 0
41
+ */
42
+ hideDelay: number;
43
+ /**
44
+ * Define whether the tooltip should flip when there is not enough space for the tooltip.
45
+ * @default true
46
+ */
47
+ flip: boolean;
48
+ /**
49
+ * Define the container in to which the tooltip should be attached.
50
+ * @default document.body
51
+ */
52
+ container: HTMLElement;
53
+ /**
54
+ * The tooltip id.
55
+ */
56
+ protected tooltipId?: string;
57
+ ngOnInit(): void;
58
+ /**
59
+ * Show the tooltip.
60
+ */
61
+ show(): void;
62
+ /**
63
+ * Hide the tooltip.
64
+ */
65
+ hide(): void;
66
+ /**
67
+ * Define the tooltip id.
68
+ * @param id The tooltip id
69
+ * @internal
70
+ */
71
+ setTooltipId(id: string): void;
72
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxTooltipTriggerDirective, never>;
73
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTooltipTriggerDirective, "[rdxTooltipTrigger]", never, { "templateRef": { "alias": "rdxTooltipTrigger"; "required": true; }; "disabled": { "alias": "rdxTooltipDisabled"; "required": false; }; "placement": { "alias": "rdxTooltipPlacement"; "required": false; }; "offset": { "alias": "rdxTooltipOffset"; "required": false; }; "showDelay": { "alias": "rdxTooltipShowDelay"; "required": false; }; "hideDelay": { "alias": "rdxTooltipHideDelay"; "required": false; }; "flip": { "alias": "rdxTooltipFlip"; "required": false; }; "container": { "alias": "rdxTooltipContainer"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.RdxOverlayTriggerDirective; inputs: { "rdxOverlayTrigger": "rdxTooltipTrigger"; "rdxOverlayDisabled": "rdxTooltipDisabled"; "rdxOverlayPlacement": "rdxTooltipPlacement"; "rdxOverlayOffset": "rdxTooltipOffset"; "rdxOverlayShowDelay": "rdxTooltipShowDelay"; "rdxOverlayHideDelay": "rdxTooltipHideDelay"; "rdxOverlayShift": "rdxTooltipShift"; "rdxOverlayFlip": "rdxTooltipFlip"; "rdxOverlayContainer": "rdxTooltipContainer"; }; outputs: {}; }]>;
74
+ static ngAcceptInputType_disabled: unknown;
75
+ static ngAcceptInputType_offset: unknown;
76
+ static ngAcceptInputType_showDelay: unknown;
77
+ static ngAcceptInputType_hideDelay: unknown;
78
+ static ngAcceptInputType_flip: unknown;
79
+ }
@@ -0,0 +1,4 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import type { RdxTooltipTriggerDirective } from './tooltip-trigger.directive';
3
+ export declare const RdxTooltipTriggerToken: InjectionToken<RdxTooltipTriggerDirective>;
4
+ export declare function injectTooltipTrigger(): RdxTooltipTriggerDirective;
@@ -0,0 +1,46 @@
1
+ import { InjectionToken, Provider } from '@angular/core';
2
+ import { Placement } from '@floating-ui/dom';
3
+ export declare const TooltipConfigToken: InjectionToken<RdxTooltipConfig>;
4
+ export interface RdxTooltipConfig {
5
+ /**
6
+ * Define the offset of the tooltip relative to the trigger.
7
+ * @default 4
8
+ */
9
+ offset: number;
10
+ /**
11
+ * Define the placement of the tooltip relative to the trigger.
12
+ * @default 'top'
13
+ */
14
+ placement: Placement;
15
+ /**
16
+ * Define the delay before the tooltip is shown.
17
+ * @default 0
18
+ */
19
+ showDelay: number;
20
+ /**
21
+ * Define the delay before the tooltip is hidden.
22
+ * @default 0
23
+ */
24
+ hideDelay: number;
25
+ /**
26
+ * Define whether the tooltip should flip when there is not enough space for the tooltip.
27
+ * @default true
28
+ */
29
+ flip: boolean;
30
+ /**
31
+ * Define the container in to which the tooltip should be attached.
32
+ * @default document.body
33
+ */
34
+ container: HTMLElement;
35
+ }
36
+ /**
37
+ * Provide the default Tooltip configuration
38
+ * @param config The Tooltip configuration
39
+ * @returns The provider
40
+ */
41
+ export declare function provideTooltipConfig(config: Partial<RdxTooltipConfig>): Provider[];
42
+ /**
43
+ * Inject the Tooltip configuration
44
+ * @returns The global Tooltip configuration
45
+ */
46
+ export declare function injectTooltipConfig(): RdxTooltipConfig;
@@ -0,0 +1,17 @@
1
+ import { OnChanges, OnInit, SimpleChanges } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "@radix-ng/primitives/overlay";
4
+ export declare class RdxTooltipDirective implements OnInit, OnChanges {
5
+ /**
6
+ * Access the tooltip trigger
7
+ */
8
+ private readonly trigger;
9
+ /**
10
+ * Define the tooltip id
11
+ */
12
+ id: string;
13
+ ngOnInit(): void;
14
+ ngOnChanges(changes: SimpleChanges): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxTooltipDirective, never>;
16
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTooltipDirective, "[rdxTooltip]", ["rdxTooltip"], { "id": { "alias": "id"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.RdxOverlayDirective; inputs: {}; outputs: {}; }]>;
17
+ }
@@ -1,11 +1,11 @@
1
1
  import { OnInit } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
- export declare class VisuallyHiddenDirective implements OnInit {
3
+ export declare class RdxVisuallyHiddenDirective implements OnInit {
4
4
  /**
5
5
  * Access the element.
6
6
  */
7
7
  private readonly element;
8
8
  ngOnInit(): void;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<VisuallyHiddenDirective, never>;
10
- static ɵdir: i0.ɵɵDirectiveDeclaration<VisuallyHiddenDirective, "[rdxVisuallyHidden]", never, {}, {}, never, never, true, never>;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<RdxVisuallyHiddenDirective, never>;
10
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RdxVisuallyHiddenDirective, "[rdxVisuallyHidden]", never, {}, {}, never, never, true, never>;
11
11
  }