@xui/tag-input 2.0.0-alpha.11 → 2.0.0-alpha.13

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,13 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
- import { forwardRef, input, model, booleanAttribute, output, signal, viewChild, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
2
+ import { input, model, booleanAttribute, output, signal, viewChild, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
4
3
  import { provideIcons, NgIcon } from '@ng-icons/core';
5
4
  import { matCloseRound } from '@ng-icons/material-icons/round';
6
5
  import { xui } from '@xui/core';
6
+ import { createXValueAccessor, provideXValueAccessor } from '@xui/core/forms';
7
7
  import { XuiIcon } from '@xui/icon';
8
8
  import { cva } from 'class-variance-authority';
9
9
 
10
- const containerVariants = cva([
10
+ const tagInputContainerVariants = cva([
11
11
  'flex min-h-(--control-height-md) flex-wrap items-center gap-1.5 rounded-lg border border-border bg-surface-inset px-(--control-padding-sm) py-0.5 text-sm',
12
12
  'focus-within:border-focus transition-colors',
13
13
  'data-disabled:cursor-not-allowed data-disabled:opacity-50'
@@ -17,11 +17,6 @@ const containerVariants = cva([
17
17
  },
18
18
  defaultVariants: { fill: false }
19
19
  });
20
- const XUI_TAG_INPUT_VALUE_ACCESSOR = {
21
- provide: NG_VALUE_ACCESSOR,
22
- useExisting: forwardRef(() => XuiTagInput),
23
- multi: true
24
- };
25
20
  /**
26
21
  * A token/chip input: type and press Enter (or the separator) to add a tag, click
27
22
  * a tag's ✕ or press Backspace on an empty field to remove one. `[(values)]`
@@ -54,15 +49,14 @@ class XuiTagInput {
54
49
  ...(ngDevMode ? [{ debugName: "draft" }] : /* istanbul ignore next */ []));
55
50
  field = viewChild('field', /* @ts-ignore */
56
51
  ...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
57
- onChange;
58
- onTouched;
59
- disabledByForm = signal(false, /* @ts-ignore */
60
- ...(ngDevMode ? [{ debugName: "disabledByForm" }] : /* istanbul ignore next */ []));
61
- isDisabled = computed(() => this.disabled() || this.disabledByForm(), /* @ts-ignore */
62
- ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
52
+ cva = createXValueAccessor({
53
+ onWrite: value => this.values.set(value ?? []),
54
+ disabled: this.disabled
55
+ });
56
+ isDisabled = this.cva.disabled;
63
57
  computedClass = computed(() => xui('block', this.class()), /* @ts-ignore */
64
58
  ...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
65
- containerClass = computed(() => xui(containerVariants({ fill: this.fill() })), /* @ts-ignore */
59
+ containerClass = computed(() => xui(tagInputContainerVariants({ fill: this.fill() })), /* @ts-ignore */
66
60
  ...(ngDevMode ? [{ debugName: "containerClass" }] : /* istanbul ignore next */ []));
67
61
  onInput(event) {
68
62
  this.draft.set(event.target.value);
@@ -94,7 +88,7 @@ class XuiTagInput {
94
88
  if (this.addOnBlur()) {
95
89
  this.commitDraft();
96
90
  }
97
- this.onTouched?.();
91
+ this.cva.markTouched();
98
92
  }
99
93
  focusInput(event) {
100
94
  // Clicking the container (but not a tag's button) focuses the field.
@@ -144,23 +138,15 @@ class XuiTagInput {
144
138
  }
145
139
  commit(next) {
146
140
  this.values.set(next);
147
- this.onChange?.(next);
141
+ this.cva.notifyChange(next);
148
142
  }
149
143
  // --- ControlValueAccessor ---
150
- writeValue(value) {
151
- this.values.set(value ?? []);
152
- }
153
- registerOnChange(fn) {
154
- this.onChange = fn;
155
- }
156
- registerOnTouched(fn) {
157
- this.onTouched = fn;
158
- }
159
- setDisabledState(isDisabled) {
160
- this.disabledByForm.set(isDisabled);
161
- }
144
+ writeValue = this.cva.writeValue;
145
+ registerOnChange = this.cva.registerOnChange;
146
+ registerOnTouched = this.cva.registerOnTouched;
147
+ setDisabledState = this.cva.setDisabledState;
162
148
  /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: XuiTagInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
163
- /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: XuiTagInput, isStandalone: true, selector: "xui-tag-input", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, addOnBlur: { classPropertyName: "addOnBlur", publicName: "addOnBlur", isSignal: true, isRequired: false, transformFunction: null }, addOnPaste: { classPropertyName: "addOnPaste", publicName: "addOnPaste", isSignal: true, isRequired: false, transformFunction: null }, allowDuplicates: { classPropertyName: "allowDuplicates", publicName: "allowDuplicates", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { values: "valuesChange", added: "added", removed: "removed" }, host: { properties: { "class": "computedClass()", "attr.data-disabled": "isDisabled() ? \"\" : null" } }, providers: [XUI_TAG_INPUT_VALUE_ACCESSOR], viewQueries: [{ propertyName: "field", first: true, predicate: ["field"], descendants: true, isSignal: true }], ngImport: i0, template: `
149
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: XuiTagInput, isStandalone: true, selector: "xui-tag-input", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, addOnBlur: { classPropertyName: "addOnBlur", publicName: "addOnBlur", isSignal: true, isRequired: false, transformFunction: null }, addOnPaste: { classPropertyName: "addOnPaste", publicName: "addOnPaste", isSignal: true, isRequired: false, transformFunction: null }, allowDuplicates: { classPropertyName: "allowDuplicates", publicName: "allowDuplicates", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { values: "valuesChange", added: "added", removed: "removed" }, host: { properties: { "class": "computedClass()", "attr.data-disabled": "isDisabled() ? \"\" : null" } }, providers: [provideXValueAccessor((() => XuiTagInput))], viewQueries: [{ propertyName: "field", first: true, predicate: ["field"], descendants: true, isSignal: true }], ngImport: i0, template: `
164
150
  <!-- Clicking empty container space focuses the real input, which is itself
165
151
  focusable and keyboard-operable, so no separate key handler is needed. -->
166
152
  <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->
@@ -194,7 +180,7 @@ class XuiTagInput {
194
180
  (blur)="onBlur()"
195
181
  />
196
182
  </div>
197
- `, 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", "title"], exportAs: ["xuiIcon"] }], viewProviders: [provideIcons({ matCloseRound })], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
183
+ `, 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({ matCloseRound })], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
198
184
  }
199
185
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: XuiTagInput, decorators: [{
200
186
  type: Component,
@@ -240,7 +226,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
240
226
  '[class]': 'computedClass()',
241
227
  '[attr.data-disabled]': 'isDisabled() ? "" : null'
242
228
  },
243
- providers: [XUI_TAG_INPUT_VALUE_ACCESSOR],
229
+ providers: [provideXValueAccessor((() => XuiTagInput))],
244
230
  changeDetection: ChangeDetectionStrategy.OnPush,
245
231
  encapsulation: ViewEncapsulation.None,
246
232
  viewProviders: [provideIcons({ matCloseRound })]
@@ -253,5 +239,5 @@ const XuiTagInputImports = [XuiTagInput];
253
239
  * Generated bundle index. Do not edit.
254
240
  */
255
241
 
256
- export { XUI_TAG_INPUT_VALUE_ACCESSOR, XuiTagInput, XuiTagInputImports };
242
+ export { XuiTagInput, XuiTagInputImports, tagInputContainerVariants };
257
243
  //# sourceMappingURL=xui-tag-input.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"xui-tag-input.mjs","sources":["../../../../../../libs/ui/tag-input/xui/src/lib/tag-input.ts","../../../../../../libs/ui/tag-input/xui/src/index.ts","../../../../../../libs/ui/tag-input/xui/src/xui-tag-input.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n forwardRef,\n input,\n model,\n output,\n signal,\n viewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { matCloseRound } from '@ng-icons/material-icons/round';\nimport { xui } from '@xui/core';\nimport type { ChangeFn, TouchFn } from '@xui/core/forms';\nimport { XuiIcon } from '@xui/icon';\nimport { cva, VariantProps } from 'class-variance-authority';\nimport type { ClassValue } from 'clsx';\n\nconst containerVariants = cva(\n [\n 'flex min-h-(--control-height-md) flex-wrap items-center gap-1.5 rounded-lg border border-border bg-surface-inset px-(--control-padding-sm) py-0.5 text-sm',\n 'focus-within:border-focus transition-colors',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50'\n ],\n {\n variants: {\n fill: { true: 'w-full', false: 'min-w-72' }\n },\n defaultVariants: { fill: false }\n }\n);\n\nexport type TagInputVariants = VariantProps<typeof containerVariants>;\n\nexport const XUI_TAG_INPUT_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => XuiTagInput),\n multi: true\n};\n\n/**\n * A token/chip input: type and press Enter (or the separator) to add a tag, click\n * a tag's ✕ or press Backspace on an empty field to remove one. `[(values)]`\n * two-way binding and `ControlValueAccessor` over a `string[]`.\n */\n@Component({\n selector: 'xui-tag-input',\n imports: [NgIcon, XuiIcon],\n template: `\n <!-- Clicking empty container space focuses the real input, which is itself\n focusable and keyboard-operable, so no separate key handler is needed. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div [class]=\"containerClass()\" (click)=\"focusInput($event)\">\n @for (tag of values(); track $index) {\n <span class=\"bg-surface-raised text-foreground inline-flex items-center gap-1 rounded px-2 py-0.5\">\n {{ tag }}\n @if (!isDisabled()) {\n <button\n type=\"button\"\n class=\"text-foreground-muted hover:text-foreground -me-0.5 flex items-center\"\n [attr.aria-label]=\"'Remove ' + tag\"\n (click)=\"removeAt($index); $event.stopPropagation()\"\n >\n <ng-icon xui size=\"xs\" name=\"matCloseRound\" />\n </button>\n }\n </span>\n }\n\n <input\n #field\n type=\"text\"\n class=\"text-foreground placeholder:text-foreground-subtle min-w-24 flex-1 bg-transparent outline-none\"\n [value]=\"draft()\"\n [placeholder]=\"values().length ? '' : placeholder()\"\n [disabled]=\"isDisabled()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (paste)=\"onPaste($event)\"\n (blur)=\"onBlur()\"\n />\n </div>\n `,\n host: {\n '[class]': 'computedClass()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : null'\n },\n providers: [XUI_TAG_INPUT_VALUE_ACCESSOR],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n viewProviders: [provideIcons({ matCloseRound })]\n})\nexport class XuiTagInput implements ControlValueAccessor {\n readonly class = input<ClassValue>('');\n\n /** The current tags. Two-way bindable with `[(values)]`. */\n readonly values = model<string[]>([]);\n\n readonly placeholder = input<string>('');\n readonly fill = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Character that also commits the current draft (besides Enter). */\n readonly separator = input<string>(',');\n\n /** Commit the draft when the field loses focus. */\n readonly addOnBlur = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Split pasted text on the separator and add each piece. */\n readonly addOnPaste = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** Reject a tag that already exists. */\n readonly allowDuplicates = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Emits each tag as it is added. */\n readonly added = output<string>();\n /** Emits each tag as it is removed. */\n readonly removed = output<string>();\n\n protected readonly draft = signal('');\n private readonly field = viewChild<ElementRef<HTMLInputElement>>('field');\n\n private onChange?: ChangeFn<string[]>;\n private onTouched?: TouchFn;\n private readonly disabledByForm = signal(false);\n protected readonly isDisabled = computed(() => this.disabled() || this.disabledByForm());\n\n protected readonly computedClass = computed(() => xui('block', this.class()));\n protected readonly containerClass = computed(() => xui(containerVariants({ fill: this.fill() })));\n\n protected onInput(event: Event): void {\n this.draft.set((event.target as HTMLInputElement).value);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Enter' || event.key === this.separator()) {\n event.preventDefault();\n this.commitDraft();\n return;\n }\n\n // Backspace on an empty field trims the last tag.\n if (event.key === 'Backspace' && this.draft() === '' && this.values().length) {\n event.preventDefault();\n this.removeAt(this.values().length - 1);\n }\n }\n\n protected onPaste(event: ClipboardEvent): void {\n if (!this.addOnPaste()) {\n return;\n }\n\n const text = event.clipboardData?.getData('text') ?? '';\n if (text.includes(this.separator())) {\n event.preventDefault();\n this.addTokens(text);\n this.draft.set('');\n }\n }\n\n protected onBlur(): void {\n if (this.addOnBlur()) {\n this.commitDraft();\n }\n\n this.onTouched?.();\n }\n\n protected focusInput(event: MouseEvent): void {\n // Clicking the container (but not a tag's button) focuses the field.\n if (this.isDisabled()) {\n return;\n }\n\n (event.currentTarget as HTMLElement).querySelector('input')?.focus();\n }\n\n private commitDraft(): void {\n this.addTokens(this.draft());\n this.draft.set('');\n // Clear the native field directly too: if the draft round-tripped within a\n // single change-detection pass, the `[value]` binding may not diff as changed.\n const el = this.field()?.nativeElement;\n if (el) {\n el.value = '';\n }\n }\n\n private addTokens(raw: string): void {\n const tokens = raw\n .split(this.separator())\n .map(t => t.trim())\n .filter(Boolean);\n if (!tokens.length) {\n return;\n }\n\n const next = [...this.values()];\n for (const token of tokens) {\n if (!this.allowDuplicates() && next.includes(token)) {\n continue;\n }\n\n next.push(token);\n this.added.emit(token);\n }\n\n if (next.length !== this.values().length) {\n this.commit(next);\n }\n }\n\n protected removeAt(index: number): void {\n if (this.isDisabled()) {\n return;\n }\n\n const tag = this.values()[index];\n const next = this.values().filter((_, i) => i !== index);\n this.commit(next);\n this.removed.emit(tag);\n }\n\n private commit(next: string[]): void {\n this.values.set(next);\n this.onChange?.(next);\n }\n\n // --- ControlValueAccessor ---\n writeValue(value: string[]): void {\n this.values.set(value ?? []);\n }\n\n registerOnChange(fn: ChangeFn<string[]>): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: TouchFn): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabledByForm.set(isDisabled);\n }\n}\n","import { XuiTagInput } from './lib/tag-input';\n\nexport * from './lib/tag-input';\n\nexport const XuiTagInputImports = [XuiTagInput] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAwBA,MAAM,iBAAiB,GAAG,GAAG,CAC3B;IACE,2JAA2J;IAC3J,6CAA6C;IAC7C;CACD,EACD;AACE,IAAA,QAAQ,EAAE;QACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU;AAC1C,KAAA;AACD,IAAA,eAAe,EAAE,EAAE,IAAI,EAAE,KAAK;AAC/B,CAAA,CACF;AAIM,MAAM,4BAA4B,GAAG;AAC1C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,WAAW,CAAC;AAC1C,IAAA,KAAK,EAAE;;AAGT;;;;AAIG;MAgDU,WAAW,CAAA;IACb,KAAK,GAAG,KAAK,CAAa,EAAE;8EAAC;;IAG7B,MAAM,GAAG,KAAK,CAAW,EAAE;+EAAC;IAE5B,WAAW,GAAG,KAAK,CAAS,EAAE;oFAAC;IAC/B,IAAI,GAAG,KAAK,CAAwB,KAAK,4EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;IAC3E,QAAQ,GAAG,KAAK,CAAwB,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAG/E,SAAS,GAAG,KAAK,CAAS,GAAG;kFAAC;;IAG9B,SAAS,GAAG,KAAK,CAAwB,KAAK,iFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAGhF,UAAU,GAAG,KAAK,CAAwB,IAAI,kFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAGhF,eAAe,GAAG,KAAK,CAAwB,KAAK,uFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAGtF,KAAK,GAAG,MAAM,EAAU;;IAExB,OAAO,GAAG,MAAM,EAAU;IAEhB,KAAK,GA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AA,EAAA,IAAA,EAAE,OAAO,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,OAAA,EAAA,OAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EA2CV,CAAC,YAAY,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAErC,WAAW,EAAA,UAAA,EAAA,CAAA;kBA/CvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;AAC1B,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCT,EAAA,CAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,iBAAiB;AAC5B,wBAAA,sBAAsB,EAAE;AACzB,qBAAA;oBACD,SAAS,EAAE,CAAC,4BAA4B,CAAC;oBACzC,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,aAAa,EAAE,CAAC,YAAY,CAAC,EAAE,aAAa,EAAE,CAAC;AAChD,iBAAA;4jCA6BkE,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC1HnE,MAAM,kBAAkB,GAAG,CAAC,WAAW;;ACJ9C;;AAEG;;;;"}
1
+ {"version":3,"file":"xui-tag-input.mjs","sources":["../../../../../../libs/ui/tag-input/xui/src/lib/tag-input.ts","../../../../../../libs/ui/tag-input/xui/src/index.ts","../../../../../../libs/ui/tag-input/xui/src/xui-tag-input.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n input,\n model,\n output,\n signal,\n viewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { matCloseRound } from '@ng-icons/material-icons/round';\nimport { xui } from '@xui/core';\nimport { createXValueAccessor, provideXValueAccessor } from '@xui/core/forms';\nimport { XuiIcon } from '@xui/icon';\nimport { cva, VariantProps } from 'class-variance-authority';\nimport type { ClassValue } from 'clsx';\n\nexport const tagInputContainerVariants = cva(\n [\n 'flex min-h-(--control-height-md) flex-wrap items-center gap-1.5 rounded-lg border border-border bg-surface-inset px-(--control-padding-sm) py-0.5 text-sm',\n 'focus-within:border-focus transition-colors',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50'\n ],\n {\n variants: {\n fill: { true: 'w-full', false: 'min-w-72' }\n },\n defaultVariants: { fill: false }\n }\n);\n\nexport type XuiTagInputVariants = VariantProps<typeof tagInputContainerVariants>;\n\n/**\n * A token/chip input: type and press Enter (or the separator) to add a tag, click\n * a tag's ✕ or press Backspace on an empty field to remove one. `[(values)]`\n * two-way binding and `ControlValueAccessor` over a `string[]`.\n */\n@Component({\n selector: 'xui-tag-input',\n imports: [NgIcon, XuiIcon],\n template: `\n <!-- Clicking empty container space focuses the real input, which is itself\n focusable and keyboard-operable, so no separate key handler is needed. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div [class]=\"containerClass()\" (click)=\"focusInput($event)\">\n @for (tag of values(); track $index) {\n <span class=\"bg-surface-raised text-foreground inline-flex items-center gap-1 rounded px-2 py-0.5\">\n {{ tag }}\n @if (!isDisabled()) {\n <button\n type=\"button\"\n class=\"text-foreground-muted hover:text-foreground -me-0.5 flex items-center\"\n [attr.aria-label]=\"'Remove ' + tag\"\n (click)=\"removeAt($index); $event.stopPropagation()\"\n >\n <ng-icon xui size=\"xs\" name=\"matCloseRound\" />\n </button>\n }\n </span>\n }\n\n <input\n #field\n type=\"text\"\n class=\"text-foreground placeholder:text-foreground-subtle min-w-24 flex-1 bg-transparent outline-none\"\n [value]=\"draft()\"\n [placeholder]=\"values().length ? '' : placeholder()\"\n [disabled]=\"isDisabled()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onKeydown($event)\"\n (paste)=\"onPaste($event)\"\n (blur)=\"onBlur()\"\n />\n </div>\n `,\n host: {\n '[class]': 'computedClass()',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : null'\n },\n providers: [provideXValueAccessor(() => XuiTagInput)],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n viewProviders: [provideIcons({ matCloseRound })]\n})\nexport class XuiTagInput implements ControlValueAccessor {\n readonly class = input<ClassValue>('');\n\n /** The current tags. Two-way bindable with `[(values)]`. */\n readonly values = model<string[]>([]);\n\n readonly placeholder = input<string>('');\n readonly fill = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Character that also commits the current draft (besides Enter). */\n readonly separator = input<string>(',');\n\n /** Commit the draft when the field loses focus. */\n readonly addOnBlur = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Split pasted text on the separator and add each piece. */\n readonly addOnPaste = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /** Reject a tag that already exists. */\n readonly allowDuplicates = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Emits each tag as it is added. */\n readonly added = output<string>();\n /** Emits each tag as it is removed. */\n readonly removed = output<string>();\n\n protected readonly draft = signal('');\n private readonly field = viewChild<ElementRef<HTMLInputElement>>('field');\n\n protected readonly cva = createXValueAccessor<string[]>({\n onWrite: value => this.values.set(value ?? []),\n disabled: this.disabled\n });\n protected readonly isDisabled = this.cva.disabled;\n\n protected readonly computedClass = computed(() => xui('block', this.class()));\n protected readonly containerClass = computed(() => xui(tagInputContainerVariants({ fill: this.fill() })));\n\n protected onInput(event: Event): void {\n this.draft.set((event.target as HTMLInputElement).value);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Enter' || event.key === this.separator()) {\n event.preventDefault();\n this.commitDraft();\n return;\n }\n\n // Backspace on an empty field trims the last tag.\n if (event.key === 'Backspace' && this.draft() === '' && this.values().length) {\n event.preventDefault();\n this.removeAt(this.values().length - 1);\n }\n }\n\n protected onPaste(event: ClipboardEvent): void {\n if (!this.addOnPaste()) {\n return;\n }\n\n const text = event.clipboardData?.getData('text') ?? '';\n if (text.includes(this.separator())) {\n event.preventDefault();\n this.addTokens(text);\n this.draft.set('');\n }\n }\n\n protected onBlur(): void {\n if (this.addOnBlur()) {\n this.commitDraft();\n }\n\n this.cva.markTouched();\n }\n\n protected focusInput(event: MouseEvent): void {\n // Clicking the container (but not a tag's button) focuses the field.\n if (this.isDisabled()) {\n return;\n }\n\n (event.currentTarget as HTMLElement).querySelector('input')?.focus();\n }\n\n private commitDraft(): void {\n this.addTokens(this.draft());\n this.draft.set('');\n // Clear the native field directly too: if the draft round-tripped within a\n // single change-detection pass, the `[value]` binding may not diff as changed.\n const el = this.field()?.nativeElement;\n if (el) {\n el.value = '';\n }\n }\n\n private addTokens(raw: string): void {\n const tokens = raw\n .split(this.separator())\n .map(t => t.trim())\n .filter(Boolean);\n if (!tokens.length) {\n return;\n }\n\n const next = [...this.values()];\n for (const token of tokens) {\n if (!this.allowDuplicates() && next.includes(token)) {\n continue;\n }\n\n next.push(token);\n this.added.emit(token);\n }\n\n if (next.length !== this.values().length) {\n this.commit(next);\n }\n }\n\n protected removeAt(index: number): void {\n if (this.isDisabled()) {\n return;\n }\n\n const tag = this.values()[index];\n const next = this.values().filter((_, i) => i !== index);\n this.commit(next);\n this.removed.emit(tag);\n }\n\n private commit(next: string[]): void {\n this.values.set(next);\n this.cva.notifyChange(next);\n }\n\n // --- ControlValueAccessor ---\n readonly writeValue = this.cva.writeValue;\n readonly registerOnChange = this.cva.registerOnChange;\n readonly registerOnTouched = this.cva.registerOnTouched;\n readonly setDisabledState = this.cva.setDisabledState;\n}\n","import { XuiTagInput } from './lib/tag-input';\n\nexport * from './lib/tag-input';\n\nexport const XuiTagInputImports = [XuiTagInput] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAuBO,MAAM,yBAAyB,GAAG,GAAG,CAC1C;IACE,2JAA2J;IAC3J,6CAA6C;IAC7C;CACD,EACD;AACE,IAAA,QAAQ,EAAE;QACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU;AAC1C,KAAA;AACD,IAAA,eAAe,EAAE,EAAE,IAAI,EAAE,KAAK;AAC/B,CAAA;AAKH;;;;AAIG;MAgDU,WAAW,CAAA;IACb,KAAK,GAAG,KAAK,CAAa,EAAE;8EAAC;;IAG7B,MAAM,GAAG,KAAK,CAAW,EAAE;+EAAC;IAE5B,WAAW,GAAG,KAAK,CAAS,EAAE;oFAAC;IAC/B,IAAI,GAAG,KAAK,CAAwB,KAAK,4EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;IAC3E,QAAQ,GAAG,KAAK,CAAwB,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAG/E,SAAS,GAAG,KAAK,CAAS,GAAG;kFAAC;;IAG9B,SAAS,GAAG,KAAK,CAAwB,KAAK,iFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAGhF,UAAU,GAAG,KAAK,CAAwB,IAAI,kFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAGhF,eAAe,GAAG,KAAK,CAAwB,KAAK,uFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAGtF,KAAK,GAAG,MAAM,EAAU;;IAExB,OAAO,GAAG,MAAM,EAAU;IAEhB,KAAK,GAAG,MAAM,CAAC,EAAE;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,YAAY,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAErC,WAAW,EAAA,UAAA,EAAA,CAAA;kBA/CvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;AAC1B,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCT,EAAA,CAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,iBAAiB;AAC5B,wBAAA,sBAAsB,EAAE;AACzB,qBAAA;oBACD,SAAS,EAAE,CAAC,qBAAqB,EAAC,MAAK,WAAY,EAAC,CAAC;oBACrD,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,aAAa,EAAE,CAAC,YAAY,CAAC,EAAE,aAAa,EAAE,CAAC;AAChD,iBAAA;4jCA6BkE,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACnHnE,MAAM,kBAAkB,GAAG,CAAC,WAAW;;ACJ9C;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xui/tag-input",
3
- "version": "2.0.0-alpha.11",
3
+ "version": "2.0.0-alpha.13",
4
4
  "description": "Modern Angular 22 UI Library based on TailwindCSS",
5
5
  "keywords": [
6
6
  "angular",
@@ -41,8 +41,8 @@
41
41
  "@angular/forms": "22",
42
42
  "@ng-icons/core": "34",
43
43
  "@ng-icons/material-icons": "34",
44
- "@xui/core": "2.0.0-alpha.11",
45
- "@xui/icon": "2.0.0-alpha.11",
44
+ "@xui/core": "2.0.0-alpha.13",
45
+ "@xui/icon": "2.0.0-alpha.13",
46
46
  "class-variance-authority": "^0.7.1",
47
47
  "clsx": "^2.1.1"
48
48
  },
@@ -1,20 +1,15 @@
1
+ import * as _xui_core_forms from '@xui/core/forms';
1
2
  import * as _angular_core from '@angular/core';
2
3
  import * as class_variance_authority_types from 'class-variance-authority/types';
3
4
  import { BooleanInput } from '@angular/cdk/coercion';
4
5
  import { ControlValueAccessor } from '@angular/forms';
5
- import { ChangeFn, TouchFn } from '@xui/core/forms';
6
6
  import { VariantProps } from 'class-variance-authority';
7
7
  import { ClassValue } from 'clsx';
8
8
 
9
- declare const containerVariants: (props?: ({
9
+ declare const tagInputContainerVariants: (props?: ({
10
10
  fill?: boolean | null | undefined;
11
11
  } & class_variance_authority_types.ClassProp) | undefined) => string;
12
- type TagInputVariants = VariantProps<typeof containerVariants>;
13
- declare const XUI_TAG_INPUT_VALUE_ACCESSOR: {
14
- provide: _angular_core.InjectionToken<readonly ControlValueAccessor[]>;
15
- useExisting: _angular_core.Type<any>;
16
- multi: boolean;
17
- };
12
+ type XuiTagInputVariants = VariantProps<typeof tagInputContainerVariants>;
18
13
  /**
19
14
  * A token/chip input: type and press Enter (or the separator) to add a tag, click
20
15
  * a tag's ✕ or press Backspace on an empty field to remove one. `[(values)]`
@@ -41,9 +36,7 @@ declare class XuiTagInput implements ControlValueAccessor {
41
36
  readonly removed: _angular_core.OutputEmitterRef<string>;
42
37
  protected readonly draft: _angular_core.WritableSignal<string>;
43
38
  private readonly field;
44
- private onChange?;
45
- private onTouched?;
46
- private readonly disabledByForm;
39
+ protected readonly cva: _xui_core_forms.XValueAccessor<string[]>;
47
40
  protected readonly isDisabled: _angular_core.Signal<boolean>;
48
41
  protected readonly computedClass: _angular_core.Signal<string>;
49
42
  protected readonly containerClass: _angular_core.Signal<string>;
@@ -56,15 +49,15 @@ declare class XuiTagInput implements ControlValueAccessor {
56
49
  private addTokens;
57
50
  protected removeAt(index: number): void;
58
51
  private commit;
59
- writeValue(value: string[]): void;
60
- registerOnChange(fn: ChangeFn<string[]>): void;
61
- registerOnTouched(fn: TouchFn): void;
62
- setDisabledState(isDisabled: boolean): void;
52
+ readonly writeValue: (value: string[]) => void;
53
+ readonly registerOnChange: (fn: _xui_core_forms.XChangeFn<string[]>) => void;
54
+ readonly registerOnTouched: (fn: _xui_core_forms.XTouchFn) => void;
55
+ readonly setDisabledState: (isDisabled: boolean) => void;
63
56
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<XuiTagInput, never>;
64
57
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<XuiTagInput, "xui-tag-input", never, { "class": { "alias": "class"; "required": false; "isSignal": true; }; "values": { "alias": "values"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "fill": { "alias": "fill"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "separator": { "alias": "separator"; "required": false; "isSignal": true; }; "addOnBlur": { "alias": "addOnBlur"; "required": false; "isSignal": true; }; "addOnPaste": { "alias": "addOnPaste"; "required": false; "isSignal": true; }; "allowDuplicates": { "alias": "allowDuplicates"; "required": false; "isSignal": true; }; }, { "values": "valuesChange"; "added": "added"; "removed": "removed"; }, never, never, true, never>;
65
58
  }
66
59
 
67
60
  declare const XuiTagInputImports: readonly [typeof XuiTagInput];
68
61
 
69
- export { XUI_TAG_INPUT_VALUE_ACCESSOR, XuiTagInput, XuiTagInputImports };
70
- export type { TagInputVariants };
62
+ export { XuiTagInput, XuiTagInputImports, tagInputContainerVariants };
63
+ export type { XuiTagInputVariants };