@radix-ng/primitives 0.1.1 → 0.3.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.
- package/avatar/README.md +1 -0
- package/avatar/index.d.ts +4 -0
- package/avatar/src/avatar-fallback.directive.d.ts +34 -0
- package/avatar/src/avatar-image.directive.d.ts +17 -0
- package/avatar/src/avatar.config.d.ts +12 -0
- package/avatar/src/avatar.directive.d.ts +22 -0
- package/avatar/src/avatar.token.d.ts +4 -0
- package/checkbox/index.d.ts +1 -1
- package/esm2022/avatar/index.mjs +5 -0
- package/esm2022/avatar/radix-ng-primitives-avatar.mjs +5 -0
- package/esm2022/avatar/src/avatar-fallback.directive.mjs +61 -0
- package/esm2022/avatar/src/avatar-image.directive.mjs +50 -0
- package/esm2022/avatar/src/avatar.config.mjs +17 -0
- package/esm2022/avatar/src/avatar.directive.mjs +38 -0
- package/esm2022/avatar/src/avatar.token.mjs +6 -0
- package/esm2022/checkbox/index.mjs +2 -2
- package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +1 -1
- package/esm2022/checkbox/src/checkbox.directive.mjs +2 -2
- package/esm2022/checkbox/src/checkbox.token.mjs +2 -2
- package/esm2022/overlay/index.mjs +5 -0
- package/esm2022/overlay/radix-ng-primitives-overlay.mjs +5 -0
- package/esm2022/overlay/src/overlay-arrow.directive.mjs +59 -0
- package/esm2022/overlay/src/overlay-arrow.token.mjs +3 -0
- package/esm2022/overlay/src/overlay-trigger.directive.mjs +279 -0
- package/esm2022/overlay/src/overlay-trigger.token.mjs +9 -0
- package/esm2022/overlay/src/overlay.directive.mjs +51 -0
- package/esm2022/overlay/src/overlay.token.mjs +3 -0
- package/esm2022/progress/src/progress-indicator.directive.mjs +1 -1
- package/esm2022/progress/src/progress.directive.mjs +1 -1
- package/esm2022/progress/src/progress.token.mjs +2 -2
- package/esm2022/radio/index.mjs +6 -0
- package/esm2022/radio/radix-ng-primitives-radio.mjs +5 -0
- package/esm2022/radio/src/radio-group.directive.mjs +108 -0
- package/esm2022/radio/src/radio-group.token.mjs +6 -0
- package/esm2022/radio/src/radio-indicator.directive.mjs +30 -0
- package/esm2022/radio/src/radio-item.directive.mjs +79 -0
- package/esm2022/radio/src/radio-item.token.mjs +6 -0
- package/esm2022/roving-focus/src/roving-focus-group.directive.mjs +2 -2
- package/esm2022/roving-focus/src/roving-focus-group.token.mjs +2 -2
- package/esm2022/roving-focus/src/roving-focus-item.directive.mjs +2 -2
- package/esm2022/roving-focus/src/roving-focus-item.token.mjs +2 -2
- package/esm2022/separator/src/separator.directive.mjs +2 -2
- package/esm2022/switch/index.mjs +2 -2
- package/esm2022/switch/src/switch-thumb.directive.mjs +1 -1
- package/esm2022/switch/src/switch.directive.mjs +2 -2
- package/esm2022/switch/src/switch.token.mjs +2 -2
- package/esm2022/tooltip/index.mjs +5 -0
- package/esm2022/tooltip/radix-ng-primitives-tooltip.mjs +5 -0
- package/esm2022/tooltip/src/tooltip-arrow.directive.mjs +17 -0
- package/esm2022/tooltip/src/tooltip-trigger.directive.mjs +148 -0
- package/esm2022/tooltip/src/tooltip-trigger.token.mjs +6 -0
- package/esm2022/tooltip/src/tooltip.config.mjs +31 -0
- package/esm2022/tooltip/src/tooltip.directive.mjs +46 -0
- package/esm2022/visually-hidden/src/visually-hidden.directive.mjs +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +167 -0
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-checkbox.mjs +21 -21
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-overlay.mjs +399 -0
- package/fesm2022/radix-ng-primitives-overlay.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +221 -0
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +23 -23
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +242 -0
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
- package/overlay/README.md +1 -0
- package/overlay/index.d.ts +4 -0
- package/overlay/src/overlay-arrow.directive.d.ts +29 -0
- package/overlay/src/overlay-arrow.token.d.ts +3 -0
- package/overlay/src/overlay-trigger.directive.d.ts +163 -0
- package/overlay/src/overlay-trigger.token.d.ts +7 -0
- package/overlay/src/overlay.directive.d.ts +29 -0
- package/overlay/src/overlay.token.d.ts +3 -0
- package/package.json +29 -4
- package/radio/README.md +1 -0
- package/radio/index.d.ts +5 -0
- package/radio/src/radio-group.directive.d.ts +65 -0
- package/radio/src/radio-group.token.d.ts +4 -0
- package/radio/src/radio-indicator.directive.d.ts +13 -0
- package/radio/src/radio-item.directive.d.ts +36 -0
- package/radio/src/radio-item.token.d.ts +4 -0
- package/switch/index.d.ts +1 -1
- package/tooltip/README.md +1 -0
- package/tooltip/index.d.ts +4 -0
- package/tooltip/src/tooltip-arrow.directive.d.ts +6 -0
- package/tooltip/src/tooltip-trigger.directive.d.ts +79 -0
- package/tooltip/src/tooltip-trigger.token.d.ts +4 -0
- package/tooltip/src/tooltip.config.d.ts +46 -0
- package/tooltip/src/tooltip.directive.d.ts +17 -0
@@ -0,0 +1,65 @@
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
import * as i1 from "@radix-ng/primitives/roving-focus";
|
5
|
+
export declare class RadioGroupDirective implements ControlValueAccessor {
|
6
|
+
/**
|
7
|
+
* The value of the radio group.
|
8
|
+
*/
|
9
|
+
value?: string;
|
10
|
+
/**
|
11
|
+
* Whether the radio group is disabled.
|
12
|
+
*/
|
13
|
+
disabled: boolean;
|
14
|
+
/**
|
15
|
+
* The orientation of the radio group.
|
16
|
+
* @default 'horizontal'
|
17
|
+
*/
|
18
|
+
orientation: 'horizontal' | 'vertical';
|
19
|
+
/**
|
20
|
+
* Event emitted when the value of the radio group changes.
|
21
|
+
*/
|
22
|
+
readonly valueChange: EventEmitter<string>;
|
23
|
+
/**
|
24
|
+
* The callback function to call when the value of the radio group changes.
|
25
|
+
* @internal
|
26
|
+
*/
|
27
|
+
private onChange?;
|
28
|
+
/**
|
29
|
+
* The callback function to call when the radio group is touched.
|
30
|
+
* @internal
|
31
|
+
*/
|
32
|
+
private onTouched?;
|
33
|
+
/**
|
34
|
+
* Select a radio item.
|
35
|
+
* @param value The value of the radio item to select.
|
36
|
+
*/
|
37
|
+
select(value: string): void;
|
38
|
+
/**
|
39
|
+
* Update the value of the radio group.
|
40
|
+
* @param value The new value of the radio group.
|
41
|
+
* @internal
|
42
|
+
*/
|
43
|
+
writeValue(value: string): void;
|
44
|
+
/**
|
45
|
+
* Register a callback function to call when the value of the radio group changes.
|
46
|
+
* @param fn The callback function to call when the value of the radio group changes.
|
47
|
+
* @internal
|
48
|
+
*/
|
49
|
+
registerOnChange(fn: (value: string) => void): void;
|
50
|
+
registerOnTouched(fn: () => void): void;
|
51
|
+
/**
|
52
|
+
* Set the disabled state of the radio group.
|
53
|
+
* @param isDisabled Whether the radio group is disabled.
|
54
|
+
* @internal
|
55
|
+
*/
|
56
|
+
setDisabledState(isDisabled: boolean): void;
|
57
|
+
/**
|
58
|
+
* When focus leaves the radio group, mark it as touched.
|
59
|
+
* @internal
|
60
|
+
*/
|
61
|
+
protected onFocusout(): void;
|
62
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RadioGroupDirective, never>;
|
63
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RadioGroupDirective, "[rdxRadioGroup]", never, { "value": { "alias": "rdxRadioGroupValue"; "required": false; }; "disabled": { "alias": "rdxRadioGroupDisabled"; "required": false; }; "orientation": { "alias": "rdxRadioGroupOrientation"; "required": false; }; }, { "valueChange": "rdxRadioGroupValueChange"; }, never, never, true, [{ directive: typeof i1.RovingFocusGroupDirective; inputs: {}; outputs: {}; }]>;
|
64
|
+
static ngAcceptInputType_disabled: unknown;
|
65
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
export declare class RadioIndicatorDirective {
|
3
|
+
/**
|
4
|
+
* Access the radio group.
|
5
|
+
*/
|
6
|
+
protected readonly radioGroup: import("@radix-ng/primitives/radio").RadioGroupDirective;
|
7
|
+
/**
|
8
|
+
* Access the radio group item.
|
9
|
+
*/
|
10
|
+
protected readonly radioItem: import("@radix-ng/primitives/radio").RadioItemDirective;
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RadioIndicatorDirective, never>;
|
12
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RadioIndicatorDirective, "[rdxRadioIndicator]", never, {}, {}, never, never, true, never>;
|
13
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
import * as i1 from "@radix-ng/primitives/roving-focus";
|
3
|
+
export declare class RadioItemDirective {
|
4
|
+
/**
|
5
|
+
* Access the radio group.
|
6
|
+
*/
|
7
|
+
protected readonly radioGroup: import("@radix-ng/primitives/radio").RadioGroupDirective;
|
8
|
+
/**
|
9
|
+
* The value of the radio item.
|
10
|
+
*/
|
11
|
+
value: string;
|
12
|
+
/**
|
13
|
+
* Whether the radio item is disabled.
|
14
|
+
* @default false
|
15
|
+
*/
|
16
|
+
disabled: boolean;
|
17
|
+
/**
|
18
|
+
* Handle keydown events.
|
19
|
+
* @param event The keydown event.
|
20
|
+
* @internal
|
21
|
+
*/
|
22
|
+
protected onKeydown(event: KeyboardEvent): void;
|
23
|
+
/**
|
24
|
+
* When the item receives focus, select it.
|
25
|
+
* @internal
|
26
|
+
*/
|
27
|
+
protected onFocus(): void;
|
28
|
+
/**
|
29
|
+
* When the item receives a click, select it.
|
30
|
+
* @internal
|
31
|
+
*/
|
32
|
+
protected onClick(): void;
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RadioItemDirective, never>;
|
34
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RadioItemDirective, "button[rdxRadioItem]", never, { "value": { "alias": "value"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.RovingFocusItemDirective; inputs: {}; outputs: {}; }]>;
|
35
|
+
static ngAcceptInputType_disabled: unknown;
|
36
|
+
}
|
package/switch/index.d.ts
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
# @radix-ng/primitives/tooltip
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
import * as i1 from "@radix-ng/primitives/overlay";
|
3
|
+
export declare class TooltipArrowDirective {
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TooltipArrowDirective, never>;
|
5
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipArrowDirective, "[rdxTooltipArrow]", never, {}, {}, never, never, true, [{ directive: typeof i1.OverlayArrowDirective; inputs: {}; outputs: {}; }]>;
|
6
|
+
}
|
@@ -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 TooltipTriggerDirective 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<TooltipTriggerDirective, never>;
|
73
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipTriggerDirective, "[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.OverlayTriggerDirective; 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 { TooltipTriggerDirective } from './tooltip-trigger.directive';
|
3
|
+
export declare const TooltipTriggerToken: InjectionToken<TooltipTriggerDirective>;
|
4
|
+
export declare function injectTooltipTrigger(): TooltipTriggerDirective;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { InjectionToken, Provider } from '@angular/core';
|
2
|
+
import { Placement } from '@floating-ui/dom';
|
3
|
+
export declare const TooltipConfigToken: InjectionToken<TooltipConfig>;
|
4
|
+
export interface TooltipConfig {
|
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<TooltipConfig>): Provider[];
|
42
|
+
/**
|
43
|
+
* Inject the Tooltip configuration
|
44
|
+
* @returns The global Tooltip configuration
|
45
|
+
*/
|
46
|
+
export declare function injectTooltipConfig(): TooltipConfig;
|
@@ -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 TooltipDirective 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<TooltipDirective, never>;
|
16
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[rdxTooltip]", ["rdxTooltip"], { "id": { "alias": "id"; "required": false; }; }, {}, never, never, true, [{ directive: typeof i1.OverlayDirective; inputs: {}; outputs: {}; }]>;
|
17
|
+
}
|