@xui/result 2.0.0-alpha.11 → 2.0.0-alpha.12

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 CHANGED
@@ -1,89 +1,103 @@
1
- <p style="font-size: 5rem; font-weight: 700; text-align: center">
2
- <span style="color: #1f75cb">x</span>UI
1
+ <h1 align="center">xUI</h1>
2
+
3
+ <p align="center">
4
+ <strong>90 Angular components, one npm package each, themed from a single token layer.</strong>
5
+ </p>
6
+
7
+ <p align="center">
8
+ <a href="https://xuijs.org">Documentation</a> ·
9
+ <a href="https://develop--67d2b4c756077a325913e5d9.chromatic.com/?globals=theme:dark">Storybook</a> ·
10
+ <a href="https://stackblitz.com/fork/xui">StackBlitz</a> ·
11
+ <a href="#components">Components</a>
12
+ </p>
13
+
14
+ <p align="center">
15
+ <a href="https://github.com/rikarin/xui/actions/workflows/release.yml"><img src="https://github.com/rikarin/xui/actions/workflows/release.yml/badge.svg?branch=master" alt="Build status" /></a>
16
+ <a href="https://www.npmjs.com/package/@xui/core"><img src="https://img.shields.io/npm/v/%40xui/core.svg" alt="npm version" /></a>
17
+ <a href="https://www.npmjs.com/org/xui"><img src="https://img.shields.io/npm/dm/%40xui/core.svg" alt="Downloads" /></a>
18
+ <a href="https://app.netlify.com/sites/xui/deploys"><img src="https://api.netlify.com/api/v1/badges/fa0cfd14-97df-47fa-8a7c-152e6d4cfda2/deploy-status" alt="Netlify status" /></a>
3
19
  </p>
4
20
 
5
21
  ---
6
22
 
