@xui/spinner 2.0.0-alpha.11

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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Rikarin
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,217 @@
1
+ <p style="font-size: 5rem; font-weight: 700; text-align: center">
2
+ <span style="color: #1f75cb">x</span>UI
3
+ </p>
4
+
5
+ ---
6
+
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)
12
+
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.
14
+
15
+ ## Features
16
+
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**
59
+
60
+ ```bash
61
+ pnpm i @xui/core ....
62
+ ```
63
+
64
+ ## Theming
65
+
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:
69
+
70
+ ```css
71
+ @import 'tailwindcss';
72
+ @import '@xui/core/styles/theme.css';
73
+
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. */
76
+ @import '@angular/cdk/overlay-prebuilt.css';
77
+
78
+ /* Tell Tailwind to scan the component sources for utility classes. */
79
+ @source '../node_modules/@xui';
80
+ ```
81
+
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.
85
+
86
+ Re-theme by overriding tokens after the import — the `darker` / `lighter` / `subtle` / `muted` /
87
+ `emphasis` steps of each intent are derived, so one declaration re-colours the whole ramp:
88
+
89
+ ```css
90
+ :root {
91
+ --primary: var(--color-violet-600);
92
+ --surface-inset: var(--color-zinc-50);
93
+ }
94
+ ```
95
+
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).
98
+
99
+ ## Browser Support
100
+
101
+ xUI Supports most recent browsers according to Angular [support](https://angular.io/guide/browser-support).
102
+
103
+ ## Development
104
+
105
+ The project uses `NX` and `Angular` to build the package.
106
+
107
+ To start docs page use
108
+
109
+ ```bash
110
+ pnpm start
111
+ ```
112
+
113
+ To start storybook use
114
+
115
+ ```bash
116
+ pnpm storybook
117
+ ```
118
+
119
+ ## AI coding agents
120
+
121
+ Two pieces of tooling teach coding agents how to build with xUI.
122
+
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.
127
+
128
+ ```json
129
+ {
130
+ "mcpServers": {
131
+ "xui": { "command": "npx", "args": ["-y", "@xui/mcp"] }
132
+ }
133
+ }
134
+ ```
135
+
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.
138
+
139
+ **Skill** — [`skills/xui`](https://github.com/Rikarin/xui/blob/HEAD/skills/xui/SKILL.md) is the procedural knowledge: the three-layer
140
+ architecture, discovery through the MCP server, composition and styling rules, theming, the
141
+ generators, and the conventions for authoring a package inside the monorepo. `.claude/skills/xui`
142
+ links to it for agents working in this repository.
143
+
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
@@ -0,0 +1,171 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, inject, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { xui } from '@xui/core';
4
+ import { cva } from 'class-variance-authority';
5
+
6
+ const defaultConfig = {
7
+ color: 'primary',
8
+ size: 'md'
9
+ };
10
+ const XuiSpinnerConfigToken = new InjectionToken('XuiSpinnerConfig');
11
+ function provideXuiSpinnerConfig(config) {
12
+ return { provide: XuiSpinnerConfigToken, useValue: { ...defaultConfig, ...config } };
13
+ }
14
+ function injectXuiSpinnerConfig() {
15
+ return inject(XuiSpinnerConfigToken, { optional: true }) ?? defaultConfig;
16
+ }
17
+
18
+ const spinnerVariants = cva('inline-block shrink-0', {
19
+ variants: {
20
+ size: {
21
+ xs: 'h-4 w-4',
22
+ sm: 'h-6 w-6',
23
+ md: 'h-8 w-8',
24
+ lg: 'h-12 w-12',
25
+ xl: 'h-16 w-16'
26
+ },
27
+ color: {
28
+ primary: 'text-primary',
29
+ secondary: 'text-secondary',
30
+ success: 'text-success',
31
+ error: 'text-error',
32
+ warning: 'text-warning',
33
+ info: 'text-info',
34
+ /** Follows the surrounding text — for a spinner inside a button. */
35
+ inherit: 'text-inherit'
36
+ }
37
+ },
38
+ defaultVariants: {
39
+ size: 'md',
40
+ color: 'primary'
41
+ }
42
+ });
43
+ /** Geometry of the SVG below. The stroke is centred on the radius. */
44
+ const VIEWBOX = 100;
45
+ const STROKE_WIDTH = 12;
46
+ const RADIUS = (VIEWBOX - STROKE_WIDTH) / 2;
47
+ const CIRCUMFERENCE = 2 * Math.PI * RADIUS;
48
+ const CENTER = VIEWBOX / 2;
49
+ /**
50
+ * A circular progress indicator.
51
+ *
52
+ * ```html
53
+ * <xui-spinner>Loading users</xui-spinner>
54
+ * <xui-spinner [value]="0.7" color="success" />
55
+ * ```
56
+ *
57
+ * Without `value` it spins indefinitely; with one it draws the matching arc.
58
+ * Content is projected into a visually hidden label, which is what a screen
59
+ * reader announces — a spinner with no label is just an unexplained "busy".
60
+ */
61
+ class XuiSpinner {
62
+ config = injectXuiSpinnerConfig();
63
+ center = CENTER;
64
+ radius = RADIUS;
65
+ strokeWidth = STROKE_WIDTH;
66
+ circumference = CIRCUMFERENCE;
67
+ /** The user-defined classes. Merged last so they win over the variant classes. */
68
+ class = input('', /* @ts-ignore */
69
+ ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
70
+ color = input(this.config.color, /* @ts-ignore */
71
+ ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
72
+ size = input(this.config.size, /* @ts-ignore */
73
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
74
+ /**
75
+ * How far along the operation is, between 0 and 1. Out-of-range values are
76
+ * clamped. Leave it unset to spin indefinitely.
77
+ */
78
+ value = input(undefined, /* @ts-ignore */
79
+ ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
80
+ indeterminate = computed(() => this.value() == null, /* @ts-ignore */
81
+ ...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
82
+ /** The clamped value as a whole percentage, or `null` while indeterminate. */
83
+ percent = computed(() => {
84
+ const value = this.value();
85
+ return value == null ? null : Math.round(100 * Math.min(Math.max(value, 0), 1));
86
+ }, /* @ts-ignore */
87
+ ...(ngDevMode ? [{ debugName: "percent" }] : /* istanbul ignore next */ []));
88
+ dashOffset = computed(() => {
89
+ const percent = this.percent();
90
+ // An indeterminate spinner shows a fixed quarter-circle head, which the
91
+ // rotation animation carries around the track.
92
+ return percent == null ? CIRCUMFERENCE * 0.75 : CIRCUMFERENCE * (1 - percent / 100);
93
+ }, /* @ts-ignore */
94
+ ...(ngDevMode ? [{ debugName: "dashOffset" }] : /* istanbul ignore next */ []));
95
+ computedClass = computed(() => xui(spinnerVariants({ color: this.color(), size: this.size() }), this.class()), /* @ts-ignore */
96
+ ...(ngDevMode ? [{ debugName: "computedClass" }] : /* istanbul ignore next */ []));
97
+ /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: XuiSpinner, deps: [], target: i0.ɵɵFactoryTarget.Component });
98
+ /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.8", type: XuiSpinner, isStandalone: true, selector: "xui-spinner", inputs: { class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "status" }, properties: { "attr.aria-valuemin": "indeterminate() ? null : 0", "attr.aria-valuemax": "indeterminate() ? null : 100", "attr.aria-valuenow": "percent()", "class": "computedClass()" } }, ngImport: i0, template: `
99
+ <svg aria-hidden="true" class="size-full" [class.animate-spin]="indeterminate()" viewBox="0 0 100 100" fill="none">
100
+ <circle
101
+ class="opacity-20"
102
+ [attr.cx]="center"
103
+ [attr.cy]="center"
104
+ [attr.r]="radius"
105
+ stroke="currentColor"
106
+ [attr.stroke-width]="strokeWidth"
107
+ />
108
+ <circle
109
+ class="ease-standard transition-[stroke-dashoffset] duration-300"
110
+ [attr.cx]="center"
111
+ [attr.cy]="center"
112
+ [attr.r]="radius"
113
+ stroke="currentColor"
114
+ [attr.stroke-width]="strokeWidth"
115
+ stroke-linecap="round"
116
+ [attr.stroke-dasharray]="circumference"
117
+ [attr.stroke-dashoffset]="dashOffset()"
118
+ [attr.transform]="'rotate(-90 ' + center + ' ' + center + ')'"
119
+ />
120
+ </svg>
121
+ <span class="sr-only"><ng-content /></span>
122
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
123
+ }
124
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: XuiSpinner, decorators: [{
125
+ type: Component,
126
+ args: [{
127
+ selector: 'xui-spinner',
128
+ changeDetection: ChangeDetectionStrategy.OnPush,
129
+ template: `
130
+ <svg aria-hidden="true" class="size-full" [class.animate-spin]="indeterminate()" viewBox="0 0 100 100" fill="none">
131
+ <circle
132
+ class="opacity-20"
133
+ [attr.cx]="center"
134
+ [attr.cy]="center"
135
+ [attr.r]="radius"
136
+ stroke="currentColor"
137
+ [attr.stroke-width]="strokeWidth"
138
+ />
139
+ <circle
140
+ class="ease-standard transition-[stroke-dashoffset] duration-300"
141
+ [attr.cx]="center"
142
+ [attr.cy]="center"
143
+ [attr.r]="radius"
144
+ stroke="currentColor"
145
+ [attr.stroke-width]="strokeWidth"
146
+ stroke-linecap="round"
147
+ [attr.stroke-dasharray]="circumference"
148
+ [attr.stroke-dashoffset]="dashOffset()"
149
+ [attr.transform]="'rotate(-90 ' + center + ' ' + center + ')'"
150
+ />
151
+ </svg>
152
+ <span class="sr-only"><ng-content /></span>
153
+ `,
154
+ host: {
155
+ role: 'status',
156
+ '[attr.aria-valuemin]': 'indeterminate() ? null : 0',
157
+ '[attr.aria-valuemax]': 'indeterminate() ? null : 100',
158
+ '[attr.aria-valuenow]': 'percent()',
159
+ '[class]': 'computedClass()'
160
+ }
161
+ }]
162
+ }], propDecorators: { class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }] } });
163
+
164
+ const XuiSpinnerImports = [XuiSpinner];
165
+
166
+ /**
167
+ * Generated bundle index. Do not edit.
168
+ */
169
+
170
+ export { XuiSpinner, XuiSpinnerImports, injectXuiSpinnerConfig, provideXuiSpinnerConfig, spinnerVariants };
171
+ //# sourceMappingURL=xui-spinner.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xui-spinner.mjs","sources":["../../../../../../libs/ui/spinner/xui/src/lib/spinner.token.ts","../../../../../../libs/ui/spinner/xui/src/lib/spinner.ts","../../../../../../libs/ui/spinner/xui/src/index.ts","../../../../../../libs/ui/spinner/xui/src/xui-spinner.ts"],"sourcesContent":["import { InjectionToken, ValueProvider, inject } from '@angular/core';\nimport type { SpinnerVariants } from './spinner';\n\n/**\n * Application-wide defaults for XuiSpinner.\n *\n * Provide it once at the app root to re-skin every spinner without touching\n * call sites; individual inputs still override the configured value.\n */\nexport interface XuiSpinnerConfig {\n color: SpinnerVariants['color'];\n size: SpinnerVariants['size'];\n}\n\nconst defaultConfig: XuiSpinnerConfig = {\n color: 'primary',\n size: 'md'\n};\n\nconst XuiSpinnerConfigToken = new InjectionToken<XuiSpinnerConfig>('XuiSpinnerConfig');\n\nexport function provideXuiSpinnerConfig(config: Partial<XuiSpinnerConfig>): ValueProvider {\n return { provide: XuiSpinnerConfigToken, useValue: { ...defaultConfig, ...config } };\n}\n\nexport function injectXuiSpinnerConfig(): XuiSpinnerConfig {\n return inject(XuiSpinnerConfigToken, { optional: true }) ?? defaultConfig;\n}\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { xui } from '@xui/core';\nimport { cva, VariantProps } from 'class-variance-authority';\nimport type { ClassValue } from 'clsx';\nimport { injectXuiSpinnerConfig } from './spinner.token';\n\nexport const spinnerVariants = cva('inline-block shrink-0', {\n variants: {\n size: {\n xs: 'h-4 w-4',\n sm: 'h-6 w-6',\n md: 'h-8 w-8',\n lg: 'h-12 w-12',\n xl: 'h-16 w-16'\n },\n color: {\n primary: 'text-primary',\n secondary: 'text-secondary',\n success: 'text-success',\n error: 'text-error',\n warning: 'text-warning',\n info: 'text-info',\n /** Follows the surrounding text — for a spinner inside a button. */\n inherit: 'text-inherit'\n }\n },\n defaultVariants: {\n size: 'md',\n color: 'primary'\n }\n});\n\nexport type SpinnerVariants = VariantProps<typeof spinnerVariants>;\n\n/** Geometry of the SVG below. The stroke is centred on the radius. */\nconst VIEWBOX = 100;\nconst STROKE_WIDTH = 12;\nconst RADIUS = (VIEWBOX - STROKE_WIDTH) / 2;\nconst CIRCUMFERENCE = 2 * Math.PI * RADIUS;\nconst CENTER = VIEWBOX / 2;\n\n/**\n * A circular progress indicator.\n *\n * ```html\n * <xui-spinner>Loading users</xui-spinner>\n * <xui-spinner [value]=\"0.7\" color=\"success\" />\n * ```\n *\n * Without `value` it spins indefinitely; with one it draws the matching arc.\n * Content is projected into a visually hidden label, which is what a screen\n * reader announces — a spinner with no label is just an unexplained \"busy\".\n */\n@Component({\n selector: 'xui-spinner',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <svg aria-hidden=\"true\" class=\"size-full\" [class.animate-spin]=\"indeterminate()\" viewBox=\"0 0 100 100\" fill=\"none\">\n <circle\n class=\"opacity-20\"\n [attr.cx]=\"center\"\n [attr.cy]=\"center\"\n [attr.r]=\"radius\"\n stroke=\"currentColor\"\n [attr.stroke-width]=\"strokeWidth\"\n />\n <circle\n class=\"ease-standard transition-[stroke-dashoffset] duration-300\"\n [attr.cx]=\"center\"\n [attr.cy]=\"center\"\n [attr.r]=\"radius\"\n stroke=\"currentColor\"\n [attr.stroke-width]=\"strokeWidth\"\n stroke-linecap=\"round\"\n [attr.stroke-dasharray]=\"circumference\"\n [attr.stroke-dashoffset]=\"dashOffset()\"\n [attr.transform]=\"'rotate(-90 ' + center + ' ' + center + ')'\"\n />\n </svg>\n <span class=\"sr-only\"><ng-content /></span>\n `,\n host: {\n role: 'status',\n '[attr.aria-valuemin]': 'indeterminate() ? null : 0',\n '[attr.aria-valuemax]': 'indeterminate() ? null : 100',\n '[attr.aria-valuenow]': 'percent()',\n '[class]': 'computedClass()'\n }\n})\nexport class XuiSpinner {\n private readonly config = injectXuiSpinnerConfig();\n\n protected readonly center = CENTER;\n protected readonly radius = RADIUS;\n protected readonly strokeWidth = STROKE_WIDTH;\n protected readonly circumference = CIRCUMFERENCE;\n\n /** The user-defined classes. Merged last so they win over the variant classes. */\n readonly class = input<ClassValue>('');\n readonly color = input<SpinnerVariants['color']>(this.config.color);\n readonly size = input<SpinnerVariants['size']>(this.config.size);\n\n /**\n * How far along the operation is, between 0 and 1. Out-of-range values are\n * clamped. Leave it unset to spin indefinitely.\n */\n readonly value = input<number | null | undefined>(undefined);\n\n readonly indeterminate = computed(() => this.value() == null);\n\n /** The clamped value as a whole percentage, or `null` while indeterminate. */\n readonly percent = computed(() => {\n const value = this.value();\n\n return value == null ? null : Math.round(100 * Math.min(Math.max(value, 0), 1));\n });\n\n protected readonly dashOffset = computed(() => {\n const percent = this.percent();\n\n // An indeterminate spinner shows a fixed quarter-circle head, which the\n // rotation animation carries around the track.\n return percent == null ? CIRCUMFERENCE * 0.75 : CIRCUMFERENCE * (1 - percent / 100);\n });\n\n protected readonly computedClass = computed(() =>\n xui(spinnerVariants({ color: this.color(), size: this.size() }), this.class())\n );\n}\n","import { XuiSpinner } from './lib/spinner';\n\nexport * from './lib/spinner';\nexport * from './lib/spinner.token';\n\nexport const XuiSpinnerImports = [XuiSpinner] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAcA,MAAM,aAAa,GAAqB;AACtC,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,IAAI,EAAE;CAC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U,UAAU,EAAA,UAAA,EAAA,CAAA;kBApCtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;oBACvB,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;AAwBT,EAAA,CAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,IAAI,EAAE,QAAQ;AACd,wBAAA,sBAAsB,EAAE,4BAA4B;AACpD,wBAAA,sBAAsB,EAAE,8BAA8B;AACtD,wBAAA,sBAAsB,EAAE,WAAW;AACnC,wBAAA,SAAS,EAAE;AACZ;AACF,iBAAA;;;ACnFM,MAAM,iBAAiB,GAAG,CAAC,UAAU;;ACL5C;;AAEG;;;;"}
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@xui/spinner",
3
+ "version": "2.0.0-alpha.11",
4
+ "description": "Modern Angular 22 UI Library based on TailwindCSS",
5
+ "keywords": [
6
+ "angular",
7
+ "ui",
8
+ "components",
9
+ "tailwindcss"
10
+ ],
11
+ "homepage": "https://xuijs.org",
12
+ "bugs": {
13
+ "url": "https://github.com/rikarin/xui/issues"
14
+ },
15
+ "repository": "https://github.com/Rikarin/xui",
16
+ "license": "MIT",
17
+ "author": "Jiu",
18
+ "maintainers": [
19
+ "Jiu",
20
+ "Rikarin"
21
+ ],
22
+ "sideEffects": false,
23
+ "type": "module",
24
+ "exports": {
25
+ "./package.json": {
26
+ "default": "./package.json"
27
+ },
28
+ ".": {
29
+ "types": "./types/xui-spinner.d.ts",
30
+ "default": "./fesm2022/xui-spinner.mjs"
31
+ }
32
+ },
33
+ "module": "fesm2022/xui-spinner.mjs",
34
+ "typings": "types/xui-spinner.d.ts",
35
+ "dependencies": {
36
+ "tslib": "^2.3.0"
37
+ },
38
+ "peerDependencies": {
39
+ "@angular/core": "22",
40
+ "@xui/core": "2.0.0-alpha.11",
41
+ "class-variance-authority": "^0.7.1",
42
+ "clsx": "^2.1.1"
43
+ },
44
+ "publishConfig": {
45
+ "access": "public"
46
+ }
47
+ }
@@ -0,0 +1,64 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { ValueProvider } from '@angular/core';
3
+ import * as class_variance_authority_types from 'class-variance-authority/types';
4
+ import { VariantProps } from 'class-variance-authority';
5
+ import { ClassValue } from 'clsx';
6
+
7
+ declare const spinnerVariants: (props?: ({
8
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
9
+ color?: "primary" | "secondary" | "success" | "error" | "warning" | "info" | "inherit" | null | undefined;
10
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
11
+ type SpinnerVariants = VariantProps<typeof spinnerVariants>;
12
+ /**
13
+ * A circular progress indicator.
14
+ *
15
+ * ```html
16
+ * <xui-spinner>Loading users</xui-spinner>
17
+ * <xui-spinner [value]="0.7" color="success" />
18
+ * ```
19
+ *
20
+ * Without `value` it spins indefinitely; with one it draws the matching arc.
21
+ * Content is projected into a visually hidden label, which is what a screen
22
+ * reader announces — a spinner with no label is just an unexplained "busy".
23
+ */
24
+ declare class XuiSpinner {
25
+ private readonly config;
26
+ protected readonly center: number;
27
+ protected readonly radius: number;
28
+ protected readonly strokeWidth = 12;
29
+ protected readonly circumference: number;
30
+ /** The user-defined classes. Merged last so they win over the variant classes. */
31
+ readonly class: _angular_core.InputSignal<ClassValue>;
32
+ readonly color: _angular_core.InputSignal<"primary" | "secondary" | "success" | "error" | "warning" | "info" | "inherit" | null | undefined>;
33
+ readonly size: _angular_core.InputSignal<"xs" | "sm" | "md" | "lg" | "xl" | null | undefined>;
34
+ /**
35
+ * How far along the operation is, between 0 and 1. Out-of-range values are
36
+ * clamped. Leave it unset to spin indefinitely.
37
+ */
38
+ readonly value: _angular_core.InputSignal<number | null | undefined>;
39
+ readonly indeterminate: _angular_core.Signal<boolean>;
40
+ /** The clamped value as a whole percentage, or `null` while indeterminate. */
41
+ readonly percent: _angular_core.Signal<number | null>;
42
+ protected readonly dashOffset: _angular_core.Signal<number>;
43
+ protected readonly computedClass: _angular_core.Signal<string>;
44
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<XuiSpinner, never>;
45
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<XuiSpinner, "xui-spinner", never, { "class": { "alias": "class"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
46
+ }
47
+
48
+ /**
49
+ * Application-wide defaults for XuiSpinner.
50
+ *
51
+ * Provide it once at the app root to re-skin every spinner without touching
52
+ * call sites; individual inputs still override the configured value.
53
+ */
54
+ interface XuiSpinnerConfig {
55
+ color: SpinnerVariants['color'];
56
+ size: SpinnerVariants['size'];
57
+ }
58
+ declare function provideXuiSpinnerConfig(config: Partial<XuiSpinnerConfig>): ValueProvider;
59
+ declare function injectXuiSpinnerConfig(): XuiSpinnerConfig;
60
+
61
+ declare const XuiSpinnerImports: readonly [typeof XuiSpinner];
62
+
63
+ export { XuiSpinner, XuiSpinnerImports, injectXuiSpinnerConfig, provideXuiSpinnerConfig, spinnerVariants };
64
+ export type { SpinnerVariants, XuiSpinnerConfig };