@lifecorner/angular-ui-kit 0.0.0-stage β†’ 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +336 -2
  2. package/fesm2022/lifecorner-angular-ui-kit.mjs +38908 -0
  3. package/fesm2022/lifecorner-angular-ui-kit.mjs.map +1 -0
  4. package/package.json +58 -3
  5. package/src/assets/README.md +33 -0
  6. package/src/assets/icon-names.json +1 -0
  7. package/src/assets/lifecorner-emblem-mono.svg +17 -0
  8. package/src/assets/lifecorner-emblem-on-dark.svg +17 -0
  9. package/src/assets/lifecorner-emblem-small-on-dark.svg +18 -0
  10. package/src/assets/lifecorner-emblem-small.svg +17 -0
  11. package/src/assets/lifecorner-emblem.svg +17 -0
  12. package/src/assets/lifecorner-logo-on-dark.svg +21 -0
  13. package/src/assets/lifecorner-logo.svg +23 -0
  14. package/src/styles/_density.scss +100 -0
  15. package/src/styles/_horizon.scss +115 -0
  16. package/src/styles/_mixins.scss +117 -0
  17. package/src/styles/_reset.scss +215 -0
  18. package/src/styles/_theme-dark.scss +455 -0
  19. package/src/styles/_theme-light.scss +464 -0
  20. package/src/styles/_typography.scss +223 -0
  21. package/src/styles/_utilities.scss +161 -0
  22. package/src/styles/horizon.spec.ts +77 -0
  23. package/src/styles/index.scss +36 -0
  24. package/src/styles/theme-contrast.spec.ts +230 -0
  25. package/src/styles/theme-modes.spec.ts +60 -0
  26. package/src/styles/tokens/_all.scss +134 -0
  27. package/src/styles/tokens/_animation.scss +7 -0
  28. package/src/styles/tokens/_border-radius.scss +10 -0
  29. package/src/styles/tokens/_colors.scss +65 -0
  30. package/src/styles/tokens/_elevation.scss +7 -0
  31. package/src/styles/tokens/_size.scss +18 -0
  32. package/src/styles/tokens/_spacing.scss +22 -0
  33. package/src/styles/tokens/_typography.scss +23 -0
  34. package/src/styles/typography.spec.ts +115 -0
  35. package/src/styles/utilities.spec.ts +47 -0
  36. package/types/lifecorner-angular-ui-kit.d.ts +17371 -0