7
- ![Build Status](https://github.com/rikarin/xui/actions/workflows/publish.yaml/badge.svg?branch=develop)
8
- [![Demo](https://img.shields.io/badge/demo-online-ed1c46)](https://xuijs.org/)
9
- [![npm](https://img.shields.io/npm/v/%40xui/core.svg?maxAge=2592000?style=plastic)](https://www.npmjs.com/org/xui)
10
- [![License](https://img.shields.io/npm/l/express.svg?maxAge=2592000)](/LICENSE)
11
- [![Netlify Status](https://api.netlify.com/api/v1/badges/fa0cfd14-97df-47fa-8a7c-152e6d4cfda2/deploy-status)](https://app.netlify.com/sites/xui/deploys)
23
+ xUI is an Angular 22 component library styled with Tailwind CSS 4. You compose it from directives and
24
+ standalone components rather than configuring one monolith, and the set goes well past the
25
+ primitives: data tables, dock managers, omnibars, node graphs and date ranges are packages here, not
26
+ things you are left to build.
12
27
 
13
- xUI is a customizable Angular 22 UI Library with full support of TailwindCSS styling based on popular React library ShardCN and its Angular alternative SpartanUI.
28
+ ```ts
29
+ import { XuiButtonImports } from '@xui/button';
30
+
31
+ @Component({
32
+ imports: [XuiButtonImports],
33
+ template: `<button xuiButton color="primary">Save changes</button>`
34
+ })
35
+ export class Example {}
36
+ ```
14
37
 
15
38
  ## Features
16
39
 
17
- - **35+ High-Quality Angular Components:** Ready to use out of the box.
18
- - **Powerful Theme Customization:** Detailed customization options with default themes.
19
- - **High Performance:** Supports Zoneless, OnPush mode, and Signals for optimized performance.
20
- - **Accessibility:** Supports WCAG 2.0 standards.
21
- - **Powerful Theme Customization:** Install each visual component and customize it according your needs
22
- - **TypeScript:** Written with predictable static types.
23
-
24
- ## Table of Contents
25
-
26
- - [Storybook](https://develop--67d2b4c756077a325913e5d9.chromatic.com/?globals=theme:dark)
27
- - [StackBlitz Demo](https://stackblitz.com/fork/xui)
28
- - [Documentation](https://xuijs.org)
29
- - [Live Demo](https://cord.dj/r)
30
- - [Packages](#packages)
31
- - [Installation](#installation)
32
- - [Browser Support](#browser-support)
33
- - [Development](#development)
34
- - [Issues](#issues)
35
- - [Roadmap](#roadmap)
36
-
37
- ## Packages
38
-
39
- | Package | Usage | Description |
40
- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
41
- | Core | [![Downloads](https://img.shields.io/npm/dt/%40xui/core.svg)](https://www.npmjs.com/package/%40xui/core)<br />[![Monthly Downloads](https://img.shields.io/npm/dm/%40xui/core.svg)](https://www.npmjs.com/package/%40xui/core)<br />[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/%40xui/core)](https://bundlephobia.com/result?p=%40xui/core) | Core package required by all other packages |
42
- | Badge | [![Downloads](https://img.shields.io/npm/dt/%40xui/badge.svg)](https://www.npmjs.com/package/%40xui/badge)<br />[![Monthly Downloads](https://img.shields.io/npm/dm/%40xui/badge.svg)](https://www.npmjs.com/package/%40xui/badge)<br />[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/%40xui/badge)](https://bundlephobia.com/result?p=%40xui/badge) | Badge component |
43
- | Breadcrumb | [![Downloads](https://img.shields.io/npm/dt/%40xui/breadcrumb.svg)](https://www.npmjs.com/package/%40xui/breadcrumb)<br />[![Monthly Downloads](https://img.shields.io/npm/dm/%40xui/breadcrumb.svg)](https://www.npmjs.com/package/%40xui/breadcrumb)<br />[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/%40xui/breadcrumb)](https://bundlephobia.com/result?p=%40xui/breadcrumb) | Breadcrumb component |
44
- | Button | [![Downloads](https://img.shields.io/npm/dt/%40xui/button.svg)](https://www.npmjs.com/package/%40xui/button)<br />[![Monthly Downloads](https://img.shields.io/npm/dm/%40xui/button.svg)](https://www.npmjs.com/package/%40xui/button)<br />[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/%40xui/button)](https://bundlephobia.com/result?p=%40xui/button) | Button component |
45
- | Button Group | [![Downloads](https://img.shields.io/npm/dt/%40xui/button-group.svg)](https://www.npmjs.com/package/%40xui/button-group)<br />[![Monthly Downloads](https://img.shields.io/npm/dm/%40xui/button-group.svg)](https://www.npmjs.com/package/%40xui/button-group)<br />[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/%40xui/button-group)](https://bundlephobia.com/result?p=%40xui/button-group) | Button Group component |
46
- | Checkbox | [![Downloads](https://img.shields.io/npm/dt/%40xui/checkbox.svg)](https://www.npmjs.com/package/%40xui/checkbox)<br />[![Monthly Downloads](https://img.shields.io/npm/dm/%40xui/checkbox.svg)](https://www.npmjs.com/package/%40xui/checkbox)<br />[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/%40xui/checkbox)](https://bundlephobia.com/result?p=%40xui/checkbox) | Checkbox component |
47
- | Form Field | [![Downloads](https://img.shields.io/npm/dt/%40xui/form-field.svg)](https://www.npmjs.com/package/%40xui/form-field)<br />[![Monthly Downloads](https://img.shields.io/npm/dm/%40xui/form-field.svg)](https://www.npmjs.com/package/%40xui/form-field)<br />[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/%40xui/form-field)](https://bundlephobia.com/result?p=%40xui/form-field) | Form Field component |
48
- | Icon | [![Downloads](https://img.shields.io/npm/dt/%40xui/icon.svg)](https://www.npmjs.com/package/%40xui/icon)<br />[![Monthly Downloads](https://img.shields.io/npm/dm/%40xui/icon.svg)](https://www.npmjs.com/package/%40xui/icon)<br />[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/%40xui/icon)](https://bundlephobia.com/result?p=%40xui/icon) | Icon component |
49
- | Input | [![Downloads](https://img.shields.io/npm/dt/%40xui/input.svg)](https://www.npmjs.com/package/%40xui/input)<br />[![Monthly Downloads](https://img.shields.io/npm/dm/%40xui/input.svg)](https://www.npmjs.com/package/%40xui/input)<br />[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/%40xui/input)](https://bundlephobia.com/result?p=%40xui/input) | Input component |
50
- | Label | [![Downloads](https://img.shields.io/npm/dt/%40xui/label.svg)](https://www.npmjs.com/package/%40xui/label)<br />[![Monthly Downloads](https://img.shields.io/npm/dm/%40xui/label.svg)](https://www.npmjs.com/package/%40xui/label)<br />[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/%40xui/label)](https://bundlephobia.com/result?p=%40xui/label) | Label component |
51
- | Skeleton | [![Downloads](https://img.shields.io/npm/dt/%40xui/skeleton.svg)](https://www.npmjs.com/package/%40xui/skeleton)<br />[![Monthly Downloads](https://img.shields.io/npm/dm/%40xui/skeleton.svg)](https://www.npmjs.com/package/%40xui/skeleton)<br />[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/%40xui/skeleton)](https://bundlephobia.com/result?p=%40xui/skeleton) | Skeleton component |
52
- | Spinner | [![Downloads](https://img.shields.io/npm/dt/%40xui/spinner.svg)](https://www.npmjs.com/package/%40xui/spinner)<br />[![Monthly Downloads](https://img.shields.io/npm/dm/%40xui/spinner.svg)](https://www.npmjs.com/package/%40xui/spinner)<br />[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/%40xui/spinner)](https://bundlephobia.com/result?p=%40xui/spinner) | Spinner component |
53
- | Status | [![Downloads](https://img.shields.io/npm/dt/%40xui/status.svg)](https://www.npmjs.com/package/%40xui/status)<br />[![Monthly Downloads](https://img.shields.io/npm/dm/%40xui/status.svg)](https://www.npmjs.com/package/%40xui/status)<br />[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/%40xui/status)](https://bundlephobia.com/result?p=%40xui/status) | Status component |
54
- | Table | [![Downloads](https://img.shields.io/npm/dt/%40xui/table.svg)](https://www.npmjs.com/package/%40xui/table)<br />[![Monthly Downloads](https://img.shields.io/npm/dm/%40xui/table.svg)](https://www.npmjs.com/package/%40xui/table)<br />[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/%40xui/table)](https://bundlephobia.com/result?p=%40xui/table) | Table component |
55
-
56
- ## Installation
57
-
58
- Install package with **PNPM**
40
+ - **One package per component.** Install `@xui/button` and you ship a button, not a library. Each
41
+ package exports an imports barrel for standalone components.
42
+ - **Signals throughout.** Signal inputs, `OnPush` and zoneless change detection; no `zone.js`
43
+ required.
44
+ - **Themed by tokens, not overrides.** Components style themselves with `bg-surface`,
45
+ `text-foreground-muted`, `border-error-muted`. Light and dark both work without a single `dark:`
46
+ class, and re-colouring an intent is one CSS variable.
47
+ - **Typed variants.** Every visual axis is a typed input backed by
48
+ [CVA](https://cva.style), and the `class` input merges through `tailwind-merge` — your utility
49
+ wins instead of fighting the component's.
50
+ - **Angular CDK underneath.** Overlays, focus traps, roving tabindex, typeahead, drag and drop and
51
+ bidi come from `@angular/cdk`, so keyboard behaviour and RTL are not reimplemented per component.
52
+ - **Built for coding agents.** An MCP server and an agent skill expose the real API of every
53
+ package — see [AI coding agents](#ai-coding-agents).
54
+
55
+ ## Requirements
56
+
57
+ | | |
58
+ | ----------------------- | --- |
59
+ | Angular | 22 |
60
+ | Tailwind CSS | 4 |
61
+ | Node (development only) | 24 |
62
+
63
+ ## Getting started
64
+
65
+ ```bash
66
+ ng add @xui/core
67
+ ```
68
+
69
+ That installs the core package and wires your global stylesheet: the theme import, the CDK overlay
70
+ stylesheet, and a `@source` glob pointing at the published packages. It is idempotent, so running it
71
+ again only adds what is missing. Use `nx add @xui/core` in an Nx workspace, and `--skip-overlay` if
72
+ you will not use dialogs, drawers, popovers, tooltips, menus or toasts.
73
+
74
+ Then add the components you need:
59
75
 
60
76
  ```bash
61
- pnpm i @xui/core ....
77
+ pnpm add @xui/button @xui/dialog @xui/icon
62
78
  ```
63
79
 
64
80
  ## Theming
65
81
 
66
- Every `@xui/*` component styles itself with semantic Tailwind utilities `bg-surface`,
67
- `text-foreground-muted`, `border-error-muted` — that resolve through the token layer shipped with
68
- `@xui/core`. Import it once, after Tailwind:
82
+ To wire the styles by hand, import the token layer once after Tailwind:
69
83
 
70
84
  ```css
71
85
  @import 'tailwindcss';
72
86
  @import '@xui/core/styles/theme.css';
73
87
 
74
- /* Only needed if you use an overlay surface — popover, tooltip, menu, dialog,
75
- drawer or toast. Without it overlays render in the document flow. */
88
+ /* Only needed for an overlay surface — popover, tooltip, menu, dialog, drawer
89
+ or toast. Without it, overlays render in the document flow. */
76
90
  @import '@angular/cdk/overlay-prebuilt.css';
77
91
 
78
- /* Tell Tailwind to scan the component sources for utility classes. */
92
+ /* Tailwind only emits utilities it can see, and it cannot see node_modules by default. */
79
93
  @source '../node_modules/@xui';
80
94
  ```
81
95
 
82
- Switch themes by putting `.dark` (or `[data-theme='dark']`) on `<html>`; with neither class
83
- present the theme follows `prefers-color-scheme`. Both selectors also work on any element, so a
84
- subtree can render in the opposite theme.
96
+ Put `.dark` (or `[data-theme='dark']`) on `<html>` to switch themes; with neither present the theme
97
+ follows `prefers-color-scheme`. Both selectors work on any element, so a subtree can render in the
98
+ opposite theme.
85
99
 
86
- Re-theme by overriding tokens after the import the `darker` / `lighter` / `subtle` / `muted` /
100
+ Re-theme by overriding tokens after the import. The `darker` / `lighter` / `subtle` / `muted` /
87
101
  `emphasis` steps of each intent are derived, so one declaration re-colours the whole ramp:
88
102
 
89
103
  ```css
@@ -93,37 +107,48 @@ Re-theme by overriding tokens after the import — the `darker` / `lighter` / `s
93
107
  }
94
108
  ```
95
109
 
96
- The full token reference, rendered in both themes, is the **Design Tokens** page in
97
- [Storybook](https://develop--67d2b4c756077a325913e5d9.chromatic.com/?globals=theme:dark).
110
+ Controls share one density scale 24 / 30 / 40px for `sm` / default / `lg` — so a button, an input
111
+ and a date field on the same row line up. Override `--control-height-md` to re-tune the library.
98
112
 
99
- ## Browser Support
113
+ The full token reference, rendered in both themes, is the **Design tokens** page in Storybook.
100
114
 
101
- xUI Supports most recent browsers according to Angular [support](https://angular.io/guide/browser-support).
115
+ ## Components
102
116
 
103
- ## Development
117
+ <details>
118
+ <summary><strong>All 90 packages</strong>, grouped as they appear in Storybook</summary>
104
119
 
105
- The project uses `NX` and `Angular` to build the package.
120
+ <br />
106
121
 
107
- To start docs page use
122
+ **Foundations** [`@xui/icon`](https://www.npmjs.com/package/@xui/icon) · [`@xui/link`](https://www.npmjs.com/package/@xui/link) · [`@xui/text`](https://www.npmjs.com/package/@xui/text)
108
123
 
109
- ```bash
110
- pnpm start
111
- ```
124
+ **Actions** — [`@xui/button`](https://www.npmjs.com/package/@xui/button) · [`@xui/button-group`](https://www.npmjs.com/package/@xui/button-group) · [`@xui/hotkeys`](https://www.npmjs.com/package/@xui/hotkeys)
112
125
 
113
- To start storybook use
126
+ **Forms** [`@xui/cascader`](https://www.npmjs.com/package/@xui/cascader) · [`@xui/checkbox`](https://www.npmjs.com/package/@xui/checkbox) · [`@xui/color-picker`](https://www.npmjs.com/package/@xui/color-picker) · [`@xui/control-card`](https://www.npmjs.com/package/@xui/control-card) · [`@xui/control-group`](https://www.npmjs.com/package/@xui/control-group) · [`@xui/editable-text`](https://www.npmjs.com/package/@xui/editable-text) · [`@xui/file-input`](https://www.npmjs.com/package/@xui/file-input) · [`@xui/form-field`](https://www.npmjs.com/package/@xui/form-field) · [`@xui/html-select`](https://www.npmjs.com/package/@xui/html-select) · [`@xui/input`](https://www.npmjs.com/package/@xui/input) · [`@xui/input-otp`](https://www.npmjs.com/package/@xui/input-otp) · [`@xui/label`](https://www.npmjs.com/package/@xui/label) · [`@xui/multi-select`](https://www.npmjs.com/package/@xui/multi-select) · [`@xui/numeric-input`](https://www.npmjs.com/package/@xui/numeric-input) · [`@xui/radio`](https://www.npmjs.com/package/@xui/radio) · [`@xui/rate`](https://www.npmjs.com/package/@xui/rate) · [`@xui/rich-text-editor`](https://www.npmjs.com/package/@xui/rich-text-editor) · [`@xui/segmented-control`](https://www.npmjs.com/package/@xui/segmented-control) · [`@xui/select`](https://www.npmjs.com/package/@xui/select) · [`@xui/slider`](https://www.npmjs.com/package/@xui/slider) · [`@xui/suggest`](https://www.npmjs.com/package/@xui/suggest) · [`@xui/switch`](https://www.npmjs.com/package/@xui/switch) · [`@xui/tag-input`](https://www.npmjs.com/package/@xui/tag-input) · [`@xui/textarea`](https://www.npmjs.com/package/@xui/textarea) · [`@xui/transfer`](https://www.npmjs.com/package/@xui/transfer) · [`@xui/tree-select`](https://www.npmjs.com/package/@xui/tree-select) · [`@xui/upload`](https://www.npmjs.com/package/@xui/upload)
114
127
 
115
- ```bash
116
- pnpm storybook
117
- ```
128
+ **Date & time** — [`@xui/date-input`](https://www.npmjs.com/package/@xui/date-input) · [`@xui/date-picker`](https://www.npmjs.com/package/@xui/date-picker) · [`@xui/date-range-input`](https://www.npmjs.com/package/@xui/date-range-input) · [`@xui/date-range-picker`](https://www.npmjs.com/package/@xui/date-range-picker) · [`@xui/time-picker`](https://www.npmjs.com/package/@xui/time-picker) · [`@xui/timezone-select`](https://www.npmjs.com/package/@xui/timezone-select)
129
+
130
+ **Data display** — [`@xui/avatar`](https://www.npmjs.com/package/@xui/avatar) · [`@xui/badge`](https://www.npmjs.com/package/@xui/badge) · [`@xui/card`](https://www.npmjs.com/package/@xui/card) · [`@xui/card-list`](https://www.npmjs.com/package/@xui/card-list) · [`@xui/carousel`](https://www.npmjs.com/package/@xui/carousel) · [`@xui/data-table`](https://www.npmjs.com/package/@xui/data-table) · [`@xui/descriptions`](https://www.npmjs.com/package/@xui/descriptions) · [`@xui/entity-title`](https://www.npmjs.com/package/@xui/entity-title) · [`@xui/kbd`](https://www.npmjs.com/package/@xui/kbd) · [`@xui/statistic`](https://www.npmjs.com/package/@xui/statistic) · [`@xui/status`](https://www.npmjs.com/package/@xui/status) · [`@xui/table`](https://www.npmjs.com/package/@xui/table) · [`@xui/tag`](https://www.npmjs.com/package/@xui/tag) · [`@xui/timeline`](https://www.npmjs.com/package/@xui/timeline) · [`@xui/tree`](https://www.npmjs.com/package/@xui/tree)
131
+
132
+ **Navigation** — [`@xui/breadcrumb`](https://www.npmjs.com/package/@xui/breadcrumb) · [`@xui/menubar`](https://www.npmjs.com/package/@xui/menubar) · [`@xui/navbar`](https://www.npmjs.com/package/@xui/navbar) · [`@xui/navigation-menu`](https://www.npmjs.com/package/@xui/navigation-menu) · [`@xui/pagination`](https://www.npmjs.com/package/@xui/pagination) · [`@xui/panel-stack`](https://www.npmjs.com/package/@xui/panel-stack) · [`@xui/steps`](https://www.npmjs.com/package/@xui/steps) · [`@xui/tabs`](https://www.npmjs.com/package/@xui/tabs)
133
+
134
+ **Overlays** — [`@xui/alert`](https://www.npmjs.com/package/@xui/alert) · [`@xui/alert-dialog`](https://www.npmjs.com/package/@xui/alert-dialog) · [`@xui/context-menu`](https://www.npmjs.com/package/@xui/context-menu) · [`@xui/dialog`](https://www.npmjs.com/package/@xui/dialog) · [`@xui/drawer`](https://www.npmjs.com/package/@xui/drawer) · [`@xui/menu`](https://www.npmjs.com/package/@xui/menu) · [`@xui/omnibar`](https://www.npmjs.com/package/@xui/omnibar) · [`@xui/popover`](https://www.npmjs.com/package/@xui/popover) · [`@xui/toast`](https://www.npmjs.com/package/@xui/toast) · [`@xui/tooltip`](https://www.npmjs.com/package/@xui/tooltip)
135
+
136
+ **Feedback** — [`@xui/callout`](https://www.npmjs.com/package/@xui/callout) · [`@xui/non-ideal-state`](https://www.npmjs.com/package/@xui/non-ideal-state) · [`@xui/progress-bar`](https://www.npmjs.com/package/@xui/progress-bar) · [`@xui/result`](https://www.npmjs.com/package/@xui/result) · [`@xui/skeleton`](https://www.npmjs.com/package/@xui/skeleton) · [`@xui/spinner`](https://www.npmjs.com/package/@xui/spinner)
137
+
138
+ **Layout** — [`@xui/accordion`](https://www.npmjs.com/package/@xui/accordion) · [`@xui/aspect-ratio`](https://www.npmjs.com/package/@xui/aspect-ratio) · [`@xui/collapse`](https://www.npmjs.com/package/@xui/collapse) · [`@xui/divider`](https://www.npmjs.com/package/@xui/divider) · [`@xui/dock-manager`](https://www.npmjs.com/package/@xui/dock-manager) · [`@xui/overflow-list`](https://www.npmjs.com/package/@xui/overflow-list) · [`@xui/scroll-area`](https://www.npmjs.com/package/@xui/scroll-area) · [`@xui/section`](https://www.npmjs.com/package/@xui/section) · [`@xui/splitter`](https://www.npmjs.com/package/@xui/splitter)
139
+
140
+ **Visualisation** — [`@xui/echarts`](https://www.npmjs.com/package/@xui/echarts) · [`@xui/konva`](https://www.npmjs.com/package/@xui/konva) · [`@xui/node-graph`](https://www.npmjs.com/package/@xui/node-graph)
141
+
142
+ </details>
118
143
 
119
144
  ## AI coding agents
120
145
 
121
146
  Two pieces of tooling teach coding agents how to build with xUI.
122
147
 
123
- **MCP server** — [`@xui/mcp`](https://github.com/Rikarin/xui/blob/HEAD/libs/mcp/README.md) exposes every package's real API (selectors,
124
- signal inputs, variant axes, outputs), the design tokens, the docs and the Storybook examples as
125
- MCP tools. It extracts them from the library sources, so all ~90 packages are covered and the
126
- answers match the installed version.
148
+ **MCP server** — [`@xui/mcp`](libs/mcp/README.md) exposes every package's real API (selectors, signal
149
+ inputs, variant axes, outputs), the design tokens, the docs and the Storybook examples as MCP tools.
150
+ It extracts them from the library sources, so every package is covered and the answers match the
151
+ installed version.
127
152
 
128
153
  ```json
129
154
  {
@@ -133,85 +158,46 @@ answers match the installed version.
133
158
  }
134
159
  ```
135
160
 
136
- In this repo, `.mcp.json` already points at `dist/libs/mcp/src/server.js` — run `pnpm nx build mcp`
137
- once so it exists.
161
+ In this repository `.mcp.json` already points at `dist/libs/mcp/src/server.js` — run
162
+ `pnpm nx build mcp` once so it exists.
138
163
 
139
- **Skill** — [`skills/xui`](https://github.com/Rikarin/xui/blob/HEAD/skills/xui/SKILL.md) is the procedural knowledge: the three-layer
164
+ **Skill** — [`skills/xui`](skills/xui/SKILL.md) is the procedural knowledge: the three-layer
140
165
  architecture, discovery through the MCP server, composition and styling rules, theming, the
141
166
  generators, and the conventions for authoring a package inside the monorepo. `.claude/skills/xui`
142
167
  links to it for agents working in this repository.
143
168
 
144
- ## Issues
145
-
146
- If you find any issues in the library or have and idea for an improvement feel free to open an [issue](https://github.com/Rikarin/xui/issues).
147
-
148
- ## Roadmap
149
-
150
- - [ ] Accordion
151
- - [ ] Alert
152
- - [ ] Alert Dialog
153
- - [ ] Avatar
154
- - [ ] Calendar
155
- - [ ] Card
156
- - [ ] Carousel
157
- - [ ] Collapsible
158
- - [ ] Combobox
159
- - [ ] Command
160
- - [ ] Date Picker
161
- - [ ] Date Range Picker
162
- - [ ] Dialog
163
- - [ ] Hover Card
164
- - [ ] Menu
165
- - [ ] Pagination
166
- - [ ] Popover
167
- - [ ] Progress
168
- - [ ] Radio Group
169
- - [ ] Scroll Area
170
- - [ ] Select
171
- - [ ] Separator
172
- - [ ] Sheet
173
- - [ ] Slider
174
- - [ ] Switch
175
- - [ ] Tabs
176
- - [ ] Toggle
177
- - [ ] Tooltip
178
- - [ ] Typography
179
- - [ ] Input OTP
180
- - [ ] Toggle Group
181
-
182
- ### Additional
183
-
184
- - [ ] Decagram
185
- - [ ] Settings
186
- - [ ] Drawer
187
- - [ ] Panel Bar
188
- - [ ] Textarea
189
- - [ ] Time Picker
190
- - [ ] Image Upload
191
- - [ ] Banner
192
- - [ ] Snack bar
193
-
194
- ## Opinionated "components"
195
-
196
- - [ ] Graph View (Nodes)
197
- - [ ] Analysis
198
- - [ ] Charts (NG Charts?)
199
-
200
- ## CLI
201
-
202
- Make cli to install the components
203
-
204
- ## TODO
205
-
206
- - Button
207
-
208
- - Icon
209
- - Shine
210
-
211
- - Breadcrumb
212
-
213
- - fix styling issues
214
- - on hover stuff
215
- - data driven component
216
-
217
- - adjust generator to generate stories into the apps/storybook
169
+ ## Browser support
170
+
171
+ The browsers Angular itself supports see the
172
+ [Angular browser support policy](https://angular.dev/reference/versions#browser-support).
173
+
174
+ ## Development
175
+
176
+ The workspace is [Nx](https://nx.dev) + pnpm.
177
+
178
+ ```bash
179
+ pnpm install
180
+ pnpm start # documentation site on :4200
181
+ pnpm storybook # component gallery on :4400
182
+ pnpm nx serve admin # the example admin application
183
+ pnpm test # unit tests
184
+ pnpm nx test-storybook ui-storybook # render every story in headless Chromium
185
+ pnpm build # build every package
186
+ ```
187
+
188
+ Commits follow [Conventional Commits](https://www.conventionalcommits.org) and are linted — the
189
+ release is cut from them. See [docs/releasing.md](docs/releasing.md) for how a version is published,
190
+ [apps/ui-storybook/README.md](apps/ui-storybook/README.md) before writing stories, and
191
+ [apps/app/README.md](apps/app/README.md) for the documentation site, whose component pages are
192
+ generated from those same stories, and [apps/admin/README.md](apps/admin/README.md) for the example
193
+ admin application a full app built from these packages, which is the fastest way to see how they
194
+ fit together.
195
+
196
+ ## Contributing
197
+
198
+ Bugs and ideas are welcome in [issues](https://github.com/Rikarin/xui/issues). For a change of any
199
+ size, open an issue first so the API can be agreed before the code exists.
200
+
201
+ ## License
202
+
203
+ See [LICENSE](LICENSE).
@@ -1,6 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { input, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { xui } from '@xui/core';
3
+ import { provideIcons, NgIcon } from '@ng-icons/core';
4
+ import { matPriorityHighRound, matInfoRound, matCloseRound, matCheckRound } from '@ng-icons/material-icons/round';
5
+ import { createXConfigToken, xui } from '@xui/core';
6
+ import { XuiIcon } from '@xui/icon';
7
+
8
+ const [injectXuiResultConfig, provideXuiResultConfig] = createXConfigToken('XuiResultConfig', {
9
+ status: 'info'
10
+ });
4
11
 
5
12
  /**
6
13
  * A result / status page — a large status glyph over a title and subtitle, with
@@ -14,9 +21,10 @@ import { xui } from '@xui/core';
14
21
  * ```
15
22
  */
16
23
  class XuiResult {
24
+ config = injectXuiResultConfig();
17
25
  class = input('', /* @ts-ignore */
18
26
  ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
19
- status = input('info', /* @ts-ignore */
27
+ status = input(this.config.status, /* @ts-ignore */
20
28
  ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
21
29
  title = input('', /* @ts-ignore */
22
30
  ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
@@ -24,44 +32,28 @@ class XuiResult {
24
32
  ...(ngDevMode ? [{ debugName: "subtitle" }] : /* istanbul ignore next */ []));
25
33
  computedClass = computed(() => xui('flex flex-col items-center gap-3 p-8 text-center', this.class()), /* @ts-ignore */
26
34
  ...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
27
- glyphClass = computed(() => xui('h-9 w-9', tintText(this.status())), /* @ts-ignore */
35
+ glyphClass = computed(() => xui(tintText(this.status())), /* @ts-ignore */
28
36
  ...(ngDevMode ? [{ debugName: "glyphClass" }] : /* istanbul ignore next */ []));
29
- iconWrapClass = computed(() => xui('mb-2 flex h-16 w-16 items-center justify-center rounded-full', tintBg(this.status())), /* @ts-ignore */
37
+ iconWrapClass = computed(() => xui('mb-2 flex size-16 items-center justify-center rounded-full', tintBg(this.status())), /* @ts-ignore */
30
38
  ...(ngDevMode ? [{ debugName: "iconWrapClass" }] : /* istanbul ignore next */ []));
31
39
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: XuiResult, deps: [], target: i0.ɵɵFactoryTarget.Component });
32
40
  /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: XuiResult, isStandalone: true, selector: "xui-result", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "computedClass()" } }, ngImport: i0, template: `
33
41
  <div [class]="iconWrapClass()">
34
42
  @switch (status()) {
35
43
  @case ('success') {
36
- <svg viewBox="0 0 24 24" [class]="glyphClass()" fill="none">
37
- <path
38
- d="M20 6 9 17l-5-5"
39
- stroke="currentColor"
40
- stroke-width="2"
41
- stroke-linecap="round"
42
- stroke-linejoin="round"
43
- />
44
- </svg>
44
+ <ng-icon xui size="2.25rem" [class]="glyphClass()" name="matCheckRound" />
45
45
  }
46
46
  @case ('error') {
47
- <svg viewBox="0 0 24 24" [class]="glyphClass()" fill="none">
48
- <path d="M18 6 6 18M6 6l12 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
49
- </svg>
47
+ <ng-icon xui size="2.25rem" [class]="glyphClass()" name="matCloseRound" />
50
48
  }
51
49
  @case ('warning') {
52
- <svg viewBox="0 0 24 24" [class]="glyphClass()" fill="none">
53
- <path d="M12 8v5" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
54
- <circle cx="12" cy="16.5" r="1.1" fill="currentColor" />
55
- </svg>
50
+ <ng-icon xui size="2.25rem" [class]="glyphClass()" name="matPriorityHighRound" />
56
51
  }
57
52
  @default {
58
53
  @if (status() === '404' || status() === '403' || status() === '500') {
59
54
  <span class="text-foreground-muted text-3xl font-bold tabular-nums">{{ status() }}</span>
60
55
  } @else {
61
- <svg viewBox="0 0 24 24" [class]="glyphClass()" fill="none">
62
- <path d="M12 11v5" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
63
- <circle cx="12" cy="7.5" r="1.1" fill="currentColor" />
64
- </svg>
56
+ <ng-icon xui size="2.25rem" [class]="glyphClass()" name="matInfoRound" />
65
57
  }
66
58
  }
67
59
  }
@@ -77,7 +69,7 @@ class XuiResult {
77
69
  <div class="mt-4 flex flex-wrap justify-center gap-2 empty:hidden">
78
70
  <ng-content select="[xuiResultExtra]" />
79
71
  </div>
80
- `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
72
+ `, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: XuiIcon, selector: "ng-icon[xui]", inputs: ["class", "size", "color", "label"], exportAs: ["xuiIcon"] }], viewProviders: [provideIcons({ matCheckRound, matCloseRound, matInfoRound, matPriorityHighRound })], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
81
73
  }
82
74
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: XuiResult, decorators: [{
83
75
  type: Component,
@@ -87,35 +79,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
87
79
  <div [class]="iconWrapClass()">
88
80
  @switch (status()) {
89
81
  @case ('success') {
90
- <svg viewBox="0 0 24 24" [class]="glyphClass()" fill="none">
91
- <path
92
- d="M20 6 9 17l-5-5"
93
- stroke="currentColor"
94
- stroke-width="2"
95
- stroke-linecap="round"
96
- stroke-linejoin="round"
97
- />
98
- </svg>
82
+ <ng-icon xui size="2.25rem" [class]="glyphClass()" name="matCheckRound" />
99
83
  }
100
84
  @case ('error') {
101
- <svg viewBox="0 0 24 24" [class]="glyphClass()" fill="none">
102
- <path d="M18 6 6 18M6 6l12 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
103
- </svg>
85
+ <ng-icon xui size="2.25rem" [class]="glyphClass()" name="matCloseRound" />
104
86
  }
105
87
  @case ('warning') {
106
- <svg viewBox="0 0 24 24" [class]="glyphClass()" fill="none">
107
- <path d="M12 8v5" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
108
- <circle cx="12" cy="16.5" r="1.1" fill="currentColor" />
109
- </svg>
88
+ <ng-icon xui size="2.25rem" [class]="glyphClass()" name="matPriorityHighRound" />
110
89
  }
111
90
  @default {
112
91
  @if (status() === '404' || status() === '403' || status() === '500') {
113
92
  <span class="text-foreground-muted text-3xl font-bold tabular-nums">{{ status() }}</span>
114
93
  } @else {
115
- <svg viewBox="0 0 24 24" [class]="glyphClass()" fill="none">
116
- <path d="M12 11v5" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
117
- <circle cx="12" cy="7.5" r="1.1" fill="currentColor" />
118
- </svg>
94
+ <ng-icon xui size="2.25rem" [class]="glyphClass()" name="matInfoRound" />
119
95
  }
120
96
  }
121
97
  }
@@ -135,6 +111,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
135
111
  host: {
136
112
  '[class]': 'computedClass()'
137
113
  },
114
+ imports: [NgIcon, XuiIcon],
115
+ viewProviders: [provideIcons({ matCheckRound, matCloseRound, matInfoRound, matPriorityHighRound })],
138
116
  changeDetection: ChangeDetectionStrategy.OnPush,
139
117
  encapsulation: ViewEncapsulation.None
140
118
  }]
@@ -162,5 +140,5 @@ const XuiResultImports = [XuiResult];
162
140
  * Generated bundle index. Do not edit.
163
141
  */
164
142
 
165
- export { XuiResult, XuiResultImports };
143
+ export { XuiResult, XuiResultImports, injectXuiResultConfig, provideXuiResultConfig };
166
144
  //# sourceMappingURL=xui-result.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"xui-result.mjs","sources":["../../../../../../libs/ui/result/xui/src/lib/result.ts","../../../../../../libs/ui/result/xui/src/index.ts","../../../../../../libs/ui/result/xui/src/xui-result.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, ViewEncapsulation } from '@angular/core';\nimport { xui } from '@xui/core';\nimport type { ClassValue } from 'clsx';\n\nexport type ResultStatus = 'success' | 'error' | 'info' | 'warning' | '404' | '403' | '500';\n\n/**\n * A result / status page — a large status glyph over a title and subtitle, with\n * optional body content and an `[xuiResultExtra]` action slot. `status` picks the\n * icon and tint (success/error/info/warning) or shows an HTTP code (404/403/500).\n *\n * ```html\n * <xui-result status=\"success\" title=\"Payment received\" subtitle=\"Order #1024 is confirmed.\">\n * <button xuiButton xuiResultExtra>Go home</button>\n * </xui-result>\n * ```\n */\n@Component({\n selector: 'xui-result',\n template: `\n <div [class]=\"iconWrapClass()\">\n @switch (status()) {\n @case ('success') {\n <svg viewBox=\"0 0 24 24\" [class]=\"glyphClass()\" fill=\"none\">\n <path\n d=\"M20 6 9 17l-5-5\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n }\n @case ('error') {\n <svg viewBox=\"0 0 24 24\" [class]=\"glyphClass()\" fill=\"none\">\n <path d=\"M18 6 6 18M6 6l12 12\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n }\n @case ('warning') {\n <svg viewBox=\"0 0 24 24\" [class]=\"glyphClass()\" fill=\"none\">\n <path d=\"M12 8v5\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n <circle cx=\"12\" cy=\"16.5\" r=\"1.1\" fill=\"currentColor\" />\n </svg>\n }\n @default {\n @if (status() === '404' || status() === '403' || status() === '500') {\n <span class=\"text-foreground-muted text-3xl font-bold tabular-nums\">{{ status() }}</span>\n } @else {\n <svg viewBox=\"0 0 24 24\" [class]=\"glyphClass()\" fill=\"none\">\n <path d=\"M12 11v5\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n <circle cx=\"12\" cy=\"7.5\" r=\"1.1\" fill=\"currentColor\" />\n </svg>\n }\n }\n }\n </div>\n\n @if (title()) {\n <h2 class=\"text-foreground text-xl font-semibold\">{{ title() }}</h2>\n }\n @if (subtitle()) {\n <p class=\"text-foreground-muted max-w-prose\">{{ subtitle() }}</p>\n }\n <div class=\"w-full empty:hidden\"><ng-content /></div>\n <div class=\"mt-4 flex flex-wrap justify-center gap-2 empty:hidden\">\n <ng-content select=\"[xuiResultExtra]\" />\n </div>\n `,\n host: {\n '[class]': 'computedClass()'\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiResult {\n readonly class = input<ClassValue>('');\n\n readonly status = input<ResultStatus>('info');\n readonly title = input<string>('');\n readonly subtitle = input<string>('');\n\n protected readonly computedClass = computed(() =>\n xui('flex flex-col items-center gap-3 p-8 text-center', this.class())\n );\n\n protected readonly glyphClass = computed(() => xui('h-9 w-9', tintText(this.status())));\n protected readonly iconWrapClass = computed(() =>\n xui('mb-2 flex h-16 w-16 items-center justify-center rounded-full', tintBg(this.status()))\n );\n}\n\nconst tintText = (status: ResultStatus): string =>\n status === 'success'\n ? 'text-success'\n : status === 'error'\n ? 'text-error'\n : status === 'warning'\n ? 'text-warning'\n : 'text-info';\n\nconst tintBg = (status: ResultStatus): string =>\n status === 'success'\n ? 'bg-success/10'\n : status === 'error'\n ? 'bg-error/10'\n : status === 'warning'\n ? 'bg-warning/10'\n : status === 'info'\n ? 'bg-info/10'\n : 'bg-surface-inset';\n","import { XuiResult } from './lib/result';\n\nexport * from './lib/result';\n\nexport const XuiResultImports = [XuiResult] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAMA;;;;;;;;;;AAUG;MA0DU,SAAS,CAAA;IACX,KAAK,GAAG,KAAK,CAAa,EAAE;8EAAC;IAE7B,MAAM,GAAG,KAAK,CAAe,MAAM;+EAAC;IACpC,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;IACzB,QAAQ,GAAG,KAAK,CAAS,EAAE;iFAAC;AAElB,IAAA,aAAa,GAAG,QAAQ,CAAC,MAC1C,GAAG,CAAC,kDAAkD,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;sFACtE;AAEkB,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;mFAAC;AACpE,IAAA,aAAa,GAAG,QAAQ,CAAC,MAC1C,GAAG,CAAC,8DAA8D,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;sFAC3F;0HAdU,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAT,uBAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,E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MAAM,GAAG,CAAC,MAAoB,KAClC,MAAM,KAAK;AACT,MAAE;MACA,MAAM,KAAK;AACX,UAAE;UACA,MAAM,KAAK;AACX,cAAE;cACA,MAAM,KAAK;AACX,kBAAE;kBACA,kBAAkB;;ACzGvB,MAAM,gBAAgB,GAAG,CAAC,SAAS;;ACJ1C;;AAEG;;;;"}
1
+ {"version":3,"file":"xui-result.mjs","sources":["../../../../../../libs/ui/result/xui/src/lib/result.token.ts","../../../../../../libs/ui/result/xui/src/lib/result.ts","../../../../../../libs/ui/result/xui/src/index.ts","../../../../../../libs/ui/result/xui/src/xui-result.ts"],"sourcesContent":["import { createXConfigToken } from '@xui/core';\nimport type { XuiResultStatus } from './result';\n\n/**\n * Application-wide defaults for XuiResult.\n *\n * Provide it once at the app root to change every result page without touching\n * call sites; individual inputs still override the configured value.\n */\nexport interface XuiResultConfig {\n status: XuiResultStatus;\n}\n\nexport const [injectXuiResultConfig, provideXuiResultConfig] = createXConfigToken<XuiResultConfig>('XuiResultConfig', {\n status: 'info'\n});\n","import { ChangeDetectionStrategy, Component, computed, input, ViewEncapsulation } from '@angular/core';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { matCheckRound, matCloseRound, matInfoRound, matPriorityHighRound } from '@ng-icons/material-icons/round';\nimport { xui } from '@xui/core';\nimport { XuiIcon } from '@xui/icon';\nimport type { ClassValue } from 'clsx';\nimport { injectXuiResultConfig } from './result.token';\n\nexport type XuiResultStatus = 'success' | 'error' | 'info' | 'warning' | '404' | '403' | '500';\n\n/**\n * A result / status page — a large status glyph over a title and subtitle, with\n * optional body content and an `[xuiResultExtra]` action slot. `status` picks the\n * icon and tint (success/error/info/warning) or shows an HTTP code (404/403/500).\n *\n * ```html\n * <xui-result status=\"success\" title=\"Payment received\" subtitle=\"Order #1024 is confirmed.\">\n * <button xuiButton xuiResultExtra>Go home</button>\n * </xui-result>\n * ```\n */\n@Component({\n selector: 'xui-result',\n template: `\n <div [class]=\"iconWrapClass()\">\n @switch (status()) {\n @case ('success') {\n <ng-icon xui size=\"2.25rem\" [class]=\"glyphClass()\" name=\"matCheckRound\" />\n }\n @case ('error') {\n <ng-icon xui size=\"2.25rem\" [class]=\"glyphClass()\" name=\"matCloseRound\" />\n }\n @case ('warning') {\n <ng-icon xui size=\"2.25rem\" [class]=\"glyphClass()\" name=\"matPriorityHighRound\" />\n }\n @default {\n @if (status() === '404' || status() === '403' || status() === '500') {\n <span class=\"text-foreground-muted text-3xl font-bold tabular-nums\">{{ status() }}</span>\n } @else {\n <ng-icon xui size=\"2.25rem\" [class]=\"glyphClass()\" name=\"matInfoRound\" />\n }\n }\n }\n </div>\n\n @if (title()) {\n <h2 class=\"text-foreground text-xl font-semibold\">{{ title() }}</h2>\n }\n @if (subtitle()) {\n <p class=\"text-foreground-muted max-w-prose\">{{ subtitle() }}</p>\n }\n <div class=\"w-full empty:hidden\"><ng-content /></div>\n <div class=\"mt-4 flex flex-wrap justify-center gap-2 empty:hidden\">\n <ng-content select=\"[xuiResultExtra]\" />\n </div>\n `,\n host: {\n '[class]': 'computedClass()'\n },\n imports: [NgIcon, XuiIcon],\n viewProviders: [provideIcons({ matCheckRound, matCloseRound, matInfoRound, matPriorityHighRound })],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class XuiResult {\n private readonly config = injectXuiResultConfig();\n\n readonly class = input<ClassValue>('');\n\n readonly status = input<XuiResultStatus>(this.config.status);\n readonly title = input<string>('');\n readonly subtitle = input<string>('');\n\n protected readonly computedClass = computed(() =>\n xui('flex flex-col items-center gap-3 p-8 text-center', this.class())\n );\n\n protected readonly glyphClass = computed(() => xui(tintText(this.status())));\n protected readonly iconWrapClass = computed(() =>\n xui('mb-2 flex size-16 items-center justify-center rounded-full', tintBg(this.status()))\n );\n}\n\nconst tintText = (status: XuiResultStatus): string =>\n status === 'success'\n ? 'text-success'\n : status === 'error'\n ? 'text-error'\n : status === 'warning'\n ? 'text-warning'\n : 'text-info';\n\nconst tintBg = (status: XuiResultStatus): string =>\n status === 'success'\n ? 'bg-success/10'\n : status === 'error'\n ? 'bg-error/10'\n : status === 'warning'\n ? 'bg-warning/10'\n : status === 'info'\n ? 'bg-info/10'\n : 'bg-surface-inset';\n","import { XuiResult } from './lib/result';\n\nexport * from './lib/result';\nexport * from './lib/result.token';\n\nexport const XuiResultImports = [XuiResult] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAaO,MAAM,CAAC,qBAAqB,EAAE,sBAAsB,CAAC,GAAG,kBAAkB,CAAkB,iBAAiB,EAAE;AACpH,IAAA,MAAM,EAAE;AACT,CAAA;;ACLD;;;;;;;;;;AAUG;MA4CU,SAAS,CAAA;IACH,MAAM,GAAG,qBAAqB,EAAE;IAExC,KAAK,GAAG,KAAK,CAAa,EAAE;8EAAC;AAE7B,IAAA,MAAM,GAAG,KAAK,CAAkB,IAAI,CAAC,MAAM,CAAC,MAAM;+EAAC;IACnD,KAAK,GAAG,KAAK,CAAS,EAAE;8EAAC;IACzB,QAAQ,GAAG,KAAK,CAAS,EAAE;iFAAC;AAElB,IAAA,aAAa,GAAG,QAAQ,CAAC,MAC1C,GAAG,CAAC,kDAAkD,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;sFACtE;AAEkB,IAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;mFAAC;AACzD,IAAA,aAAa,GAAG,QAAQ,CAAC,MAC1C,GAAG,CAAC,4DAA4D,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;sFACzF;0HAhBU,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAT,uBAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,E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.11",
3
+ "version": "2.0.0-alpha.12",
4
4
  "description": "Modern Angular 22 UI Library based on TailwindCSS",
5
5
  "keywords": [
6
6
  "angular",
@@ -37,7 +37,10 @@
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@angular/core": "22",
40
- "@xui/core": "2.0.0-alpha.11",
40
+ "@ng-icons/core": "34",
41
+ "@ng-icons/material-icons": "34",
42
+ "@xui/core": "2.0.0-alpha.12",
43
+ "@xui/icon": "2.0.0-alpha.12",
41
44
  "clsx": "^2.1.1"
42
45
  },
43
46
  "publishConfig": {
@@ -1,7 +1,7 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { ClassValue } from 'clsx';
3
3
 
4
- type ResultStatus = 'success' | 'error' | 'info' | 'warning' | '404' | '403' | '500';
4
+ type XuiResultStatus = 'success' | 'error' | 'info' | 'warning' | '404' | '403' | '500';
5
5
  /**
6
6
  * A result / status page — a large status glyph over a title and subtitle, with
7
7
  * optional body content and an `[xuiResultExtra]` action slot. `status` picks the
@@ -14,8 +14,9 @@ type ResultStatus = 'success' | 'error' | 'info' | 'warning' | '404' | '403' | '
14
14
  * ```
15
15
  */
16
16
  declare class XuiResult {
17
+ private readonly config;
17
18
  readonly class: _angular_core.InputSignal<ClassValue>;
18
- readonly status: _angular_core.InputSignal<ResultStatus>;
19
+ readonly status: _angular_core.InputSignal<XuiResultStatus>;
19
20
  readonly title: _angular_core.InputSignal<string>;
20
21
  readonly subtitle: _angular_core.InputSignal<string>;
21
22
  protected readonly computedClass: _angular_core.Signal<string>;
@@ -25,7 +26,19 @@ declare class XuiResult {
25
26
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<XuiResult, "xui-result", never, { "class": { "alias": "class"; "required": false; "isSignal": true; }; "status": { "alias": "status"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "subtitle": { "alias": "subtitle"; "required": false; "isSignal": true; }; }, {}, never, ["*", "[xuiResultExtra]"], true, never>;
26
27
  }
27
28
 
29
+ /**
30
+ * Application-wide defaults for XuiResult.
31
+ *
32
+ * Provide it once at the app root to change every result page without touching
33
+ * call sites; individual inputs still override the configured value.
34
+ */
35
+ interface XuiResultConfig {
36
+ status: XuiResultStatus;
37
+ }
38
+ declare const injectXuiResultConfig: () => XuiResultConfig;
39
+ declare const provideXuiResultConfig: (config: Partial<XuiResultConfig>) => _angular_core.ValueProvider;
40
+
28
41
  declare const XuiResultImports: readonly [typeof XuiResult];
29
42
 
30
- export { XuiResult, XuiResultImports };
31
- export type { ResultStatus };
43
+ export { XuiResult, XuiResultImports, injectXuiResultConfig, provideXuiResultConfig };
44
+ export type { XuiResultConfig, XuiResultStatus };