TUM AET UI package
TUM AET UI is the Angular component library from the Applied Education Technologies (AET)
research group at the Technical University of Munich. It is published
as @tumaet/ui-angular. Artemis production builds consume its compiled public entry point and stylesheet.
Use the TUM AET UI component reference to inspect supported states, controls, accessibility results, and APIs. This guide covers package architecture and contribution rules.
For button colours, emphasis, and toolbar sizing, follow Button intent and hierarchy.
Ownership boundary
Package code:
- imports only its declared dependencies;
- exposes supported contracts through one entry point per component directory (
src/lib/<directory>/index.ts, listed in theexportsofpackage.json) and throughsrc/public-api.ts, which exports the same symbols from the package root; - uses package-owned translation keys and
--tumaet-ui-*theme properties; - contains no Artemis routes, services, Artemis-owned theme properties or translation keys, or request models.
Artemis-specific adapters live in src/main/webapp/app/shared-ui/tum-aet-ui-integration. Artemis
imports package symbols from the entry point of their component (@tumaet/ui-angular/button); ESLint rejects the package root and
every other path.
The package has its own version and GitHub release notes. Repository code owners review its public contract; npm organization maintainers approve releases.
Adding or changing a component
Follow the component decision order. A new package API needs a reusable design-system responsibility and a concrete Artemis consumer; keep application policy in Artemis. Build reusable behavior on native HTML, Angular Aria, or stable Angular CDK primitives. Document unsupported public behavior beside the API declaration.
Package components use standalone declarations, signal APIs, ChangeDetectionStrategy.OnPush,
native input coercion, and semantic Tailwind utilities. Prefer stable native controls, Angular Aria,
and CDK behavior over custom keyboard, focus, overlay, or selection machinery.
Tests should assert public behavior: accessible role and name, keyboard interaction, focus changes, disabled behavior, emitted values, and forms integration. Avoid tests that restate implementation details or static class maps.
Accessibility foundation
Composite widgets build on Angular Aria (@angular/aria),
Angular's headless accessibility directives. Aria owns the roles, the ARIA state, roving focus,
keyboard navigation, and typeahead; the package adds the styling and the TUM AET UI API on top. The
menu, the tabs, and the accordion are built this way. Aria ships the same widgets for comboboxes, grids,
listboxes, toolbars, and trees, so reach for it before writing keyboard handling for one of those.
The CDK still provides what aria leaves to the host, such as the overlay that positions an open
menu.
A package component composes an aria directive in one of two ways. It applies the directive as a
host directive when the component never has to set one of the directive's inputs itself: the tab
list, the tabs container, the menu surface, the menu item, and the accordion work this way; the accordion panel applies aria's
trigger and panel in its own template, where it binds their inputs like any other directive. Angular cannot bind a
host directive's input from the host, so when the component must supply or reshape an input, it
extends the aria class instead and overrides that input. The menu trigger extends the aria trigger
because the menu it opens only exists once its template has been rendered, and because a disabled
menu button stays natively disabled. The tab extends the aria tab because aria keys tabs by string
while tumaet-ui-tab accepts numbers as well. An override keeps the type of the aria member, because
the external consumer test compiles the published declarations without skipping library checks;
tumaet-ui-tab therefore moves aria's value input to an internal name and binds its own value
under the public one. Such an override works only because aria reads its inputs lazily through
this; each subclass states in a comment what it relies on, so a test that fails after an aria
update points at the cause.
Aria's other inputs keep their defaults unless an application binds them, and two of those
defaults shape the behavior. A disabled menu item or tab stays focusable: the arrow keys reach it,
assistive technology announces it as unavailable, and it cannot be chosen, as the
WAI-ARIA Authoring Practices
recommend. A tab is selected as soon as it receives focus. A tab list without panels remains
supported for switching a view the application renders itself; tumaet-ui-tabs then gives each tab an
empty, hidden placeholder panel, which only keeps aria from reporting a missing panel in
development mode.
Aria opens a menu from Enter and Space on keydown and cancels the key, so a keyboard user produces
no click on the trigger. React to a menu with the trigger's menuOpened output and to a chosen
entry with its triggered output, never with a (click) handler on the trigger.
Aria has no primitive for dividing a menu. tumaet-ui-menu-separator and tumaet-ui-menu-group are
plain elements with the separator and group roles; a group is named by its visible label. They
are not entries, so the arrow keys, Home, End and typeahead pass over them. Use them instead of
hand-written dividers and headings inside a menu.
Each host carries the attribute aria's test harnesses look for, so tests in the package and in
Artemis can drive TUM AET UI menus, tabs and accordions with MenuHarness from
@angular/aria/menu/testing, TabsHarness from @angular/aria/tabs/testing, and AccordionHarness
from @angular/aria/accordion/testing. A closed TUM AET UI menu is not in the document, and
MenuHarness finds a trigger through the rendered menu, so MenuHarness.open() and the
triggerText filter only work once the menu is open: click the trigger first, then load the
harness. Prefer the harness over hand-written DOM queries when it covers the interaction.
@angular/aria requires exactly the @angular/cdk version it was released with. The package
declares both as peers with the same minimum, so an application installs one copy of each; keep
them on the same version when upgrading. The workspace catalog pins both, and they move together.
Stories
Colocate each top-level consumer story with its component or directive. Document supporting pieces
of a composite API, such as tab panels or sortable columns, as subcomponents of that story. Use the
package's CSF3 format with Meta, StoryObj, and
TypeScript's satisfies operator. Type component stories with the component or explicit story args.
Keep configuration in packages/tum-aet-ui/.storybook; do not add root Storybook configuration or
import Artemis into a story.
Prefer an args-driven default story and only the additional states that expose a meaningful visual
or behavioral contract. Let Storybook render the component directly when inputs and outputs are
enough. Use an Angular template only when the public contract requires projection, a directive host,
forms, a TemplateRef, or compound components. Use args for initial state and Controls. Keep
interaction state in Angular bindings when a transition depends on preserving the rendered element;
updating Storybook args rerenders an inline AutoDocs story.
Stories should provide the minimum realistic context needed to understand the contract. A presentation wrapper may arrange an example but must not repair or restyle the component. Expose meaningful serializable controls; keep callbacks, templates, and framework objects read-only. Source JSDoc is the canonical description for non-obvious inputs and outputs. Test compact, narrow, dark, reduced-motion, or right-to-left conditions only when they affect the contract.
Add a play function for browser-only behavior such as focus, keyboard navigation, overlays, or
dismissal. Hide a tested story from the sidebar and AutoDocs only when the interaction is valuable
but its final state is not a useful reference; do not create hidden duplicates of unit tests. Query
by accessible role and name. Do not assert CSS classes, duplicate unit-test matrices, add snapshots,
or disable accessibility rules to make a story pass.
Data table design template
Every data table in Artemis follows one design, built by tumaet-ui-table-layout together with table[tumAetUiTable]
and tumaet-ui-paginator. User management is the reference page. The Storybook story Data Display / Table Layout
shows it live: resize it, switch the theme and sort the columns. Pages assemble the frame as described in
Data tables.
Anatomy
[⌕ Search users] 0 selected Delete Filter [+ Create] toolbar 40px, sticky
──────────────────────────────────────────────────────────────────────────
☐ ID ▲ Login ⇅ Name ⇅ Email ⇅ Language Created ⇅ Actions header 30px, sticky
☐ 1037 aturing37 Alan Turing … rows 36px
☐ 1038 ghopper38 Grace Hopper … only this part ↕ body scrolls, also sideways
──────────────────────────────────────────────────────────────────────────
1–50 of 1,284 users Rows [50] « ‹ [1] 2 3 › » footer 40px, sticky
| Part | Size | Rules |
|---|---|---|
| Toolbar | at most 40px | One line, never wraps. Search on the left, bulk and page actions on the right. Absent when there is nothing to put in it. |
| Header | 30px | Sticks to the top of the body. One line of text; a long label widens its column. Sortable columns show an arrow. |
| Body | rows of about 36px | The only part that scrolls, vertically and horizontally. Striping and row hover are optional. |
| Footer | at most 40px | One line. Range and total on the left, page size and pager on the right. Omit it for lists shown completely. |
The table has no border of its own: it sits flat on the panel of its page, and the controls of the toolbar start where the
table starts, with 8px of air between the toolbar and the header. The tinted header
(--tumaet-ui-table-header-background) sets it apart and has rounded outer corners, so there is no rule below the header or below the last row. A table
outside the layout keeps both rules. A table with a <tfoot> draws a heavier rule above its footer cells instead of below the last
row. A sortable header cell changes to --tumaet-ui-table-header-hover-background on hover, which differs from the row hover in both
themes.
The table is as tall as its rows, but never taller than the space left below it in its scroll container. A short table leaves no empty area, and a long one keeps toolbar and footer in view whatever sits above it.
Responsive behaviour
The toolbar and the footer never wrap. They give up detail instead:
| Width of the table | Footer |
|---|---|
| from 42rem | range and total, page size with its label, first, previous, three page numbers, next, last |
| from 36rem | the same, with the page size select but without its label |
| from 28rem | range and total, first, previous, "page / pages", next, last |
| below 28rem | only the total, first, previous, "page / pages", next, last |
The footer follows the width of the table, not the screen, so dialogs behave the same.
The toolbar shows button labels from the md breakpoint of the viewport and icons only below it. A toolbar that is still
too wide scrolls sideways instead of breaking into a second line.
States and details
- Loading: the body is dimmed with a spinner and the frame is announced as busy; the pager is disabled so that overlapping requests cannot show the wrong page.
- Empty: bind
emptyof the frame to "no rows and not loading". The body then shows a centered empty state (tumaet-ui-empty-state) under the column header, by default "No entries yet". SetemptyTitleandemptyDescriptionto the wording of the page and project a call to action such as "Create" with[tumAetUiTableEmptyActions]. Do not write a "no results" row into the table. - Sorting: the active column shows its direction and exposes
aria-sort. Sorting resets the pager to the first page. - Accessibility: an icon-only button needs an accessible name, the pager is a labelled
nav, and the selected page is marked witharia-current. - Theming: use semantic colour tokens only, so the table looks the same in the light and the dark theme.
- Not for every table: key/value tables and tables with a few fixed rows stay a plain
<table tumAetUiTable>. They keep the 30px header but have no toolbar or footer.
Consuming the package
Import each symbol from the entry point of its component, named after the directory of the component:
import { TumAetUiButtonComponent } from '@tumaet/ui-angular/button';
import { TumAetUiDialogComponent } from '@tumaet/ui-angular/dialog';
The entry point is what keeps the code of a component out of a page that does not use it. The Angular build bundles with esbuild, which assigns code to chunks per file: everything that a lazy route takes from one file is loaded by every entry that reaches that file. A package root that exports all components is such a file, so a single import from it brings every component that any route uses into the first download, even when the bundler removes the unused exports. With an entry point per component, the first download contains the components of the application shell, and a route loads the components that it uses. The package root exports the same symbols, for applications that import a few components or that do not split their code. Artemis does not import it: ESLint rejects the root and every path that is not an entry point.
To add a component, create src/lib/<directory>/index.ts with explicit export { ... } statements (no export *), add the entry point to the exports of
package.json and the symbols to src/public-api.ts. The package contract test (config/eslint/rules/tum-aet-ui-package.spec.mjs) fails when
an entry point is missing or the root exports something else than the entry points. node supporting_scripts/client/migrate-tum-aet-ui-imports.mjs rewrites
imports of the package root to entry points, for example after a rebase.
Storybook AutoDocs derives the component API from those declarations and their source JSDoc. Document non-obvious public behavior beside the declaration; do not maintain separate input and output tables.
Artemis declares the package through pnpm's workspace:* protocol. Application builds and Artemis
tests consume packages/tum-aet-ui/dist; their root commands build the package first. The paths of the tsconfig files and the aliases of the
test runners cannot read the exports of a package, so they use a directory per entry point, dist/<entry point>, and one mapping,
@tumaet/ui-angular/* -> dist/*, serves all of them. The library builder already writes a package.json into each of these directories;
the package build completes it with main and sideEffects (write-entry-stubs.mjs), because Vitest cannot resolve a directory
without main. Development serve
mode maps the package entry points to their sources so changes participate in Angular's normal watch and
reload cycle.
Theme contract
The package README documents stylesheet loading, token semantics, dark mode, and host styling.
Artemis loads @tumaet/ui-angular/styles.css after application styles. The package keeps all its styles
in cascade layers: the components in tumaet-ui, the theme defaults in tumaet-ui-theme and the overlay
styles of Angular CDK in tumaet-ui-cdk. Artemis declares these layers after its element defaults (base)
in content/css/application.css and in the boot styles of index.html; its Tailwind utilities (utilities)
follow from tailwind.css. A component therefore overrides
an element default, and a utility class on a component overrides the component. The unlayered stylesheet
of Artemis overrides the package's font family, brand, application surfaces, and status roles. Its Tailwind
configuration owns application utilities. Set data-theme="dark" on the document element for dark
mode; the package theme also sets the matching CSS color-scheme for browser controls.
Button-only colors are centralized in the light/dark Button palette blocks of
packages/tum-aet-ui/themes.css. The --tumaet-ui-button-<severity>-{background,contrast,foreground}
properties let a host adjust buttons independently of status feedback. See changing the global button palette
for the property contract, overrides, and verification commands.
Treat package token names and responsive thresholds as public styling contracts. Add a token only when a host needs a supported customization axis; do not expose Tailwind's full primitive theme.
Apply application layout classes directly to the component host with the native class attribute.
Do not add styleClass-style compatibility inputs or expose internal element classes. Add a
semantic input or theme token only when the customization is a supported component contract.
Translation contract
Package-owned text uses tumAetUi.* keys and has English defaults. A host can implement
TumAetUiTranslator and register it once:
providers: [provideTumAetUiTranslator(ApplicationTranslator)];
The adapter's translationChanges signal invalidates translated views, and its locale signal
controls locale-sensitive formatting. Artemis registers provideArtemisTumAetUiTranslator() in
app.config.ts; its key mapping belongs in app/shared-ui/tum-aet-ui-integration, not in the package.
Local workflow
After installing workspace dependencies, install Chromium for browser tests. Repeat this after upgrading Playwright:
pnpm --dir packages/tum-aet-ui exec playwright install --with-deps --only-shell chromium
Run focused commands while developing:
| Command | Purpose |
|---|---|
pnpm run tum-aet-ui:test | Run package unit tests with Angular's Vitest runner |
pnpm run tum-aet-ui:test:coverage | Run package specs with the CI coverage thresholds |
pnpm run tum-aet-ui:pack:check | Build and validate an isolated artifact with publint and AreTheTypesWrong |
pnpm run tum-aet-ui:source:check | Build Artemis against the package source entry point |
pnpm --dir packages/tum-aet-ui run storybook | Build package styles and start its isolated Storybook |
pnpm --dir packages/tum-aet-ui run storybook:test | Run stories and accessibility checks in Chromium |
pnpm run docs:test | Build the combined documentation and test its navigation and themes |
Before submitting a package change, run the complete validation from the repository root:
pnpm run tum-aet-ui:validate
pnpm start and the shared IntelliJ client configuration first build packages/tum-aet-ui/dist for
editor resolution, then serve package sources. Restart the client after changing the package
manifest or build configuration. Production builds consume packages/tum-aet-ui/dist; package
validation writes to packages/tum-aet-ui/dist-pack.
Angular peer ranges start at the workspace catalog versions used to build the library. Other peer
ranges must include their catalog versions; development upgrades do not require raising their
consumer minimums. pnpm run test:rules checks these constraints. External consumer tests install
the tarball outside the workspace with strict peer resolution, build an Angular production
application, and exercise forms, icons, dialog focus, and theme overrides in Chromium. CI tests minimum and latest compatible peers. Server-side rendering
is not supported.
pnpm run tum-aet-ui:pack:check
pnpm run tum-aet-ui:test:consumer minimum
pnpm run tum-aet-ui:test:consumer latest
pack:check writes the validated tarball and its integrity metadata to build/tum-aet-ui-package. publint and
AreTheTypesWrong are not dependencies: pack.mjs fetches them with pnpm dlx at the versions it declares.
Consumer failures retain the npm manifest, resolved lockfile, and browser diagnostics under
build/test-results/tum-aet-ui-consumer; CI uploads these as artifacts.
Publishing to npm
TUM AET UI versions independently from Artemis. Tags use the npm package identity:
@tumaet/ui-angular@<version>. This follows the
package-name@version convention
and keeps package releases separate from Artemis's numeric application tags.
Run Release TUM AET UI (release-tum-aet-ui.yml) explicitly:
- On a branch, it validates without publishing.
- On a package tag, it validates the tag against
package.jsonand requires its commit to be reachable fromdevelop, then stages the tested tarball for npm approval.
Creating a tag or GitHub release does not start this workflow. It builds once, tests the tarball with both external consumer configurations, then passes it to a separate OIDC staging job. Public npm availability requires a maintainer's 2FA approval.
Release setup
The package must exist on npm before staged publishing can be enabled. GitHub enables manual dispatch after the workflow exists on the default branch.
- Give the people who will approve the staged package access to
@tumaet/ui-angularon npm and require 2FA. GitHub environment reviewers need access to the Artemis repository but do not need npm access unless they will also approve the staged package. - Protect
developwith required CI and code-owner review. Protect@tumaet/ui-angular@*tags from updates and deletion. Limit tag creation to release maintainers if the repository's release policy requires it. - Create the GitHub environment npm-tum-aet-ui with required reviewers and a tag
deployment rule matching
@tumaet/ui-angular@*. The slash is literal; environment wildcards do not match slashes. Create the environment before dispatching a release, since GitHub can create a referenced environment without protection rules. - In npm's package settings, configure a GitHub trusted publisher for organization ls1intum, repository Artemis, workflow release-tum-aet-ui.yml, and environment npm-tum-aet-ui. Allow stage publish only. Select Require two-factor authentication and disallow tokens under publishing access. Do not add an npm publishing token to GitHub secrets. npm's workflow and environment fields must exactly match GitHub's names. Remove any older trusted-publisher connection for this package that points to another workflow or environment. npm does not let those identity fields be changed in place.
Trusted publishing generates provenance for the public package and repository. Staged publishing requires npm 11.15 or newer. Trusted-publisher fields are case-sensitive.
After a new or renamed workflow is merged into develop, dispatch it there once and verify the
build and consumer checks pass while the staging job is skipped:
gh workflow run release-tum-aet-ui.yml --ref develop
GitHub requires a manually dispatched workflow to exist on the default branch before it can be dispatched for a tag.
Publishing a version
Update the version from packages/tum-aet-ui with npm version <version> --no-git-tag-version --ignore-scripts.
Before 1.0, incompatible API, token, or peer-minimum changes increment the minor; compatible fixes
and additions increment the patch. After 1.0, breaking changes increment the major.
Document migrations instead of adding compatibility aliases.
Merge the validated change into develop, then create an annotated tag at that reviewed commit
and dispatch the workflow on it. Replace <version> and <reviewed-commit> in these commands:
git tag -a '@tumaet/ui-angular@<version>' '<reviewed-commit>' -m '@tumaet/ui-angular@<version>'
git push origin 'refs/tags/@tumaet/ui-angular@<version>'
gh workflow run release-tum-aet-ui.yml --ref '@tumaet/ui-angular@<version>'
All releases target latest. Omit an explicit --tag so npm retains its built-in
protection against staging older versions.
After the workflow succeeds, inspect the staged package's version, content, and provenance commit
on npm, then approve with 2FA using the website or npm stage approve <stage-id>.
GitHub release notes and recovery
After confirming the version is public on npm, create a GitHub release for its existing tag.
Write TUM AET UI-specific notes covering consumer-visible changes and migrations; repository-wide
generated notes also include unrelated Artemis changes. Use
gh release create '@tumaet/ui-angular@<version>' --verify-tag --latest=false
to require the existing tag and preserve the latest Artemis release. The Artemis application
release and Android test workflows exclude @tumaet/ package releases.
Staging success does not mean the package is public. Before retrying an interrupted run, inspect
npm stage list @tumaet/ui-angular; the upload may already have succeeded. Published versions are
immutable. Fix a bad release with a new version, deprecate the affected version, and restore the
previous dist-tag if necessary. Do not move release tags or overwrite versions.