semmet-angular 0.42.0 → 0.43.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.en.md +2 -315
- package/README.md +169 -264
- package/package.json +2 -2
- package/src/accordion/files/__name@dasherize__/__name@dasherize__.css.template +4 -41
- package/src/accordion/schema.json +19 -4
- package/src/alert/files/__name@dasherize__/__name@dasherize__.css.template +1 -25
- package/src/alert/files/__name@dasherize__/__name@dasherize__.html.template +3 -3
- package/src/alert/files/__name@dasherize__/__name@dasherize__.ts.template +4 -1
- package/src/alert/schema.json +19 -4
- package/src/alert-dialog/files/__name@dasherize__/__name@dasherize__.css.template +3 -56
- package/src/alert-dialog/files/__name@dasherize__/__name@dasherize__.html.template +6 -6
- package/src/alert-dialog/files/__name@dasherize__/__name@dasherize__.ts.template +7 -1
- package/src/alert-dialog/schema.json +19 -4
- package/src/avatar/files/__name@dasherize__/__name@dasherize__.css.template +17 -0
- package/src/avatar/files/__name@dasherize__/__name@dasherize__.html.template +28 -0
- package/src/avatar/files/__name@dasherize__/__name@dasherize__.spec.ts.template +27 -0
- package/src/avatar/files/__name@dasherize__/__name@dasherize__.ts.template +35 -0
- package/src/avatar/index.d.ts +1 -0
- package/src/avatar/index.js +6 -0
- package/src/avatar/index.js.map +1 -0
- package/src/avatar/index.ts +3 -0
- package/src/avatar/schema.d.ts +1 -0
- package/src/avatar/schema.js +3 -0
- package/src/avatar/schema.js.map +1 -0
- package/src/avatar/schema.json +44 -0
- package/src/avatar/schema.ts +1 -0
- package/src/badge/files/__name@dasherize__/__name@dasherize__.css.template +0 -77
- package/src/badge/files/__name@dasherize__/__name@dasherize__.ts.template +2 -5
- package/src/badge/schema.json +19 -4
- package/src/block/files/__name@dasherize__/__name@dasherize__.css.template +10 -81
- package/src/block/files/__name@dasherize__/__name@dasherize__.html.template +33 -25
- package/src/block/files/__name@dasherize__/__name@dasherize__.ts.template +41 -10
- package/src/block/schema.json +19 -4
- package/src/breadcrumb/files/__name@dasherize__/__name@dasherize__.css.template +2 -23
- package/src/breadcrumb/files/__name@dasherize__/__name@dasherize__.html.template +4 -4
- package/src/breadcrumb/files/__name@dasherize__/__name@dasherize__.ts.template +9 -5
- package/src/breadcrumb/schema.json +19 -4
- package/src/button/files/__name@dasherize__/__name@dasherize__.css.template +2 -79
- package/src/button/files/__name@dasherize__/__name@dasherize__.ts.template +2 -5
- package/src/button/schema.json +19 -4
- package/src/button-group/files/__name@dasherize__/__name@dasherize__.css.template +2 -70
- package/src/button-group/files/__name@dasherize__/__name@dasherize__.ts.template +1 -2
- package/src/button-group/schema.json +19 -4
- package/src/card/files/__name@dasherize__/__name@dasherize__.css.template +0 -67
- package/src/card/files/__name@dasherize__/__name@dasherize__.html.template +10 -55
- package/src/card/files/__name@dasherize__/__name@dasherize__.ts.template +2 -45
- package/src/card/schema.json +19 -4
- package/src/carousel/files/__name@dasherize__/__name@dasherize__.css.template +2 -32
- package/src/carousel/files/__name@dasherize__/__name@dasherize__.html.template +4 -4
- package/src/carousel/files/__name@dasherize__/__name@dasherize__.ts.template +4 -0
- package/src/carousel/schema.json +19 -4
- package/src/checkbox/files/__name@dasherize__/__name@dasherize__.css.template +5 -21
- package/src/checkbox/schema.json +19 -4
- package/src/close-button/files/__name@dasherize__/__name@dasherize__.css.template +9 -47
- package/src/close-button/files/__name@dasherize__/__name@dasherize__.ts.template +2 -5
- package/src/close-button/schema.json +19 -4
- package/src/collection.json +15 -0
- package/src/combobox/files/__name@dasherize__/__name@dasherize__.css.template +4 -49
- package/src/combobox/files/__name@dasherize__/__name@dasherize__.html.template +2 -2
- package/src/combobox/files/__name@dasherize__/__name@dasherize__.ts.template +11 -8
- package/src/combobox/schema.json +19 -4
- package/src/dialog/files/__name@dasherize__/__name@dasherize__.css.template +3 -45
- package/src/dialog/files/__name@dasherize__/__name@dasherize__.html.template +5 -5
- package/src/dialog/files/__name@dasherize__/__name@dasherize__.ts.template +6 -1
- package/src/dialog/schema.json +19 -4
- package/src/disclosure/files/__name@dasherize__/__name@dasherize__.css.template +4 -36
- package/src/disclosure/schema.json +19 -4
- package/src/form/files/__name@dasherize__/__name@dasherize__.css.template +1 -77
- package/src/form/files/__name@dasherize__/__name@dasherize__.html.template +7 -7
- package/src/form/files/__name@dasherize__/__name@dasherize__.ts.template +20 -7
- package/src/form/schema.json +19 -4
- package/src/input/files/__name@dasherize__/__name@dasherize__.css.template +2 -58
- package/src/input/schema.json +19 -4
- package/src/input-group/files/__name@dasherize__/__name@dasherize__.css.template +2 -68
- package/src/input-group/files/__name@dasherize__/__name@dasherize__.html.template +13 -5
- package/src/input-group/files/__name@dasherize__/__name@dasherize__.ts.template +21 -6
- package/src/input-group/schema.json +19 -4
- package/src/landmarks/files/__name@dasherize__/__name@dasherize__.css.template +0 -24
- package/src/landmarks/files/__name@dasherize__/__name@dasherize__.html.template +2 -2
- package/src/landmarks/files/__name@dasherize__/__name@dasherize__.ts.template +5 -2
- package/src/landmarks/schema.json +19 -4
- package/src/list-group/files/__name@dasherize__/__name@dasherize__.css.template +0 -123
- package/src/list-group/files/__name@dasherize__/__name@dasherize__.e2e-spec.ts.template +8 -9
- package/src/list-group/files/__name@dasherize__/__name@dasherize__.html.template +13 -47
- package/src/list-group/files/__name@dasherize__/__name@dasherize__.spec.ts.template +46 -24
- package/src/list-group/files/__name@dasherize__/__name@dasherize__.ts.template +97 -39
- package/src/list-group/schema.json +19 -4
- package/src/listbox/files/__name@dasherize__/__name@dasherize__.css.template +3 -37
- package/src/listbox/files/__name@dasherize__/__name@dasherize__.html.template +2 -2
- package/src/listbox/files/__name@dasherize__/__name@dasherize__.ts.template +3 -1
- package/src/listbox/schema.json +19 -4
- package/src/menu-button/files/__name@dasherize__/__name@dasherize__.css.template +7 -47
- package/src/menu-button/files/__name@dasherize__/__name@dasherize__.html.template +3 -3
- package/src/menu-button/files/__name@dasherize__/__name@dasherize__.ts.template +10 -7
- package/src/menu-button/schema.json +19 -4
- package/src/meter/files/__name@dasherize__/__name@dasherize__.css.template +0 -12
- package/src/meter/files/__name@dasherize__/__name@dasherize__.html.template +2 -2
- package/src/meter/files/__name@dasherize__/__name@dasherize__.ts.template +3 -1
- package/src/meter/schema.json +19 -4
- package/src/navbar/files/__name@dasherize__/__name@dasherize__.css.template +6 -62
- package/src/navbar/schema.json +19 -4
- package/src/navigation-menu/files/__name@dasherize__/__name@dasherize__.css.template +6 -37
- package/src/navigation-menu/files/__name@dasherize__/__name@dasherize__.html.template +7 -6
- package/src/navigation-menu/files/__name@dasherize__/__name@dasherize__.ts.template +15 -1
- package/src/navigation-menu/schema.json +19 -4
- package/src/offcanvas/files/__name@dasherize__/__name@dasherize__.css.template +3 -70
- package/src/offcanvas/schema.json +19 -4
- package/src/pagination/files/__name@dasherize__/__name@dasherize__.css.template +2 -33
- package/src/pagination/files/__name@dasherize__/__name@dasherize__.html.template +6 -6
- package/src/pagination/files/__name@dasherize__/__name@dasherize__.ts.template +7 -1
- package/src/pagination/schema.json +19 -4
- package/src/popover/files/__name@dasherize__/__name@dasherize__.css.template +8 -69
- package/src/popover/schema.json +19 -4
- package/src/progress-bar/files/__name@dasherize__/__name@dasherize__.css.template +1 -31
- package/src/progress-bar/files/__name@dasherize__/__name@dasherize__.html.template +3 -3
- package/src/progress-bar/files/__name@dasherize__/__name@dasherize__.ts.template +5 -1
- package/src/progress-bar/schema.json +19 -4
- package/src/radio-group/files/__name@dasherize__/__name@dasherize__.css.template +4 -31
- package/src/radio-group/files/__name@dasherize__/__name@dasherize__.html.template +2 -2
- package/src/radio-group/files/__name@dasherize__/__name@dasherize__.ts.template +2 -1
- package/src/radio-group/schema.json +19 -4
- package/src/rating/files/__name@dasherize__/__name@dasherize__.css.template +17 -0
- package/src/rating/files/__name@dasherize__/__name@dasherize__.html.template +34 -0
- package/src/rating/files/__name@dasherize__/__name@dasherize__.spec.ts.template +38 -0
- package/src/rating/files/__name@dasherize__/__name@dasherize__.ts.template +75 -0
- package/src/rating/index.d.ts +1 -0
- package/src/rating/index.js +6 -0
- package/src/rating/index.js.map +1 -0
- package/src/rating/index.ts +3 -0
- package/src/rating/schema.d.ts +1 -0
- package/src/rating/schema.js +3 -0
- package/src/rating/schema.js.map +1 -0
- package/src/rating/schema.json +44 -0
- package/src/rating/schema.ts +1 -0
- package/src/select/files/__name@dasherize__/__name@dasherize__.css.template +4 -55
- package/src/select/schema.json +19 -4
- package/src/skeleton/files/__name@dasherize__/__name@dasherize__.css.template +2 -29
- package/src/skeleton/files/__name@dasherize__/__name@dasherize__.ts.template +1 -3
- package/src/skeleton/schema.json +19 -4
- package/src/skip-link/files/__name@dasherize__/__name@dasherize__.css.template +2 -14
- package/src/skip-link/files/__name@dasherize__/__name@dasherize__.html.template +2 -2
- package/src/skip-link/files/__name@dasherize__/__name@dasherize__.ts.template +5 -2
- package/src/skip-link/schema.json +19 -4
- package/src/slider/files/__name@dasherize__/__name@dasherize__.css.template +6 -20
- package/src/slider/files/__name@dasherize__/__name@dasherize__.html.template +2 -2
- package/src/slider/files/__name@dasherize__/__name@dasherize__.ts.template +3 -1
- package/src/slider/schema.json +19 -4
- package/src/spinbutton/files/__name@dasherize__/__name@dasherize__.css.template +6 -35
- package/src/spinbutton/files/__name@dasherize__/__name@dasherize__.html.template +4 -4
- package/src/spinbutton/files/__name@dasherize__/__name@dasherize__.ts.template +5 -1
- package/src/spinbutton/schema.json +19 -4
- package/src/spinner/files/__name@dasherize__/__name@dasherize__.css.template +0 -43
- package/src/spinner/files/__name@dasherize__/__name@dasherize__.ts.template +2 -5
- package/src/spinner/schema.json +19 -4
- package/src/steps/files/__name@dasherize__/__name@dasherize__.css.template +36 -0
- package/src/steps/files/__name@dasherize__/__name@dasherize__.html.template +44 -0
- package/src/steps/files/__name@dasherize__/__name@dasherize__.spec.ts.template +35 -0
- package/src/steps/files/__name@dasherize__/__name@dasherize__.ts.template +107 -0
- package/src/steps/index.d.ts +1 -0
- package/src/steps/index.js +6 -0
- package/src/steps/index.js.map +1 -0
- package/src/steps/index.ts +3 -0
- package/src/steps/schema.d.ts +1 -0
- package/src/steps/schema.js +3 -0
- package/src/steps/schema.js.map +1 -0
- package/src/steps/schema.json +44 -0
- package/src/steps/schema.ts +1 -0
- package/src/switch/files/__name@dasherize__/__name@dasherize__.css.template +7 -22
- package/src/switch/schema.json +19 -4
- package/src/table/files/__name@dasherize__/__name@dasherize__.css.template +0 -25
- package/src/table/files/__name@dasherize__/__name@dasherize__.html.template +3 -3
- package/src/table/files/__name@dasherize__/__name@dasherize__.ts.template +3 -0
- package/src/table/schema.json +19 -4
- package/src/tabs/files/__name@dasherize__/__name@dasherize__.css.template +5 -44
- package/src/tabs/files/__name@dasherize__/__name@dasherize__.html.template +2 -2
- package/src/tabs/files/__name@dasherize__/__name@dasherize__.ts.template +2 -0
- package/src/tabs/schema.json +19 -4
- package/src/textarea/files/__name@dasherize__/__name@dasherize__.css.template +2 -59
- package/src/textarea/schema.json +19 -4
- package/src/toast/files/__name@dasherize__/__name@dasherize__.css.template +1 -35
- package/src/toast/files/__name@dasherize__/__name@dasherize__.html.template +4 -4
- package/src/toast/files/__name@dasherize__/__name@dasherize__.ts.template +5 -1
- package/src/toast/schema.json +19 -4
- package/src/toolbar/files/__name@dasherize__/__name@dasherize__.css.template +2 -36
- package/src/toolbar/files/__name@dasherize__/__name@dasherize__.html.template +3 -3
- package/src/toolbar/files/__name@dasherize__/__name@dasherize__.ts.template +11 -8
- package/src/toolbar/schema.json +19 -4
- package/src/tooltip/files/__name@dasherize__/__name@dasherize__.css.template +1 -32
- package/src/tooltip/schema.json +19 -4
- package/src/tree-view/files/__name@dasherize__/__name@dasherize__.css.template +5 -27
- package/src/tree-view/files/__name@dasherize__/__name@dasherize__.html.template +3 -3
- package/src/tree-view/files/__name@dasherize__/__name@dasherize__.ts.template +16 -13
- package/src/tree-view/schema.json +19 -4
- package/src/utils/generate-component.js +3 -1
- package/src/utils/generate-component.js.map +1 -1
- package/src/utils/generate-component.ts +3 -1
- package/src/utils/generate-composition.js +0 -1
- package/src/utils/generate-composition.js.map +1 -1
- package/src/utils/generate-composition.ts +0 -1
- package/src/utils/schema-types.d.ts +1 -0
- package/src/utils/schema-types.ts +1 -0
- package/README.pt-BR.md +0 -330
package/README.en.md
CHANGED
|
@@ -1,318 +1,5 @@
|
|
|
1
1
|
# semmet-angular
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The primary English documentation lives in [README.md](./README.md).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Semmet Angular helps teams generate, compose, test, verify, and package accessible Angular UI using the Angular CLI ecosystem.
|
|
8
|
-
|
|
9
|
-
**Generate. Compose. Test. Verify. Package.**
|
|
10
|
-
|
|
11
|
-
Read the broader product direction in [PRODUCT_VISION.md](./PRODUCT_VISION.md).
|
|
12
|
-
|
|
13
|
-
Brazilian Portuguese documentation is available in [README.md](./README.md).
|
|
14
|
-
|
|
15
|
-
`ng generate semmet-angular:accordion my-faq` scaffolds a standalone, signals-based Angular component — `.ts`/`.html`/`.css` — plus `.spec.ts` and `.e2e-spec.ts` smoke tests. The generated component implements a W3C ARIA Authoring Practices Guide pattern for real: correct roles and `aria-*` wiring, the keyboard/focus behavior the pattern requires (arrow-key navigation, focus traps, focus restoration...), and a consistent visual identity out of the box.
|
|
16
|
-
|
|
17
|
-
## Usage
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
ng add semmet-angular
|
|
21
|
-
ng generate semmet-angular:accordion my-faq
|
|
22
|
-
ng generate semmet-angular:block section-card
|
|
23
|
-
ng generate semmet-angular:ci
|
|
24
|
-
ng generate semmet-angular:docker
|
|
25
|
-
ng generate semmet-angular:deploy
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
`ng add semmet-angular` installs the package and configures the delivery workflow once for the target application, including Playwright e2e support, npm scripts, and `npm run verify`. Each generated component is dropped into your project exactly like `ng generate component` would (respecting your `angular.json` project, source root, and selector prefix), and has **zero runtime dependency** on this package — `semmet-angular` is only needed at generation time.
|
|
29
|
-
|
|
30
|
-
## Layered Architecture
|
|
31
|
-
|
|
32
|
-
Use isolated components when you need fine-grained control, or compositions when you want to accelerate accessible screens with validated structure.
|
|
33
|
-
|
|
34
|
-
- **Components**: isolated components such as `button`, `card`, `accordion`, `table`, and `navbar`.
|
|
35
|
-
- **Compositions / Blocks**: ready-made sections such as `section-card`, `section-faq`, `section-pricing`, `section-stats`, `section-table`, `section-form`, `section-tabs`, `section-list-group`, `section-alert`, `section-progress`, `section-carousel`, `header-navbar`, `footer-navigation`, and `command-list`.
|
|
36
|
-
- **Delivery**: `ng add`, `ci`, `docker`, `deploy`, and `verify`.
|
|
37
|
-
|
|
38
|
-
## Composition Commands
|
|
39
|
-
|
|
40
|
-
Compositions/blocks generate standalone Angular sections using the matching Semmet components. Generated CSS stays local to the block and uses local spacing tokens to keep landing-page rhythm without injecting global styles into the application.
|
|
41
|
-
|
|
42
|
-
| Command | Generates | Built from |
|
|
43
|
-
|---|---|---|
|
|
44
|
-
| `ng generate semmet-angular:block hero` | Semantic hero section | Section structure |
|
|
45
|
-
| `ng generate semmet-angular:block section-card` | Card section | `card` |
|
|
46
|
-
| `ng generate semmet-angular:block section-faq` | FAQ section | `accordion` |
|
|
47
|
-
| `ng generate semmet-angular:block section-pricing` | Pricing section | `card` |
|
|
48
|
-
| `ng generate semmet-angular:block section-stats` | Stats section | Section structure |
|
|
49
|
-
| `ng generate semmet-angular:block section-table` | Table section | `table` |
|
|
50
|
-
| `ng generate semmet-angular:block section-form` | Form section | `form` |
|
|
51
|
-
| `ng generate semmet-angular:block section-tabs` | Tabs section | `tabs` |
|
|
52
|
-
| `ng generate semmet-angular:block section-list-group` | Action list section | `list-group` |
|
|
53
|
-
| `ng generate semmet-angular:block section-alert` | Alert section | `alert` |
|
|
54
|
-
| `ng generate semmet-angular:block section-progress` | Progress section | `progress-bar` |
|
|
55
|
-
| `ng generate semmet-angular:block section-carousel` | Carousel section | `carousel` |
|
|
56
|
-
| `ng generate semmet-angular:block header-navbar` | Header navigation | `navbar` |
|
|
57
|
-
| `ng generate semmet-angular:block footer-navigation` | Footer navigation | `navbar` |
|
|
58
|
-
| `ng generate semmet-angular:block command-list` | Command list section | Section structure |
|
|
59
|
-
|
|
60
|
-
## Generated tests
|
|
61
|
-
|
|
62
|
-
Every component command generates test files next to the component:
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
my-faq.ts
|
|
66
|
-
my-faq.html
|
|
67
|
-
my-faq.css
|
|
68
|
-
my-faq.spec.ts
|
|
69
|
-
my-faq.e2e-spec.ts
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
The unit test uses Angular's `TestBed` to verify the component through its public selector. Interactive components also generate behavior-focused tests for their ARIA state, keyboard flow, value changes, focus management, and open/close behavior. The e2e test uses Playwright and becomes active as soon as the component is mounted in a route or host component. If the component has not been added to any rendered page yet, the generated e2e smoke test is skipped with a clear message instead of failing the whole suite.
|
|
73
|
-
|
|
74
|
-
After running `ng add semmet-angular`, use:
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
npm test
|
|
78
|
-
npm run e2e
|
|
79
|
-
npm run e2e:ui
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
`npm run e2e` runs Playwright against the Angular dev server configured by `playwright.config.ts`; `npm run e2e:ui` opens Playwright's interactive UI.
|
|
83
|
-
|
|
84
|
-
## GitHub Actions CI
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
ng generate semmet-angular:ci
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
This command generates `.github/workflows/ci.yml` using the package scripts that already exist in `package.json`. The workflow uses Node 24, detects the package manager by lockfile (`package-lock.json`, `pnpm-lock.yaml`, or `yarn.lock`), installs dependencies, and runs `verify` when available. If `verify` does not exist yet, it runs `build`, `test`, and `e2e` when those scripts exist.
|
|
91
|
-
|
|
92
|
-
When the project uses Playwright, the CI also installs Chromium with `playwright install --with-deps chromium` and caches `~/.cache/ms-playwright` with `actions/cache`, reducing follow-up run times.
|
|
93
|
-
|
|
94
|
-
By default, the command does not overwrite an existing workflow. Use `--force` when you want to replace `.github/workflows/ci.yml`.
|
|
95
|
-
|
|
96
|
-
## Docker Packaging
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
ng generate semmet-angular:docker
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
This command generates `Dockerfile`, `.dockerignore`, and `nginx.conf` to package the Angular application as an image served by Nginx. The Dockerfile uses Node 24 in the build stage, detects the package manager by lockfile, runs the build, and copies the output configured in `angular.json` to `/usr/share/nginx/html`.
|
|
103
|
-
|
|
104
|
-
The `nginx.conf` includes SPA fallback with `try_files ... /index.html`. By default, the command does not overwrite existing files; use `--force` to replace the current Docker configuration.
|
|
105
|
-
|
|
106
|
-
## Guided Deploy
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
ng generate semmet-angular:deploy
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
The command asks which platform you want to target and generates the minimal configuration for that destination. You can also pass the platform directly:
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
ng generate semmet-angular:deploy --platform=vercel
|
|
116
|
-
ng generate semmet-angular:deploy --platform=netlify
|
|
117
|
-
ng generate semmet-angular:deploy --platform=firebase
|
|
118
|
-
ng generate semmet-angular:deploy --platform=github-pages
|
|
119
|
-
ng generate semmet-angular:deploy --platform=docker
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
Supported targets: Vercel (`vercel.json`), Netlify (`netlify.toml`), Firebase Hosting (`firebase.json` and `.firebaserc`), GitHub Pages (`.github/workflows/deploy.yml`), and Docker-based deployment (`compose.yml` and `deploy/docker.README.md`). The command detects the build output from `angular.json` when possible and does not overwrite existing files without `--force`.
|
|
123
|
-
|
|
124
|
-
## Projected content containers
|
|
125
|
-
|
|
126
|
-
Some generated components are containers: they own the ARIA wiring, keyboard behavior, focus management, and visual shell, while your app owns the content rendered inside them.
|
|
127
|
-
|
|
128
|
-
`accordion`, `tabs`, `carousel`, `disclosure`, `card`, `button`, `badge`, `navbar`, `table`, and `button-group` use Angular's modern projection pattern with `ng-template`, signal queries, and `NgTemplateOutlet`. This means you can place real app components inside generated components without dynamic component factories.
|
|
129
|
-
|
|
130
|
-
Example after generating `faq`:
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
import { Component, signal } from '@angular/core';
|
|
134
|
-
import { Faq, FaqItem } from './faq/faq';
|
|
135
|
-
import { ProfilePanel } from './profile-panel/profile-panel';
|
|
136
|
-
import { SettingsPanel } from './settings-panel/settings-panel';
|
|
137
|
-
|
|
138
|
-
@Component({
|
|
139
|
-
selector: 'app-root',
|
|
140
|
-
imports: [Faq, FaqItem, ProfilePanel, SettingsPanel],
|
|
141
|
-
templateUrl: './app.html',
|
|
142
|
-
})
|
|
143
|
-
export class App {
|
|
144
|
-
readonly userId = signal(123);
|
|
145
|
-
|
|
146
|
-
reload(): void {}
|
|
147
|
-
}
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
```
|
|
151
|
-
<app-faq>
|
|
152
|
-
<ng-template faqItem id="profile" title="Profile" [expanded]="true">
|
|
153
|
-
<app-profile-panel />
|
|
154
|
-
</ng-template>
|
|
155
|
-
|
|
156
|
-
<ng-template faqItem id="settings" title="Settings">
|
|
157
|
-
<app-settings-panel [userId]="userId()" (saved)="reload()" />
|
|
158
|
-
</ng-template>
|
|
159
|
-
</app-faq>
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
The same pattern applies to `tabs`, `carousel`, and `disclosure`:
|
|
163
|
-
|
|
164
|
-
```
|
|
165
|
-
<app-settings-tabs>
|
|
166
|
-
<ng-template settingsTabsItem id="profile" label="Profile" [selected]="true">
|
|
167
|
-
<app-profile-panel />
|
|
168
|
-
</ng-template>
|
|
169
|
-
</app-settings-tabs>
|
|
170
|
-
|
|
171
|
-
<app-featured-carousel>
|
|
172
|
-
<ng-template featuredCarouselSlide id="intro" label="Introduction">
|
|
173
|
-
<app-intro-slide />
|
|
174
|
-
</ng-template>
|
|
175
|
-
</app-featured-carousel>
|
|
176
|
-
|
|
177
|
-
<app-details label="Show profile details" [(expanded)]="profileDetailsOpen">
|
|
178
|
-
<ng-template detailsContent>
|
|
179
|
-
<app-profile-details [userId]="userId()" />
|
|
180
|
-
</ng-template>
|
|
181
|
-
</app-details>
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
By default, projected panel/slide content is preserved after its first render. Set `[preserveContent]="false"` on the generated container to destroy inactive content when it closes or becomes inactive.
|
|
185
|
-
|
|
186
|
-
The smaller structural components keep their simple input APIs and add safe slots where the generated component still owns the accessible structure:
|
|
187
|
-
|
|
188
|
-
```
|
|
189
|
-
<app-product-card title="Accessible components">
|
|
190
|
-
<ng-template productCardMedia>
|
|
191
|
-
<img src="/assets/card.png" alt="Generated Angular component preview" />
|
|
192
|
-
</ng-template>
|
|
193
|
-
|
|
194
|
-
<ng-template productCardDescription>
|
|
195
|
-
Generate Angular components with ARIA, keyboard behavior and signals.
|
|
196
|
-
</ng-template>
|
|
197
|
-
|
|
198
|
-
<ng-template productCardActions>
|
|
199
|
-
<a href="/docs">Read docs</a>
|
|
200
|
-
</ng-template>
|
|
201
|
-
</app-product-card>
|
|
202
|
-
|
|
203
|
-
<app-save-button label="Save">
|
|
204
|
-
<ng-template saveButtonLeading>
|
|
205
|
-
<app-save-icon aria-hidden="true" />
|
|
206
|
-
</ng-template>
|
|
207
|
-
</app-save-button>
|
|
208
|
-
|
|
209
|
-
<app-status-badge accessibleLabel="Build passed">
|
|
210
|
-
<ng-template statusBadgeLabel>Passed</ng-template>
|
|
211
|
-
</app-status-badge>
|
|
212
|
-
|
|
213
|
-
<app-main-navbar brand="Acme">
|
|
214
|
-
<ng-template mainNavbarActions>
|
|
215
|
-
<a href="/account">Account</a>
|
|
216
|
-
</ng-template>
|
|
217
|
-
</app-main-navbar>
|
|
218
|
-
|
|
219
|
-
<app-results-table caption="Quarterly revenue" [rows]="results">
|
|
220
|
-
<ng-template resultsTableEmpty>No revenue results yet.</ng-template>
|
|
221
|
-
</app-results-table>
|
|
222
|
-
|
|
223
|
-
<app-view-switcher [items]="views">
|
|
224
|
-
<ng-template viewSwitcherItem let-item>
|
|
225
|
-
{{ item.label }}
|
|
226
|
-
</ng-template>
|
|
227
|
-
</app-view-switcher>
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
## Components, Blocks, and Delivery (43)
|
|
231
|
-
|
|
232
|
-
**Overlays & disclosure**
|
|
233
|
-
|
|
234
|
-
| Command | Generates | Keyboard/focus behavior implemented |
|
|
235
|
-
|---|---|---|
|
|
236
|
-
| `ng generate semmet-angular:accordion <name>` | [Accordion](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/) | Click/Enter/Space toggle; Up/Down/Home/End moves focus between headers |
|
|
237
|
-
| `ng generate semmet-angular:disclosure <name>` | [Disclosure](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/) | Click/Enter/Space toggle |
|
|
238
|
-
| `ng generate semmet-angular:dialog <name>` | [Dialog (Modal)](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/) | Focus moves in on open; Tab/Shift+Tab focus trap; Escape closes; focus returns to trigger on close |
|
|
239
|
-
| `ng generate semmet-angular:alert-dialog <name>` | [Alert Dialog](https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/) | Same focus trap as Dialog; initial focus on the least destructive action (Cancel) |
|
|
240
|
-
| `ng generate semmet-angular:offcanvas <name>` | Offcanvas / Drawer | Modal dialog semantics; focus moves in; Tab/Shift+Tab focus trap; Escape/backdrop close; focus returns to trigger |
|
|
241
|
-
| `ng generate semmet-angular:popover <name>` | Popover | Disclosure trigger with `aria-haspopup="dialog"`; Escape closes; outside click dismisses |
|
|
242
|
-
| `ng generate semmet-angular:tooltip <name>` | [Tooltip](https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/) | Shows on hover **and** focus (required for keyboard users); hides on blur/mouseleave/Escape |
|
|
243
|
-
| `ng generate semmet-angular:menu-button <name>` | [Menu Button](https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/) | Up/Down/Home/End/Escape inside the menu; closes on outside click; focus returns to the trigger |
|
|
244
|
-
| `ng generate semmet-angular:button <name>` | Button | Native `<button>` with variant, size, disabled, busy, optional pressed state, and safe label/icon slots |
|
|
245
|
-
| `ng generate semmet-angular:button-group <name>` | Button Group | Native grouped buttons with `role="group"`, optional `aria-pressed` toggle state, and safe item-label projection |
|
|
246
|
-
| `ng generate semmet-angular:close-button <name>` | Close Button | Native icon button with required accessible label |
|
|
247
|
-
|
|
248
|
-
**Navigation & structure**
|
|
249
|
-
|
|
250
|
-
| Command | Generates | Keyboard/focus behavior implemented |
|
|
251
|
-
|---|---|---|
|
|
252
|
-
| `ng generate semmet-angular:tabs <name>` | [Tabs](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/) | Automatic activation; Left/Right/Home/End with roving `tabindex` |
|
|
253
|
-
| `ng generate semmet-angular:breadcrumb <name>` | [Breadcrumb](https://www.w3.org/WAI/ARIA/apg/patterns/breadcrumb/) | Static — plain links + `aria-current="page"` |
|
|
254
|
-
| `ng generate semmet-angular:navigation-menu <name>` | [Navigation Menu (Disclosure)](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/examples/disclosure-navigation/) | Click/Enter/Space toggles the submenu — deliberately avoids `role="menu"`, reserved for app-style menus |
|
|
255
|
-
| `ng generate semmet-angular:navbar <name>` | Navbar | Semantic `nav`/list/link structure with responsive disclosure toggle, `aria-current`, and safe brand/action slots |
|
|
256
|
-
| `ng generate semmet-angular:pagination <name>` | Pagination | Working page state; Previous/Next disable at the boundaries |
|
|
257
|
-
| `ng generate semmet-angular:skip-link <name>` | [Skip Link](https://www.w3.org/WAI/WCAG21/Techniques/general/G1) | Hidden until focused, per the standard skip-link pattern |
|
|
258
|
-
| `ng generate semmet-angular:landmarks <name>` | [Landmarks (Page Skeleton)](https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/) | Content-projected layout wrapper (`header`/`nav`/`main`/`aside`/`footer` slots) |
|
|
259
|
-
| `ng generate semmet-angular:tree-view <name>` | [Tree View](https://www.w3.org/WAI/ARIA/apg/patterns/treeview/) | Up/Down/Left/Right/Home/End/Enter with roving `tabindex` across visible nodes |
|
|
260
|
-
| `ng generate semmet-angular:toolbar <name>` | [Toolbar](https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/) | Left/Right/Home/End with roving `tabindex` |
|
|
261
|
-
| `ng generate semmet-angular:card <name>` | Card | Semantic `<article>` with owned heading/description/action/media structure and safe projection slots |
|
|
262
|
-
| `ng generate semmet-angular:list-group <name>` | List Group | Semantic list structure with action items, active state, optional badges, and disabled states |
|
|
263
|
-
| `ng generate semmet-angular:table <name>` | [Table](https://www.w3.org/WAI/ARIA/apg/patterns/table/) | Caption + scoped headers, input rows, and safe caption/empty-state slots |
|
|
264
|
-
|
|
265
|
-
**Forms & inputs**
|
|
266
|
-
|
|
267
|
-
| Command | Generates | Keyboard/focus behavior implemented |
|
|
268
|
-
|---|---|---|
|
|
269
|
-
| `ng generate semmet-angular:form <name>` | Form | Native `<form>` with labeled controls, inline validation, and status messaging |
|
|
270
|
-
| `ng generate semmet-angular:input <name>` | Input | Native `<input>` with label, hint, validation message wiring, and signal-backed value |
|
|
271
|
-
| `ng generate semmet-angular:select <name>` | Select | Native `<select>` with label, hint, validation message wiring, and signal-backed value |
|
|
272
|
-
| `ng generate semmet-angular:input-group <name>` | Input Group | Native `<input>` with prefix/suffix addons announced via `aria-describedby` and optional action button |
|
|
273
|
-
| `ng generate semmet-angular:textarea <name>` | Textarea | Native `<textarea>` with label, hint, counter, validation message wiring, and signal-backed value |
|
|
274
|
-
| `ng generate semmet-angular:checkbox <name>` | [Checkbox](https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/) | Click/Enter/Space toggle |
|
|
275
|
-
| `ng generate semmet-angular:radio-group <name>` | [Radio Group](https://www.w3.org/WAI/ARIA/apg/patterns/radio/) | Up/Down/Left/Right/Home/End move focus and selection together |
|
|
276
|
-
| `ng generate semmet-angular:switch <name>` | [Switch](https://www.w3.org/WAI/ARIA/apg/patterns/switch/) | Native `<button>` — Click/Enter/Space toggle |
|
|
277
|
-
| `ng generate semmet-angular:combobox <name>` | [Combobox](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/) | Live filtering; Up/Down/Home/End/Enter/Escape via `aria-activedescendant` |
|
|
278
|
-
| `ng generate semmet-angular:listbox <name>` | [Listbox](https://www.w3.org/WAI/ARIA/apg/patterns/listbox/) | Up/Down/Home/End via `aria-activedescendant` |
|
|
279
|
-
| `ng generate semmet-angular:slider <name>` | [Slider](https://www.w3.org/WAI/ARIA/apg/patterns/slider/) | Arrow keys/PageUp/PageDown/Home/End, plus pointer drag |
|
|
280
|
-
| `ng generate semmet-angular:spinbutton <name>` | [Spinbutton](https://www.w3.org/WAI/ARIA/apg/patterns/spinbutton/) | Up/Down/Home/End, plus increment/decrement buttons |
|
|
281
|
-
| `ng generate semmet-angular:meter <name>` | [Meter](https://www.w3.org/TR/wai-aria-1.2/#meter) | Static — native `<meter>` bound to a signal |
|
|
282
|
-
| `ng generate semmet-angular:progress-bar <name>` | [Progress Bar](https://www.w3.org/TR/wai-aria-1.2/#progressbar) | Native `<progress>` bound to a signal |
|
|
283
|
-
|
|
284
|
-
**Feedback & media**
|
|
285
|
-
|
|
286
|
-
| Command | Generates | Keyboard/focus behavior implemented |
|
|
287
|
-
|---|---|---|
|
|
288
|
-
| `ng generate semmet-angular:alert <name>` | [Alert](https://www.w3.org/WAI/ARIA/apg/patterns/alert/) | Dismissible assertive live region |
|
|
289
|
-
| `ng generate semmet-angular:toast <name>` | Toast / Notification | Auto-dismisses after 5s (cleaned up via `DestroyRef`); dismissible early |
|
|
290
|
-
| `ng generate semmet-angular:skeleton <name>` | Skeleton Loading | Composable loading placeholder for text, media, circles, cards, and custom blocks |
|
|
291
|
-
| `ng generate semmet-angular:badge <name>` | Badge | Compact status label/counter with decorative mode, optional accessible label, and safe label projection |
|
|
292
|
-
| `ng generate semmet-angular:spinner <name>` | Spinner | Loading status with `role="status"`, visually hidden label by default, and reduced-motion support |
|
|
293
|
-
| `ng generate semmet-angular:carousel <name>` | [Carousel](https://www.w3.org/WAI/ARIA/apg/patterns/carousel/) | Previous/Next controls; `aria-live="polite"` slide region |
|
|
294
|
-
|
|
295
|
-
## What every generated component looks like
|
|
296
|
-
|
|
297
|
-
- Standalone (implicit — no `standalone: true` needed, matches Angular's current default).
|
|
298
|
-
- State via `signal()`/`computed()`, not plain class fields.
|
|
299
|
-
- Templates use the built-in control flow (`@for`, `@if`), not `*ngFor`/`*ngIf`.
|
|
300
|
-
- No `.component` suffix on file names or class names (`accordion.ts`, `export class Accordion`), matching the current `ng generate component` convention.
|
|
301
|
-
- A unique per-instance id (`<name>-0`, `<name>-1`, ...) so multiple instances of the same generated component never collide on `id`/`aria-controls`/`aria-labelledby`.
|
|
302
|
-
- A generated unit test (`.spec.ts`) and Playwright e2e smoke test (`.e2e-spec.ts`) so the component starts life with a test surface.
|
|
303
|
-
|
|
304
|
-
## Visual identity
|
|
305
|
-
|
|
306
|
-
Every generated component shares the same Material Design-informed look — clean surfaces, subtle elevation, a consistent radius/motion scale — using its own color palette (not Material's colors, to stay clear of any lookalike/plagiarism concern). The tokens are plain CSS custom properties declared on each component's `:host` (e.g. `--semmet-color-primary`, `--semmet-radius-md`, `--semmet-elevation-1`), so you can either use the defaults as-is or override the whole family from a global stylesheet without touching the generated files.
|
|
307
|
-
|
|
308
|
-
## Options
|
|
309
|
-
|
|
310
|
-
Every component command accepts the same three options (same as `ng generate component`):
|
|
311
|
-
|
|
312
|
-
- `name` (required, positional) — component name.
|
|
313
|
-
- `project` — target project; defaults to the current/default project.
|
|
314
|
-
- `path` — target directory; defaults to the project's `src/app`.
|
|
315
|
-
|
|
316
|
-
## License
|
|
317
|
-
|
|
318
|
-
MIT
|
|
5
|
+
Keep AI-agent guidance in [AI_USAGE_GUIDE.md](./AI_USAGE_GUIDE.md).
|