@radix-ng/primitives 0.1.0 → 0.2.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/README.md +2 -4
- package/checkbox/src/checkbox-indicator.directive.d.ts +6 -0
- package/checkbox/src/checkbox.directive.d.ts +71 -0
- package/checkbox/src/checkbox.token.d.ts +4 -0
- package/esm2022/checkbox/index.mjs +4 -0
- package/esm2022/checkbox/radix-ng-primitives-checkbox.mjs +5 -0
- package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +23 -0
- package/esm2022/checkbox/src/checkbox.directive.mjs +135 -0
- package/esm2022/checkbox/src/checkbox.token.mjs +6 -0
- package/esm2022/index.mjs +2 -0
- package/esm2022/label/index.mjs +2 -0
- package/esm2022/label/radix-ng-primitives-label.mjs +5 -0
- package/esm2022/label/src/label.directive.mjs +46 -0
- package/esm2022/progress/index.mjs +3 -0
- package/esm2022/progress/radix-ng-primitives-progress.mjs +5 -0
- package/esm2022/progress/src/progress-indicator.directive.mjs +23 -0
- package/esm2022/progress/src/progress.directive.mjs +62 -0
- package/esm2022/progress/src/progress.token.mjs +6 -0
- 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/radix-ng-primitives.mjs +5 -0
- package/esm2022/roving-focus/index.mjs +5 -0
- package/esm2022/roving-focus/radix-ng-primitives-roving-focus.mjs +5 -0
- package/esm2022/roving-focus/src/roving-focus-group.directive.mjs +115 -0
- package/esm2022/roving-focus/src/roving-focus-group.token.mjs +9 -0
- package/esm2022/roving-focus/src/roving-focus-item.directive.mjs +91 -0
- package/esm2022/roving-focus/src/roving-focus-item.token.mjs +6 -0
- package/esm2022/separator/index.mjs +2 -0
- package/esm2022/separator/radix-ng-primitives-separator.mjs +5 -0
- package/esm2022/separator/src/separator.directive.mjs +37 -0
- package/esm2022/switch/index.mjs +4 -0
- package/esm2022/switch/radix-ng-primitives-switch.mjs +5 -0
- package/esm2022/switch/src/switch-thumb.directive.mjs +25 -0
- package/esm2022/switch/src/switch.directive.mjs +125 -0
- package/esm2022/switch/src/switch.token.mjs +6 -0
- package/esm2022/visually-hidden/index.mjs +2 -0
- package/esm2022/visually-hidden/radix-ng-primitives-visually-hidden.mjs +5 -0
- package/esm2022/visually-hidden/src/visually-hidden.directive.mjs +42 -0
- package/fesm2022/radix-ng-primitives-checkbox.mjs +166 -0
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-label.mjs +53 -0
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-progress.mjs +93 -0
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -0
- 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 +220 -0
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-separator.mjs +44 -0
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-switch.mjs +158 -0
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +49 -0
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives.mjs +4 -0
- package/fesm2022/radix-ng-primitives.mjs.map +1 -0
- package/label/src/label.directive.d.ts +14 -0
- package/package.json +88 -24
- package/progress/src/progress-indicator.directive.d.ts +6 -0
- package/progress/src/progress.directive.d.ts +26 -0
- package/progress/src/progress.token.d.ts +4 -0
- 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/roving-focus/src/roving-focus-group.directive.d.ts +55 -0
- package/roving-focus/src/roving-focus-group.token.d.ts +7 -0
- package/roving-focus/src/roving-focus-item.directive.d.ts +52 -0
- package/roving-focus/src/roving-focus-item.token.d.ts +4 -0
- package/separator/src/separator.directive.d.ts +16 -0
- package/switch/src/switch-thumb.directive.d.ts +9 -0
- package/switch/src/switch.directive.d.ts +73 -0
- package/switch/src/switch.token.d.ts +4 -0
- package/visually-hidden/src/visually-hidden.directive.d.ts +11 -0
- package/.docs/overview/accessibility.docs.mdx +0 -45
- package/.docs/overview/installation.docs.mdx +0 -15
- package/.docs/overview/introduction.docs.mdx +0 -59
- package/.docs/utils/storybook.ts +0 -30
- package/.eslintrc.json +0 -56
- package/.storybook/helpers/bages-config.ts +0 -43
- package/.storybook/main.ts +0 -24
- package/.storybook/manager-head.html +0 -76
- package/.storybook/manager.ts +0 -6
- package/.storybook/preview.ts +0 -58
- package/.storybook/rdxTheme.ts +0 -8
- package/.storybook/tsconfig.json +0 -20
- package/CHANGELOG.md +0 -6
- package/checkbox/ng-package.json +0 -5
- package/checkbox/src/checkbox-indicator.directive.ts +0 -15
- package/checkbox/src/checkbox.directive.ts +0 -138
- package/checkbox/src/checkbox.token.ts +0 -8
- package/checkbox/stories/checkbox.component.ts +0 -50
- package/checkbox/stories/checkbox.stories.ts +0 -29
- package/checkbox/stories/style.css +0 -265
- package/jest.config.ts +0 -22
- package/label/ng-package.json +0 -5
- package/label/src/label.directive.ts +0 -36
- package/label/stories/label.docs.mdx +0 -40
- package/label/stories/label.stories.ts +0 -63
- package/ng-package.json +0 -7
- package/progress/ng-package.json +0 -5
- package/progress/src/progress-indicator.directive.ts +0 -15
- package/progress/src/progress.directive.ts +0 -51
- package/progress/src/progress.token.ts +0 -8
- package/progress/stories/progress.docs.mdx +0 -66
- package/progress/stories/progress.stories.ts +0 -61
- package/project.json +0 -90
- package/roving-focus/ng-package.json +0 -5
- package/roving-focus/src/roving-focus-group.directive.ts +0 -135
- package/roving-focus/src/roving-focus-group.token.ts +0 -13
- package/roving-focus/src/roving-focus-item.directive.ts +0 -98
- package/roving-focus/src/roving-focus-item.token.ts +0 -10
- package/separator/ng-package.json +0 -5
- package/separator/src/separator.directive.spec.ts +0 -59
- package/separator/src/separator.directive.ts +0 -24
- package/separator/stories/separator.docs.mdx +0 -38
- package/separator/stories/separator.stories.ts +0 -91
- package/switch/ng-package.json +0 -5
- package/switch/src/switch-thumb.directive.ts +0 -17
- package/switch/src/switch.directive.ts +0 -132
- package/switch/src/switch.token.ts +0 -8
- package/switch/stories/switch.docs.mdx +0 -74
- package/switch/stories/switch.stories.ts +0 -76
- package/test-setup.ts +0 -8
- package/tsconfig.json +0 -32
- package/tsconfig.lib.json +0 -19
- package/tsconfig.lib.prod.json +0 -9
- package/tsconfig.spec.json +0 -21
- package/visually-hidden/ng-package.json +0 -5
- package/visually-hidden/src/visually-hidden.directive.spec.ts +0 -48
- package/visually-hidden/src/visually-hidden.directive.ts +0 -35
- package/visually-hidden/stories/visually-hidden.docs.mdx +0 -35
- /package/checkbox/{index.ts → index.d.ts} +0 -0
- /package/{index.ts → index.d.ts} +0 -0
- /package/label/{index.ts → index.d.ts} +0 -0
- /package/progress/{index.ts → index.d.ts} +0 -0
- /package/roving-focus/{index.ts → index.d.ts} +0 -0
- /package/separator/{index.ts → index.d.ts} +0 -0
- /package/switch/{index.ts → index.d.ts} +0 -0
- /package/visually-hidden/{index.ts → index.d.ts} +0 -0
@@ -0,0 +1,52 @@
|
|
1
|
+
import { FocusableOption } from '@angular/cdk/a11y';
|
2
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class RovingFocusItemDirective implements OnInit, OnDestroy, FocusableOption {
|
5
|
+
/**
|
6
|
+
* Access the group the roving focus item belongs to.
|
7
|
+
*/
|
8
|
+
private readonly group;
|
9
|
+
/**
|
10
|
+
* Access the element reference of the roving focus item.
|
11
|
+
*/
|
12
|
+
private readonly elementRef;
|
13
|
+
/**
|
14
|
+
* Access the destroyRef
|
15
|
+
*/
|
16
|
+
private readonly destroyRef;
|
17
|
+
/**
|
18
|
+
* Access the change detector ref
|
19
|
+
*/
|
20
|
+
private readonly changeDetectorRef;
|
21
|
+
/**
|
22
|
+
* Define the order of the roving focus item in the group.
|
23
|
+
*/
|
24
|
+
order: number;
|
25
|
+
/**
|
26
|
+
* Define if the item is disabled.
|
27
|
+
*/
|
28
|
+
disabled: boolean;
|
29
|
+
/**
|
30
|
+
* Derive the tabindex of the roving focus item.
|
31
|
+
* @internal
|
32
|
+
*/
|
33
|
+
get tabindex(): number;
|
34
|
+
ngOnInit(): void;
|
35
|
+
ngOnDestroy(): void;
|
36
|
+
/**
|
37
|
+
* Handle key events on the roving focus item.
|
38
|
+
* @param event The key event.
|
39
|
+
* @internal
|
40
|
+
*/
|
41
|
+
onKeydown(event: KeyboardEvent): void;
|
42
|
+
/**
|
43
|
+
* Focus the roving focus item.
|
44
|
+
* @param origin The origin of the focus request.
|
45
|
+
* @internal
|
46
|
+
*/
|
47
|
+
focus(): void;
|
48
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RovingFocusItemDirective, never>;
|
49
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RovingFocusItemDirective, "[rdxRovingFocusItem]", never, { "order": { "alias": "order"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
50
|
+
static ngAcceptInputType_order: unknown;
|
51
|
+
static ngAcceptInputType_disabled: unknown;
|
52
|
+
}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
2
|
+
import type { RovingFocusItemDirective } from './roving-focus-item.directive';
|
3
|
+
export declare const RovingFocusItemToken: InjectionToken<RovingFocusItemDirective>;
|
4
|
+
export declare function injectRovingFocusItem(): RovingFocusItemDirective;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
export declare class SeparatorDirective {
|
3
|
+
/**
|
4
|
+
* The orientation of the separator.
|
5
|
+
* @default 'horizontal'
|
6
|
+
*/
|
7
|
+
orientation: 'horizontal' | 'vertical';
|
8
|
+
/**
|
9
|
+
* Whether the separator is for decoration purposes. If true, the separator will not be included in the accessibility tree.
|
10
|
+
* @default false
|
11
|
+
*/
|
12
|
+
decorative: boolean;
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SeparatorDirective, never>;
|
14
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SeparatorDirective, "[rdxSeparator]", never, { "orientation": { "alias": "rdxSeparatorOrientation"; "required": false; }; "decorative": { "alias": "rdxSeparatorDecorative"; "required": false; }; }, {}, never, never, true, never>;
|
15
|
+
static ngAcceptInputType_decorative: unknown;
|
16
|
+
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
export declare class SwitchThumbDirective {
|
3
|
+
/**
|
4
|
+
* Access the switch directive.
|
5
|
+
*/
|
6
|
+
protected readonly switch: import("@radix-ng/primitives/switch").SwitchDirective;
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SwitchThumbDirective, never>;
|
8
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SwitchThumbDirective, "[rdxSwitchThumb]", never, {}, {}, never, never, true, never>;
|
9
|
+
}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
2
|
+
import { ControlValueAccessor } from '@angular/forms';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class SwitchDirective implements ControlValueAccessor {
|
5
|
+
/**
|
6
|
+
* Access the element ref.
|
7
|
+
*/
|
8
|
+
private readonly elementRef;
|
9
|
+
/**
|
10
|
+
* Determine if the switch is a button
|
11
|
+
*/
|
12
|
+
protected isButton: boolean;
|
13
|
+
/**
|
14
|
+
* Determine if the switch is checked.
|
15
|
+
* The controlled state of the switch.
|
16
|
+
* @default false
|
17
|
+
*/
|
18
|
+
checked: boolean;
|
19
|
+
/**
|
20
|
+
* Determine if the switch is disabled.
|
21
|
+
* When true, prevents the user from interacting with the switch.
|
22
|
+
* @default false
|
23
|
+
*/
|
24
|
+
disabled: boolean;
|
25
|
+
/**
|
26
|
+
* Event emitted when the checked state changes.
|
27
|
+
*/
|
28
|
+
readonly checkedChange: EventEmitter<boolean>;
|
29
|
+
/**
|
30
|
+
* Store the onChange callback.
|
31
|
+
*/
|
32
|
+
private onChange?;
|
33
|
+
/**
|
34
|
+
* Store the onTouched callback.
|
35
|
+
*/
|
36
|
+
protected onTouched?: () => void;
|
37
|
+
/**
|
38
|
+
* Register the onChange callback.
|
39
|
+
* @param fn The onChange callback.
|
40
|
+
* @internal
|
41
|
+
*/
|
42
|
+
registerOnChange(fn: (checked: boolean) => void): void;
|
43
|
+
/**
|
44
|
+
* Register the onTouched callback.
|
45
|
+
* @param fn The onTouched callback.
|
46
|
+
* @internal
|
47
|
+
*/
|
48
|
+
registerOnTouched(fn: () => void): void;
|
49
|
+
/**
|
50
|
+
* Write the value to the checked state.
|
51
|
+
* @param checked The checked state.
|
52
|
+
* @internal
|
53
|
+
*/
|
54
|
+
writeValue(checked: boolean): void;
|
55
|
+
/**
|
56
|
+
* Set the disabled state.
|
57
|
+
* @param isDisabled The disabled state.
|
58
|
+
* @internal
|
59
|
+
*/
|
60
|
+
setDisabledState(isDisabled: boolean): void;
|
61
|
+
/**
|
62
|
+
* Toggle the checked state.
|
63
|
+
*/
|
64
|
+
toggle(): void;
|
65
|
+
/**
|
66
|
+
* Handle the keydown event.
|
67
|
+
*/
|
68
|
+
protected onKeyDown(): void;
|
69
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SwitchDirective, never>;
|
70
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SwitchDirective, "[rdxSwitch]", never, { "checked": { "alias": "checked"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "checkedChange": "checkedChange"; }, never, never, true, never>;
|
71
|
+
static ngAcceptInputType_checked: unknown;
|
72
|
+
static ngAcceptInputType_disabled: unknown;
|
73
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { OnInit } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export declare class VisuallyHiddenDirective implements OnInit {
|
4
|
+
/**
|
5
|
+
* Access the element.
|
6
|
+
*/
|
7
|
+
private readonly element;
|
8
|
+
ngOnInit(): void;
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VisuallyHiddenDirective, never>;
|
10
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<VisuallyHiddenDirective, "[rdxVisuallyHidden]", never, {}, {}, never, never, true, never>;
|
11
|
+
}
|
@@ -1,45 +0,0 @@
|
|
1
|
-
import { Meta } from '@storybook/addon-docs';
|
2
|
-
|
3
|
-
<Meta
|
4
|
-
title="Overview/Accessibility"
|
5
|
-
description="Radix Primitives follow the WAI-ARIA authoring practices guidelines and are tested in a wide selection of modern browsers and commonly used assistive technologies."
|
6
|
-
/>
|
7
|
-
|
8
|
-
# Accessibility
|
9
|
-
|
10
|
-
Radix Primitives follow the WAI-ARIA authoring practices guidelines and are
|
11
|
-
tested in a wide selection of modern browsers and commonly used assistive
|
12
|
-
technologies.
|
13
|
-
|
14
|
-
We take care of many of the difficult implementation details related to accessibility, including `aria` and `role` attributes, focus management, and keyboard navigation. That means that users should be able to use our components as-is in most contexts and rely on functionality to follow the expected accessibility design patterns.
|
15
|
-
|
16
|
-
## WAI-ARIA
|
17
|
-
|
18
|
-
[WAI-ARIA](https://www.w3.org/TR/wai-aria-1.2/), published and maintained by the W3C, specifies the semantics for many common UI patterns that show up in Radix Primitives. This is designed to provide meaning for controls that aren't built using elements provided by the browser. For example, if you use a `div` instead of a `button` element to create a button, there are attributes you need to add to the `div` in order to convey that it's a button for screen readers or voice recognition tools.
|
19
|
-
|
20
|
-
In addition to semantics, there are behaviors that are expected from different types of components. A `button` element is going to respond to certain interactions in ways that a `div` will not, so it's up to the developer to reimplement those interactions with JavaScript. The [WAI-ARIA authoring practices](https://www.w3.org/TR/wai-aria-practices-1.2/) provide additional guidance for implementing behaviors for various controls that come with Radix Primitives.
|
21
|
-
|
22
|
-
## Accessible Labels
|
23
|
-
|
24
|
-
With many built-in form controls, the native HTML `label` element is designed to provide semantic meaning and context for corresponding `input` elements. For non-form control elements,
|
25
|
-
or for custom controls like those provided by Radix Primitives, [WAI-ARIA provides a specification](https://www.w3.org/TR/wai-aria-1.2/#namecalculation) for how to provide accessible names and descriptions to those controls.
|
26
|
-
|
27
|
-
Where possible, Radix Primitives include abstractions to make labelling our controls simple. The `Label` primitive is designed to work with many of our controls.
|
28
|
-
Ultimately it's up to you to provide those labels so that users have the proper context when navigating your application.
|
29
|
-
|
30
|
-
## Keyboard Navigation
|
31
|
-
|
32
|
-
Many complex components, like `Tabs` and `Dialog`, come with expectations from users on how to interact with their content using a keyboard or other non-mouse input modalities.
|
33
|
-
Radix Primitives provide basic keyboard support in accordance with the [WAI-ARIA authoring practices](https://www.w3.org/TR/wai-aria-practices-1.2/).
|
34
|
-
|
35
|
-
## Focus Management
|
36
|
-
|
37
|
-
Proper keyboard navigation and good labelling often go hand-in-hand with managing focus. When a user interacts with an element and something changes as a result, it's often helpful to move focus with the interaction so that the next tab stop is logical depending on the new context of the app. And for screen reader users, moving focus often results in an announcement to convey this new context, which relies on proper labelling.
|
38
|
-
|
39
|
-
In many Radix Primitives, we move focus based on the interactions a user normally takes in a given component.
|
40
|
-
For example, in `AlertDialog`, when the modal is opened, focus is programmatically moved to a `Cancel` button
|
41
|
-
element to anticipate a response to the prompt.
|
42
|
-
|
43
|
-
|
44
|
-
Source: [Radix UI](https://www.radix-ui.com/)
|
45
|
-
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { Meta } from '@storybook/addon-docs';
|
2
|
-
|
3
|
-
<Meta
|
4
|
-
title="Overview/Installation"
|
5
|
-
/>
|
6
|
-
|
7
|
-
# Installation
|
8
|
-
|
9
|
-
A quick tutorial to walk through installing the packages, as well as the supported plugins.
|
10
|
-
|
11
|
-
|
12
|
-
## Installing the package
|
13
|
-
```bash
|
14
|
-
npm i @radix-ng/primitives
|
15
|
-
```
|
@@ -1,59 +0,0 @@
|
|
1
|
-
import { Meta } from '@storybook/addon-docs';
|
2
|
-
|
3
|
-
<Meta
|
4
|
-
title="Overview/Introduction"
|
5
|
-
/>
|
6
|
-
|
7
|
-
# Introduction
|
8
|
-
|
9
|
-
> Radix-NG is an unofficial Angular port of [Radix UI](https://www.radix-ui.com/), thus we share the same principal and vision when building primitives.
|
10
|
-
|
11
|
-
Radix Primitives is a low-level UI component library with a focus on accessibility, customization and developer experience. You can use these components either as the base layer of your design system, or adopt them incrementally.
|
12
|
-
|
13
|
-
|
14
|
-
## Vision
|
15
|
-
|
16
|
-
The common understanding among us regarding UI elements such as accordions, checkboxes, comboboxes, dialogs, dropdowns, selects, sliders, and tooltips is well-established, guided by standards like those [documented by WAI-ARIA](https://www.w3.org/TR/wai-aria-practices/#aria_ex). These elements are foundational to our shared language in web development.
|
17
|
-
|
18
|
-
Yet, the reality we face with the current web platform offerings falls short. These essential elements are often missing, underdeveloped, or rigid in customization options.
|
19
|
-
|
20
|
-
This forces developers into the challenging position of creating custom components from scratch, a task fraught with complexity. Consequently, the web is littered with components that fail to be accessible, perform poorly, and miss critical functionality.
|
21
|
-
|
22
|
-
We aim to spearhead the development of an open-source, comprehensively funded library of components. This initiative seeks to empower the creation of design systems that are both accessible and rich in features, serving the needs of the community at large.
|
23
|
-
|
24
|
-
## Key Features
|
25
|
-
|
26
|
-
Components adhere to the [WAI-ARIA design patterns](https://www.w3.org/TR/wai-aria-practices-1.2) where possible. We handle many of the difficult implementation details related to accessibility, including aria and role attributes, focus management, and keyboard navigation. Learn more in our [accessibility](./accessibility) overview.
|
27
|
-
|
28
|
-
### Unstyled
|
29
|
-
|
30
|
-
Components ship with zero styles, giving you complete control over styling. Components can be styled with any styling solution (vanilla CSS, CSS preprocessors & etc).
|
31
|
-
|
32
|
-
### Opened
|
33
|
-
|
34
|
-
Radix Primitives are designed to be customized to suit your needs. Our open component architecture provides you granular access to each component part, so you can wrap them and add your own event listeners, props, or refs.
|
35
|
-
|
36
|
-
### Uncontrolled
|
37
|
-
|
38
|
-
Where applicable, components are uncontrolled by default but can also be controlled, alternatively. All of the behavior wiring is handled internally, so you can get up and running as smoothly as possible, without needing to create any local states.
|
39
|
-
|
40
|
-
## Community
|
41
|
-
|
42
|
-
### Telegram
|
43
|
-
To get involved to community, ask questions, and share tips.
|
44
|
-
|
45
|
-
[Join our Telegram](https://t.me/radixng)
|
46
|
-
|
47
|
-
### GitHub
|
48
|
-
To file issues, request features, and contribute, check out our GitHub.
|
49
|
-
|
50
|
-
[GitHub repo](https://github.com/radix-ng/primitives)
|
51
|
-
|
52
|
-
## Credits
|
53
|
-
|
54
|
-
All credits go to these open-source works and resources
|
55
|
-
|
56
|
-
- [Radix UI](https://radix-ui.com)
|
57
|
-
- [Radix Vue](https://radix-vue.com)
|
58
|
-
- [Radix Svelte](https://radix-svelte.com)
|
59
|
-
- [Spartan UI](https://www.spartan.ng/)
|
package/.docs/utils/storybook.ts
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Targets strings which start with underscore or with 'ng'. E.g. _internalStuff or ngOnInit.
|
3
|
-
*
|
4
|
-
* This has been set as default value for Storybook stories controls in preview.js
|
5
|
-
* If you need to append the list, just provide a string[] with list of props to exclude.
|
6
|
-
*/
|
7
|
-
|
8
|
-
export const excludeRegex = (array?: string[]): RegExp => {
|
9
|
-
const joined: string | null = array ? array.join('|') : null;
|
10
|
-
|
11
|
-
const joinedWithRegexOr = `|^(${joined})$`;
|
12
|
-
|
13
|
-
return new RegExp(`(^(?:_|ng)[a-zA-Z0-9]\\w+)${joinedWithRegexOr}`);
|
14
|
-
};
|
15
|
-
|
16
|
-
export const separatorExclude: RegExp = excludeRegex([]);
|
17
|
-
|
18
|
-
export const labelExclude: RegExp = excludeRegex(['onMouseDown', 'htmlFor']);
|
19
|
-
|
20
|
-
export const switchExclude: RegExp = excludeRegex([
|
21
|
-
'elementRef',
|
22
|
-
'isButton',
|
23
|
-
'onChange',
|
24
|
-
'onTouched',
|
25
|
-
'onKeyDown',
|
26
|
-
'registerOnTouched',
|
27
|
-
'registerOnChange',
|
28
|
-
'setDisabledState',
|
29
|
-
'writeValue'
|
30
|
-
]);
|
package/.eslintrc.json
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"extends": [
|
3
|
-
"../../.eslintrc.json"
|
4
|
-
],
|
5
|
-
"ignorePatterns": [
|
6
|
-
"!**/*"
|
7
|
-
],
|
8
|
-
"overrides": [
|
9
|
-
{
|
10
|
-
"files": [
|
11
|
-
"*.ts"
|
12
|
-
],
|
13
|
-
"extends": [
|
14
|
-
"plugin:@nx/angular",
|
15
|
-
"plugin:@angular-eslint/template/process-inline-templates"
|
16
|
-
],
|
17
|
-
"rules": {
|
18
|
-
"@angular-eslint/directive-selector": [
|
19
|
-
"error",
|
20
|
-
{
|
21
|
-
"type": "attribute",
|
22
|
-
"prefix": "rdx",
|
23
|
-
"style": "camelCase"
|
24
|
-
}
|
25
|
-
],
|
26
|
-
"@angular-eslint/component-selector": [
|
27
|
-
"error",
|
28
|
-
{
|
29
|
-
"type": "element",
|
30
|
-
"prefix": "rdx",
|
31
|
-
"style": "kebab-case"
|
32
|
-
}
|
33
|
-
],
|
34
|
-
"@angular-eslint/no-host-metadata-property": "off"
|
35
|
-
}
|
36
|
-
},
|
37
|
-
{
|
38
|
-
"files": [
|
39
|
-
"*.html"
|
40
|
-
],
|
41
|
-
"extends": [
|
42
|
-
"plugin:@nx/angular-template"
|
43
|
-
],
|
44
|
-
"rules": {}
|
45
|
-
},
|
46
|
-
{
|
47
|
-
"files": [
|
48
|
-
"*.json"
|
49
|
-
],
|
50
|
-
"parser": "jsonc-eslint-parser",
|
51
|
-
"rules": {
|
52
|
-
"@nx/dependency-checks": "error"
|
53
|
-
}
|
54
|
-
}
|
55
|
-
]
|
56
|
-
}
|
@@ -1,43 +0,0 @@
|
|
1
|
-
import { BadgesConfig } from '@geometricpanda/storybook-addon-badges';
|
2
|
-
|
3
|
-
export enum BADGE {
|
4
|
-
BETA,
|
5
|
-
PREVIEW,
|
6
|
-
UPDATED,
|
7
|
-
SOON
|
8
|
-
}
|
9
|
-
|
10
|
-
export const badgesConfig: BadgesConfig = {
|
11
|
-
[BADGE.BETA]: {
|
12
|
-
styles: {
|
13
|
-
backgroundColor: 'color(display-p3 1 1 1/0.8)',
|
14
|
-
color: 'gray',
|
15
|
-
borderColor: 'color(display-p3 0.008 0.008 0.165/0.15)'
|
16
|
-
},
|
17
|
-
title: 'Beta'
|
18
|
-
},
|
19
|
-
[BADGE.PREVIEW]: {
|
20
|
-
styles: {
|
21
|
-
backgroundColor: 'color(display-p3 1 1 1/0.8)',
|
22
|
-
color: 'gray',
|
23
|
-
borderColor: 'color(display-p3 0.008 0.008 0.165/0.15)'
|
24
|
-
},
|
25
|
-
title: 'Preview'
|
26
|
-
},
|
27
|
-
[BADGE.UPDATED]: {
|
28
|
-
styles: {
|
29
|
-
backgroundColor: 'color(display-p3 1 1 1/0.8)',
|
30
|
-
color: 'gray',
|
31
|
-
borderColor: 'color(display-p3 0.008 0.008 0.165/0.15)'
|
32
|
-
},
|
33
|
-
title: 'Updated'
|
34
|
-
},
|
35
|
-
[BADGE.SOON]: {
|
36
|
-
styles: {
|
37
|
-
backgroundColor: 'color(display-p3 1 1 1/0.8)',
|
38
|
-
color: 'gray',
|
39
|
-
borderColor: 'color(display-p3 0.008 0.008 0.165/0.15)'
|
40
|
-
},
|
41
|
-
title: 'Soon'
|
42
|
-
}
|
43
|
-
};
|
package/.storybook/main.ts
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
import type { StorybookConfig } from '@storybook/angular';
|
2
|
-
|
3
|
-
const config: StorybookConfig = {
|
4
|
-
stories: ['../.docs/**/*.docs.mdx', '../**/*.docs.mdx', '../**/*.stories.@(js|ts)'],
|
5
|
-
|
6
|
-
addons: [
|
7
|
-
'@storybook/addon-essentials',
|
8
|
-
'@storybook/addon-docs',
|
9
|
-
'@storybook/addon-backgrounds',
|
10
|
-
'@geometricpanda/storybook-addon-badges'
|
11
|
-
],
|
12
|
-
|
13
|
-
framework: {
|
14
|
-
name: '@storybook/angular',
|
15
|
-
options: {}
|
16
|
-
},
|
17
|
-
|
18
|
-
core: {
|
19
|
-
builder: '@storybook/builder-webpack5',
|
20
|
-
disableTelemetry: true
|
21
|
-
}
|
22
|
-
};
|
23
|
-
|
24
|
-
export default config;
|
@@ -1,76 +0,0 @@
|
|
1
|
-
|
2
|
-
<!-- Open Graph general (Facebook, Pinterest & Google+) -->
|
3
|
-
<meta property="og:type" content="website" />
|
4
|
-
<meta property="og:title" content="Radix Angular UI Primitives" />
|
5
|
-
<meta property="og:locale" content="en_US" />
|
6
|
-
<meta
|
7
|
-
property="og:description"
|
8
|
-
content="Angular Primitives is a low-level UI component library."
|
9
|
-
/>
|
10
|
-
<meta property="og:image:alt" content="Radix Angular display image" />
|
11
|
-
|
12
|
-
<!-- Twitter -->
|
13
|
-
<meta property="twitter:card" content="summary_large_image" />
|
14
|
-
|
15
|
-
<!-- Yandex.Metrika counter -->
|
16
|
-
<script type="text/javascript" >
|
17
|
-
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
|
18
|
-
m[i].l=1*new Date();
|
19
|
-
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
|
20
|
-
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
|
21
|
-
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
|
22
|
-
|
23
|
-
ym(97017282, "init", {
|
24
|
-
clickmap:true,
|
25
|
-
trackLinks:true,
|
26
|
-
accurateTrackBounce:true
|
27
|
-
});
|
28
|
-
</script>
|
29
|
-
<noscript><div><img src="https://mc.yandex.ru/watch/97017282" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
30
|
-
<!-- /Yandex.Metrika counter -->
|
31
|
-
|
32
|
-
<!-- customize the sidebar icons -->
|
33
|
-
<svg
|
34
|
-
xmlns="http://www.w3.org/2000/svg"
|
35
|
-
data-chromatic="ignore"
|
36
|
-
style="position: absolute; width: 0px; height: 0px"
|
37
|
-
>
|
38
|
-
<symbol id="icon--folder" viewBox="0 0 32 32">
|
39
|
-
<path
|
40
|
-
fill="currentColor"
|
41
|
-
stroke="currentColor"
|
42
|
-
stroke-width="1"
|
43
|
-
d="M28.667 8H14.934c-.533 0-.933-.133-1.2-.4l-2.933-2.8c-.533-.533-1.333-.8-2.133-.8H3.335c-1.067 0-2 .933-2 2v22h29.333V10c0-1.067-.933-2-2-2zm.666 18.667H2.666V6c0-.4.267-.667.667-.667h5.333c.533 0 .933.133 1.2.4l2.8 2.8c.667.533 1.467.8 2.267.8h13.733c.4 0 .667.267.667.667v16.667z"
|
44
|
-
/>
|
45
|
-
</symbol>
|
46
|
-
<symbol id="icon--component" viewBox="0 0 32 32">
|
47
|
-
<path
|
48
|
-
fill="currentColor"
|
49
|
-
stroke="currentColor"
|
50
|
-
stroke-width="1"
|
51
|
-
d="M28 9.333V4.266c0-.8-.8-1.6-1.6-1.6h-5.067c-.667 0-1.2.267-1.733.667l-1.733 1.733c-.133.133-.4.267-.8.267H5.6c-.8 0-1.6.8-1.6 1.6v2.4H0v20h32v-20h-4zm-22.667-2.4c0-.133.133-.267.267-.267h11.467c.667 0 1.2-.267 1.733-.667l1.733-1.733c.267-.133.533-.267.8-.267h4.933c.267 0 .4.133.4.267v5.067H5.333v-2.4zM30.667 28H1.334V10.667h29.333V28z"
|
52
|
-
/>
|
53
|
-
<path
|
54
|
-
fill="currentColor"
|
55
|
-
stroke="currentColor"
|
56
|
-
stroke-width="1"
|
57
|
-
d="M10.667 14.667h10.667V16H10.667v-1.333z"
|
58
|
-
/>
|
59
|
-
</symbol>
|
60
|
-
<symbol id="icon--document" viewBox="0 0 32 32">
|
61
|
-
<path
|
62
|
-
fill="currentColor"
|
63
|
-
stroke="currentColor"
|
64
|
-
stroke-width="1"
|
65
|
-
d="M5.333 2.667v26.666H20l6.667-6.666v-20H5.333zM20.667 26.78v-3.554h3.554l-3.554 3.554zm4.666-4.888h-6V28H6.667V4h18.666v17.893zM22.667 8.667H9.333V7.333h13.334v1.334zm0 4H9.333v-1.334h13.334v1.334zm0 4H9.333v-1.334h13.334v1.334z"
|
66
|
-
/>
|
67
|
-
</symbol>
|
68
|
-
<symbol id="icon--bookmarkhollow" viewBox="0 0 32 32">
|
69
|
-
<path
|
70
|
-
fill="currentColor"
|
71
|
-
stroke="currentColor"
|
72
|
-
stroke-width="1"
|
73
|
-
d="M20.9 1.3H4.6c-1.1 0-2 .9-2 2v16l4.098-3.21v.338H6.7V30.6H28V8.4l-7.1-7.1zm.4 6.6V3.6l2.2 2.2L25.7 8h-4.4v-.1zM4.6 2.7h8.1c.3 0 .6.3.6.6v13.3l-3.8-3-.8-.6-.8.6-3.8 3V3.3c-.1-.3.2-.6.5-.6zm22.1 26.7H8V15.2l-.001.001v-.13L8.6 14.6l6 4.7v-16c0-.2 0-.4-.1-.6H20v6.6h6.7v20.1z"
|
74
|
-
/>
|
75
|
-
</symbol>
|
76
|
-
</svg>
|
package/.storybook/manager.ts
DELETED
package/.storybook/preview.ts
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
import { Preview } from '@storybook/angular';
|
2
|
-
import { setCompodocJson } from '@storybook/addon-docs/angular';
|
3
|
-
import docJson from './documentation.json';
|
4
|
-
import { badgesConfig } from './helpers/bages-config';
|
5
|
-
|
6
|
-
setCompodocJson(docJson);
|
7
|
-
|
8
|
-
const preview: Preview = {
|
9
|
-
decorators: [
|
10
|
-
(Story, context) => {
|
11
|
-
const storyAnchor = `anchor--${context.id}`;
|
12
|
-
const existAnchor = context.canvasElement.closest(`#${storyAnchor}`);
|
13
|
-
const storyContainer = context.canvasElement.closest('.sbdocs');
|
14
|
-
|
15
|
-
if (!existAnchor && storyContainer) {
|
16
|
-
storyContainer.id = storyAnchor;
|
17
|
-
}
|
18
|
-
|
19
|
-
return Story(context);
|
20
|
-
}
|
21
|
-
],
|
22
|
-
parameters: {
|
23
|
-
docs: {
|
24
|
-
toc: {
|
25
|
-
contentsSelector: '.sbdocs-content',
|
26
|
-
headingSelector: 'h2, h3',
|
27
|
-
ignoreSelector: '#primary',
|
28
|
-
title: 'On this page',
|
29
|
-
disable: false,
|
30
|
-
unsafeTocbotOptions: {
|
31
|
-
orderedList: false
|
32
|
-
}
|
33
|
-
}
|
34
|
-
},
|
35
|
-
backgrounds: {
|
36
|
-
default: 'blue',
|
37
|
-
values: [
|
38
|
-
{
|
39
|
-
name: 'blue',
|
40
|
-
value: 'linear-gradient(330deg,color(display-p3 0.523 0.318 0.751) 0,color(display-p3 0.276 0.384 0.837) 100%)'
|
41
|
-
},
|
42
|
-
{
|
43
|
-
name: 'white',
|
44
|
-
value: '#ffffff'
|
45
|
-
}
|
46
|
-
]
|
47
|
-
},
|
48
|
-
options: {
|
49
|
-
storySort: {
|
50
|
-
method: 'alphabetical',
|
51
|
-
order: ['Overview', ['Introduction', 'Installation'], 'Primitives']
|
52
|
-
}
|
53
|
-
},
|
54
|
-
badgesConfig
|
55
|
-
}
|
56
|
-
};
|
57
|
-
|
58
|
-
export default preview;
|
package/.storybook/rdxTheme.ts
DELETED
package/.storybook/tsconfig.json
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"extends": "../tsconfig.json",
|
3
|
-
"compilerOptions": {
|
4
|
-
"emitDecoratorMetadata": true,
|
5
|
-
"resolveJsonModule": true,
|
6
|
-
"allowSyntheticDefaultImports": true
|
7
|
-
},
|
8
|
-
"exclude": [
|
9
|
-
"../**/*.spec.ts"
|
10
|
-
],
|
11
|
-
"include": [
|
12
|
-
"../**/*.stories.ts",
|
13
|
-
"../**/*.stories.js",
|
14
|
-
"../**/*.stories.jsx",
|
15
|
-
"../**/*.stories.tsx",
|
16
|
-
"../**/*.stories.mdx",
|
17
|
-
"*.js",
|
18
|
-
"*.ts"
|
19
|
-
]
|
20
|
-
}
|
package/CHANGELOG.md
DELETED
package/checkbox/ng-package.json
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
import { Directive } from '@angular/core';
|
2
|
-
import { injectCheckbox } from './checkbox.token';
|
3
|
-
|
4
|
-
@Directive({
|
5
|
-
selector: '[rdxCheckboxIndicator]',
|
6
|
-
standalone: true,
|
7
|
-
host: {
|
8
|
-
'[style.pointer-events]': '"none"',
|
9
|
-
'[attr.data-state]': 'checkbox.state',
|
10
|
-
'[attr.data-disabled]': 'checkbox.disabled ? "" : null'
|
11
|
-
}
|
12
|
-
})
|
13
|
-
export class CheckboxIndicatorDirective {
|
14
|
-
protected readonly checkbox = injectCheckbox();
|
15
|
-
}
|