package/README.md CHANGED
@@ -1,3 +1,337 @@
1
- # Temporary Holding Version
1
+ # @lifecorner/angular-ui-kit
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Angular UI component library for the **LifeCorner Design System** β€” 110 accessible, themeable Angular standalone components (for apps on Angular 21 and 22) with signal-based inputs, OnPush change detection, light/dark themes, and a full density token system (`compact` / `cosy` / `comfortable`).
4
+
5
+ ## Resources
6
+
7
+ | | |
8
+ |---|---|
9
+ | πŸ“– **Live documentation & Storybook** | https://design.life-cockpit.de (moves to `design.lifecorner.de` once that domain is registered) |
10
+ | πŸ€– **MCP server for AI agents** | https://design.life-cockpit.de/mcp |
11
+ | πŸ“¦ **npm package** | https://www.npmjs.com/package/@lifecorner/angular-ui-kit |
12
+ | πŸ™ **Source code** | https://github.com/LifeCorner/lc-design-system |
13
+
14
+ > **Renamed in 3.3.0.** Up to 3.2.x this package was `@life-cockpit/angular-ui-kit` (now deprecated). Replace the import and `@use` paths with `@lifecorner/angular-ui-kit`; the `lc-` selectors, `LC_*` tokens and the API stay the same. The docs site and the MCP endpoint stay on `design.life-cockpit.de` until `lifecorner.de` is registered, then move to `design.lifecorner.de`.
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install @lifecorner/angular-ui-kit
20
+ ```
21
+
22
+ ### Peer Dependencies
23
+
24
+ Make sure these are installed in your project:
25
+
26
+ ```bash
27
+ npm install @angular/cdk @angular/common @angular/core @angular/forms @angular/platform-browser @angular/router rxjs
28
+ ```
29
+
30
+ ## Setup
31
+
32
+ Import the global styles in your `styles.scss`:
33
+
34
+ ```scss
35
+ @use '@lifecorner/angular-ui-kit/styles';
36
+ ```
37
+
38
+ Every built-in text is an input (English or German defaults), and components that
39
+ format dates take a `locale` β€” see **Internationalization** in the docs.
40
+
41
+ ## Usage
42
+
43
+ Import components directly in your Angular standalone components or modules:
44
+
45
+ ```typescript
46
+ import { ButtonComponent, CardComponent } from '@lifecorner/angular-ui-kit';
47
+
48
+ @Component({
49
+ standalone: true,
50
+ imports: [ButtonComponent, CardComponent],
51
+ template: `
52
+ <lc-card>
53
+ <lc-button variant="primary">Click me</lc-button>
54
+ </lc-card>
55
+ `,
56
+ })
57
+ export class MyComponent {}
58
+ ```
59
+
60
+ ## Components
61
+
62
+ ### General
63
+
64
+ | Component | Selector | Description |
65
+ |-----------|----------|-------------|
66
+ | Accordion | `lc-accordion` | Expandable/collapsible panels with optional rich header template (`lcAccordionHeader`) and lazy/deferred body (`lcAccordionContent` + `[lazy]`/`[destroyOnClose]`) |
67
+ | Button | `lc-button` | Primary, secondary, and text buttons |
68
+ | Button link | `a[lcButton]` | `lc-button` look on a native `<a href>` β€” native attributes pass through, works without JavaScript |
69
+ | Card | `lc-card` | Content container with elevation; optional leading brand-tile header icon (`[icon]` / `[iconVariant]`) |
70
+ | Chat | `lc-chat` | Conversational UI with streaming, custom message templates |
71
+ | Icon | `lc-icon` | Tabler SVG icons; fail-loud on unknown names (dev warning + visible placeholder, optional `[strict]` throw); exports `ICON_NAMES` / `isValidIconName` / `ICON_ALIASES` (+ `icon-names.json`) for static checking |
72
+ | Logo | `lc-logo` | LifeCorner logo: Edu, the emblem, and the LifeCorner lockup, with dark and small drawings |
73
+ | Markdown | `lc-markdown` | GFM renderer (tables with alignment, task lists, autolinks, code/mermaid) with in-place change highlighting |
74
+ | Menu | `lc-menu` | Dropdown menu |
75
+ | Typography | `lc-typography` | Text with preset styles |
76
+
77
+ ### Form
78
+
79
+ | Component | Selector | Description |
80
+ |-----------|----------|-------------|
81
+ | Checkbox | `lc-checkbox` | Checkbox input |
82
+ | Combobox | `lc-combobox` | Async autocomplete with single/multiple selection |
83
+ | Copy Field | `lc-copy-field` | A value to copy (link, token, command): wraps, 48.5 px copy button, one polite announcement |
84
+ | Datepicker | `lc-datepicker` | Date selection |
85
+ | Email Input | `lc-email-input` | Email-specific input |
86
+ | Input | `lc-input` | Text input field |
87
+ | Password Input | `lc-password-input` | Password input with toggle |
88
+ | Provider Button | `lc-provider-button` | "Sign in with Google" drawn to Google's branding guidelines (light, dark, neutral; no Google script) |
89
+ | Radio | `lc-radio` | Radio button |
90
+ | Radio Group | `lc-radio-group` | `<fieldset>` with a legend, one help text and one error around `lc-radio`s; `[(value)]` or a form control |
91
+ | Select | `lc-select` | Dropdown select |
92
+ | Switch | `lc-switch` | Toggle switch |
93
+ | Textarea | `lc-textarea` | Multi-line text input |
94
+ | Verification Code | `lc-verification-code-input` | OTP/code input |
95
+
96
+ ### Layout
97
+
98
+ | Component | Selector | Description |
99
+ |-----------|----------|-------------|
100
+ | App Shell | `lc-app-shell` | The app frame, phone first, with the document scrolling: header, docked side navigation from 1024 px, bottom bar below, footer, optional horizon |
101
+ | App Page | `lc-app-page` | A page in the shell: `<main>` at a reading width and an optional right column docked to the window's edge from 1280 px |
102
+ | Container | `lc-container` | Page container with max-width |
103
+ | Drawer | `lc-drawer` | Slide-in side panel |
104
+ | Page Header | `lc-page-header` | Page title with overline, subtitle and actions; `title`, `display` and `auth` sizes |
105
+ | Section | `lc-section` | Content section |
106
+ | Spacer | `lc-spacer` | Spacing utility |
107
+ | Stack | `lc-stack` | Flex layout utility |
108
+
109
+ ### Navigation
110
+
111
+ | Component | Selector | Description |
112
+ |-----------|----------|-------------|
113
+ | Bottom Nav | `lc-bottom-nav` | Bottom navigation bar for phones and tablets (links, `aria-current`), docked or floating |
114
+ | Breadcrumbs | `lc-breadcrumbs` | Breadcrumb navigation |
115
+ | Footer | `lc-footer` | Site or app footer with labelled link sections |
116
+ | Header | `lc-header` | App shell or public-site header: plain `homeHref`, labelled `navItems`, `[slot='end']`, translatable labels |
117
+ | Pagination | `lc-pagination` | Page navigation |
118
+ | Sidenav | `lc-sidenav` | Side navigation; docked, drawer, or transparent with pill items |
119
+ | Tabs | `lc-tabs` | Tab navigation |
120
+
121
+ ### Data Display
122
+
123
+ | Component | Selector | Description |
124
+ |-----------|----------|-------------|
125
+ | Avatar | `lc-avatar` | User avatar; six member colours and a ring |
126
+ | Avatar Group | `lc-avatar-group` | Stacked avatars, e.g. a household's member row |
127
+ | Badge | `lc-badge` | Status badge |
128
+ | Chip | `lc-chip` | Tag/label chip |
129
+ | Description List | `lc-description-list` | Key/value metadata (`<dl>`) with rows/stacked layout, optional dotted leaders and per-row emphasis/links |
130
+ | Empty State | `lc-empty-state` | Placeholder for empty content |
131
+ | Field Group | `lc-field-group` | Grouped form fields |
132
+ | Filter Bar | `lc-filter-bar` | Filter controls |
133
+ | List | `lc-list` | List display |
134
+ | Log Viewer | `lc-log-viewer` | Streaming log/terminal viewer with virtualization |
135
+ | Metric Card | `lc-metric-card` | KPI/metric display |
136
+ | Pipeline | `lc-pipeline` | Status timeline of connected process nodes; per-node status (complete/current/pending/warning/error) with captions, horizontal/vertical |
137
+ | Skeleton | `lc-skeleton` | Loading placeholder |
138
+ | Spinner | `lc-spinner` | Loading indicator |
139
+ | Stepper | `lc-stepper` | Step-by-step progress |
140
+ | Table | `lc-table` | Data table with sorting, filtering, pagination, formatter callbacks, cell styling hooks and custom cell templates |
141
+ | Timeline | `lc-timeline` | Ordered list of events with times (`<time datetime>`) |
142
+ | Toggle Group | `lc-toggle-group` | Segmented toggle |
143
+
144
+ ### Feedback
145
+
146
+ | Component | Selector | Description |
147
+ |-----------|----------|-------------|
148
+ | Alert | `lc-alert` | Inline alert message |
149
+ | Callout | `lc-callout` | Highlighted note in running content |
150
+ | Confirm Dialog | `lc-confirm-dialog` | Confirmation dialog with text-match support |
151
+ | Error Display | `lc-error-display` | Error state display |
152
+ | Modal | `lc-modal` | Dialog/modal window; bottom sheet on phones (`placement`) |
153
+ | Next-Step Card | `lc-next-step-card` | The one next step with its actions; `soft` variant for the "Weite" look |
154
+ | Toast | `lc-toast` | Notification toast |
155
+ | Toast Outlet | `lc-toast-outlet` | Renders the `ToastService` queue per position inside persistent live regions β€” place it once in the app shell |
156
+ | Tooltip | `lcTooltip` | Tooltip directive |
157
+
158
+ ### Services
159
+
160
+ | Service | Description |
161
+ |---------|-------------|
162
+ | `ConfirmService` | Imperative confirm/destructive/warning dialogs returning `Promise<boolean>` |
163
+ | `ThemeService` | Toggle light/dark theme; persists the choice (`localStorage` key `lc-theme`) and adopts a `dark`/`light`/`system` class already on `<html>` at startup (`system` follows the OS without a script) |
164
+ | `ToastService` | `show({ message, variant, … })` β€” rendered by `<lc-toast-outlet />` |
165
+
166
+ ## Theming
167
+
168
+ The library supports light and dark themes:
169
+
170
+ ```typescript
171
+ import { ThemeService } from '@lifecorner/angular-ui-kit';
172
+
173
+ @Component({ ... })
174
+ export class AppComponent {
175
+ private themeService = inject(ThemeService);
176
+
177
+ toggleTheme() {
178
+ this.themeService.toggleTheme();
179
+ }
180
+ }
181
+ ```
182
+
183
+ `lc-header`'s theme button toggles the service itself (set `[autoToggleTheme]="false"`
184
+ to handle `(themeToggleClick)` in the app instead).
185
+
186
+ ### Toasts
187
+
188
+ ```html
189
+ <!-- once, e.g. in the app shell -->
190
+ <lc-toast-outlet />
191
+ ```
192
+
193
+ ```typescript
194
+ inject(ToastService).show({ message: 'Saved', variant: 'success' });
195
+ ```
196
+
197
+ ## Branding (custom logo)
198
+
199
+ `lc-logo`, `lc-header` and `lc-sidenav` accept custom logo URLs so you can drop your own brand into the shell:
200
+
201
+ ```html
202
+ <lc-header
203
+ title="Acme"
204
+ [logoSrc]="'/assets/acme-logo.svg'"
205
+ [logoEmblemSrc]="'/assets/acme-emblem.svg'"
206
+ [logoDarkSrc]="'/assets/acme-logo-dark.svg'"
207
+ logoAlt="Acme Inc."
208
+ />
209
+ ```
210
+
211
+ The built-in LifeCorner logos (`lifecorner-logo.svg`, `lifecorner-logo-on-dark.svg`, `lifecorner-emblem*.svg`) are loaded from `/assets/` by default. If your app serves static files from a different prefix, override the path via the `LC_LOGO_BASE_PATH` token:
212
+
213
+ ```typescript
214
+ import { LC_LOGO_BASE_PATH } from '@lifecorner/angular-ui-kit';
215
+
216
+ bootstrapApplication(AppComponent, {
217
+ providers: [
218
+ { provide: LC_LOGO_BASE_PATH, useValue: '/static/lc' },
219
+ ],
220
+ });
221
+ ```
222
+
223
+ Or copy the assets from `node_modules/@lifecorner/angular-ui-kit/src/assets/` to your app's public `/assets/` folder (e.g. via the `assets` array in `angular.json`).
224
+
225
+ ## Chat with Rich Content
226
+
227
+ The Chat component supports custom message templates for embedding any component inside chat bubbles:
228
+
229
+ ```typescript
230
+ import { ChatComponent, ChatMessage, DiffViewerComponent } from '@lifecorner/angular-ui-kit';
231
+
232
+ @Component({
233
+ imports: [ChatComponent, DiffViewerComponent],
234
+ template: `
235
+ <lc-chat [messages]="messages" title="Spec Author">
236
+ <ng-template #messageTemplate let-msg>
237
+ {{ msg.content }}
238
+ @if (msg.data?.diff) {
239
+ <lc-diff-viewer
240
+ [oldText]="msg.data.oldText"
241
+ [newText]="msg.data.newText"
242
+ mode="inline"
243
+ />
244
+ }
245
+ </ng-template>
246
+ </lc-chat>
247
+ `,
248
+ })
249
+ export class SpecAuthorComponent {
250
+ messages: ChatMessage[] = [
251
+ { id: '1', role: 'agent', content: 'Ziel ausgefΓΌllt:', name: 'Agent',
252
+ data: { diff: true, oldText: '## Ziel\n\n_TBD_', newText: '## Ziel\n\nOnboarding-Plattform' } },
253
+ ];
254
+ }
255
+ ```
256
+
257
+ ## Design Tokens
258
+
259
+ Design tokens for colors, spacing, typography, elevation, and more are available as TypeScript constants:
260
+
261
+ ```typescript
262
+ import { ColorTokens, SpacingTokens } from '@lifecorner/angular-ui-kit';
263
+ ```
264
+
265
+ ### Density
266
+
267
+ All components react to a density token cascade. Set the density on any ancestor element (or `<html>`) and every descendant component adapts paddings, gaps and font sizes:
268
+
269
+ ```html
270
+ <div data-density="compact"> <!-- 'compact' | 'cosy' (default) | 'comfortable' -->
271
+ <lc-card>...</lc-card>
272
+ </div>
273
+ ```
274
+
275
+ See the *Design Tokens β†’ Density* section on https://design.life-cockpit.de for the full token reference.
276
+
277
+ ## MCP Server for AI Agents
278
+
279
+ The design system ships with a hosted **Model Context Protocol** server that lets AI coding agents (Copilot, Claude, Cursor, etc.) discover components, props, variants and usage examples without hallucinating.
280
+
281
+ **Endpoint:** `https://design.life-cockpit.de/mcp`
282
+
283
+ ### VS Code / GitHub Copilot
284
+
285
+ Add to your `.vscode/mcp.json` (or workspace `settings.json`):
286
+
287
+ ```json
288
+ {
289
+ "servers": {
290
+ "lc-design-sys": {
291
+ "type": "http",
292
+ "url": "https://design.life-cockpit.de/mcp"
293
+ }
294
+ }
295
+ }
296
+ ```
297
+
298
+ ### Claude Desktop / Cursor
299
+
300
+ ```json
301
+ {
302
+ "mcpServers": {
303
+ "lc-design-sys": {
304
+ "url": "https://design.life-cockpit.de/mcp"
305
+ }
306
+ }
307
+ }
308
+ ```
309
+
310
+ ### Available tools
311
+
312
+ | Tool | Description |
313
+ |---|---|
314
+ | `list-all-documentation` | Lists every component and docs page with its IDs |
315
+ | `search_component` | Finds a component by name and returns full docs in one call |
316
+ | `get-documentation` | Returns props, variants, usage examples and stories for a given ID |
317
+ | `get-documentation-for-story` | Retrieves docs for a specific Storybook story variant |
318
+ | `get_changelog` | Returns the changelog for the latest releases |
319
+
320
+ With the MCP server connected, your agent will *never invent props or variants* β€” it always grounds answers in the published component documentation.
321
+
322
+ ## Development
323
+
324
+ ```bash
325
+ # Run unit tests
326
+ nx test angular-ui-kit
327
+
328
+ # Build the library
329
+ nx build angular-ui-kit
330
+
331
+ # Run Storybook
332
+ nx storybook angular-ui-kit
333
+ ```
334
+
335
+ ## License
336
+
337
+ MIT