@tedi-design-system/angular 10.0.0-rc.7 → 10.0.0-rc.9
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
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# TEDI Design System for Angular
|
|
2
|
+
|
|
3
|
+
[](https://codecov.io/gh/TEDI-Design-System/angular)
|
|
4
|
+
[](https://github.com/semantic-release/semantic-release)
|
|
5
|
+
|
|
6
|
+
`@tedi-design-system/angular` is a library of Angular components implementing the TEDI Design System.
|
|
7
|
+
It provides reusable, accessible, and consistent UI components to streamline building Angular applications.
|
|
8
|
+
|
|
9
|
+
Component documentation, examples and APIs are in [Storybook](https://storybook.tedi.ee/angular/main/?path=/docs/documentation-get-started--get-started).
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Getting Started
|
|
14
|
+
|
|
15
|
+
### Installation
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
npm install @tedi-design-system/angular
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Peer dependencies: `@angular/core`, `@angular/common`, `@angular/forms`, `@angular/platform-browser` and `@angular/cdk` 20, 21 or 22. The text editor also needs `quill` and the `ngx-quill` major that matches your Angular version: 28 for Angular 20, 30 for 21 and 31 for 22. Design tokens, fonts and icons come from `@tedi-design-system/core`, which is installed with the package.
|
|
22
|
+
|
|
23
|
+
### Setup
|
|
24
|
+
|
|
25
|
+
Add the stylesheet (fonts, tokens and component styles) to `angular.json`, next to your app's own global styles:
|
|
26
|
+
|
|
27
|
+
```jsonc
|
|
28
|
+
// projects.<app>.architect.build.options
|
|
29
|
+
"styles": ["node_modules/@tedi-design-system/angular/index.css", "src/styles.scss"]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
To load only one Material Symbols style, use `index-without-icons.css` together with one of `icons/outlined.css`, `icons/rounded.css` or `icons/sharp.css`.
|
|
33
|
+
|
|
34
|
+
The text editor also needs Quill's stylesheets in your global styles:
|
|
35
|
+
|
|
36
|
+
```scss
|
|
37
|
+
// src/styles.scss
|
|
38
|
+
@forward "quill/dist/quill.core.css";
|
|
39
|
+
@forward "quill/dist/quill.snow.css";
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Provide the theme and language in your application config, and start `ThemeService` with the app:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
// app.config.ts
|
|
46
|
+
import { ApplicationConfig, inject, provideAppInitializer } from "@angular/core";
|
|
47
|
+
import { provideTedi, ThemeService } from "@tedi-design-system/angular/tedi";
|
|
48
|
+
|
|
49
|
+
export const appConfig: ApplicationConfig = {
|
|
50
|
+
providers: [
|
|
51
|
+
provideTedi({ language: "et", theme: "default" }),
|
|
52
|
+
provideAppInitializer(() => {
|
|
53
|
+
inject(ThemeService);
|
|
54
|
+
}),
|
|
55
|
+
],
|
|
56
|
+
};
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`ThemeService` sets the theme class on `<html>`. It is created only when something injects it, so without the initializer a theme other than `default`, or one saved in the `tedi-theme` cookie, is not applied on load.
|
|
60
|
+
|
|
61
|
+
### Usage
|
|
62
|
+
|
|
63
|
+
Components are standalone. Import them into the component that uses them:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
import { Component } from "@angular/core";
|
|
67
|
+
import { ButtonComponent } from "@tedi-design-system/angular/tedi";
|
|
68
|
+
|
|
69
|
+
@Component({
|
|
70
|
+
selector: "app-root",
|
|
71
|
+
imports: [ButtonComponent],
|
|
72
|
+
template: `<button tedi-button variant="primary">Save</button>`,
|
|
73
|
+
})
|
|
74
|
+
export class AppComponent {}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
TEDI-Ready components are exported from `@tedi-design-system/angular/tedi`, community components from `@tedi-design-system/angular/community`. The text editor has its own entry point, `@tedi-design-system/angular/community/text-editor`, so apps that don't use it don't need Quill. Prefer a TEDI-Ready component where one exists. Browse all components in [Storybook](https://storybook.tedi.ee/angular/main/?path=/docs/documentation-get-started--get-started).
|
|
78
|
+
|
|
79
|
+
### Supported versions
|
|
80
|
+
|
|
81
|
+
The library supports the three latest Angular majors, currently **Angular 20, 21 and 22**. See [Supported versions](https://github.com/TEDI-Design-System/general/wiki/Supported-versions) in the wiki for the policy and the [Angular release schedule](https://angular.dev/reference/releases) for upcoming dates.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Accessibility
|
|
86
|
+
|
|
87
|
+
TEDI follows EN 301 549 and, for web content, WCAG 2.2 level AA. Components released before TEDI moved to WCAG 2.2 were built and tested against WCAG 2.1 AA and are being reviewed for the new criteria.
|
|
88
|
+
|
|
89
|
+
The [accessibility page on tedi.ee](https://www.tedi.ee/1ee8444b7/p/33df89-sissejuhatus/b/05a2e8) (in Estonian) describes how components are tested, what TEDI covers and what stays with your project, and how to report an accessibility issue.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## AI Tooling
|
|
94
|
+
|
|
95
|
+
### For consumers: the `tedi-angular` skill
|
|
96
|
+
|
|
97
|
+
Helps AI coding agents build UIs with `@tedi-design-system/angular`: component usage, forms integration, theming and translation setup.
|
|
98
|
+
|
|
99
|
+
Install it into your agent (Claude Code, Cursor, Codex and others) with the [`skills`](https://www.skills.sh) CLI, from your project root:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx skills add https://github.com/TEDI-Design-System/angular --skill tedi-angular
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### For contributors: the `contributing` skill
|
|
106
|
+
|
|
107
|
+
Guides development inside this repository: creating new components, running tests and lint, WCAG audits, refactoring and Storybook stories. Available as `/contributing` when working in this repository. Skills for contributing across the design system live in [TEDI-Design-System/ai-skills](https://github.com/TEDI-Design-System/ai-skills).
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Contributing
|
|
112
|
+
|
|
113
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for how to report issues, set up the repository and open a pull request, and for adding or dropping an Angular major. Component guidelines and coding standards are in the [wiki](https://github.com/TEDI-Design-System/general/wiki).
|
|
114
|
+
|
|
115
|
+
To work on the library locally:
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
npm install
|
|
119
|
+
npm run start
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
`npm run start` launches Storybook for developing components in isolation.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Visual Testing
|
|
127
|
+
|
|
128
|
+
[](https://www.chromatic.com/)
|
|
129
|
+
|
|
130
|
+
We use [Chromatic](https://www.chromatic.com/) for visual testing, reviewing UI changes, and preventing visual regressions.
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
[MIT](LICENSE). The bundled fonts and the logos in `public/` are not covered, see [NOTICE.md](NOTICE.md).
|