@ngstarter-ui/components 22.1.3 → 22.1.4
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 +133 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,9 @@ secondary entry points such as `@ngstarter-ui/components/button`,
|
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
|
+
The current package targets Angular 22 and Angular CDK 22. Use SCSS for the application's
|
|
14
|
+
global styles.
|
|
15
|
+
|
|
13
16
|
For a new Angular 22 project, create the app with SCSS and add NgStarter UI:
|
|
14
17
|
|
|
15
18
|
```bash
|
|
@@ -24,8 +27,14 @@ For an existing Angular 22 app, run the same schematic from your project root:
|
|
|
24
27
|
npx ng add @ngstarter-ui/components
|
|
25
28
|
```
|
|
26
29
|
|
|
27
|
-
The `ng add` schematic
|
|
28
|
-
|
|
30
|
+
The `ng add` schematic installs the required dependencies, configures Tailwind CSS 4 and
|
|
31
|
+
PostCSS, imports the Default theme, adds `provideNgsTheme` to the application config, and
|
|
32
|
+
adds the DM Sans font to the application HTML. In a workspace with multiple applications,
|
|
33
|
+
select the target with `--project=your-app`.
|
|
34
|
+
|
|
35
|
+
The schematic also adds NgStarter guidance to `AGENTS.md` and installs a local Codex skill at
|
|
36
|
+
`.codex/skills/ngstarter-ui` by default. To skip the local skill installation while keeping
|
|
37
|
+
the `AGENTS.md` guidance, run:
|
|
29
38
|
|
|
30
39
|
```bash
|
|
31
40
|
npx ng add @ngstarter-ui/components --codex-skill=false
|
|
@@ -37,24 +46,46 @@ If NgStarter UI is already installed and you only want to add or refresh the Cod
|
|
|
37
46
|
npx ng generate @ngstarter-ui/components:codex-skill
|
|
38
47
|
```
|
|
39
48
|
|
|
49
|
+
### Basic Usage
|
|
50
|
+
|
|
40
51
|
NgStarter components are standalone Angular components. Import each component from its
|
|
41
|
-
secondary entry point
|
|
52
|
+
public secondary entry point and include it in the component's `imports`:
|
|
42
53
|
|
|
43
54
|
```ts
|
|
55
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
44
56
|
import { Button } from '@ngstarter-ui/components/button';
|
|
45
|
-
|
|
46
|
-
|
|
57
|
+
|
|
58
|
+
@Component({
|
|
59
|
+
selector: 'app-example',
|
|
60
|
+
standalone: true,
|
|
61
|
+
imports: [Button],
|
|
62
|
+
template: `<button ngsButton="filled">Save</button>`,
|
|
63
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
64
|
+
})
|
|
65
|
+
export class Example {}
|
|
47
66
|
```
|
|
48
67
|
|
|
68
|
+
Other entry points follow the same pattern, such as `@ngstarter-ui/components/dialog`,
|
|
69
|
+
`@ngstarter-ui/components/form-field`, and `@ngstarter-ui/components/input`.
|
|
70
|
+
|
|
49
71
|
## Theming
|
|
50
72
|
|
|
51
|
-
NgStarter ships Default and Chalk themes
|
|
73
|
+
NgStarter ships Default and Chalk themes, each with light and dark colors. Import the Default
|
|
74
|
+
theme once in the application's global `styles.scss`:
|
|
52
75
|
|
|
53
76
|
```scss
|
|
54
77
|
@use '@ngstarter-ui/components/styles/themes/default';
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
If the application uses Chalk or lets users switch to it at runtime, also import:
|
|
81
|
+
|
|
82
|
+
```scss
|
|
55
83
|
@use '@ngstarter-ui/components/styles/themes/chalk';
|
|
56
84
|
```
|
|
57
85
|
|
|
86
|
+
The theme includes Tailwind CSS and shared base styles; an additional Tailwind import or a
|
|
87
|
+
duplicate CSS reset is not needed.
|
|
88
|
+
|
|
58
89
|
Themes use fixed light and dark color tokens. Their main layers are:
|
|
59
90
|
|
|
60
91
|
- primitive tokens: spacing, radius, font sizes, shadows
|
|
@@ -64,27 +95,55 @@ Themes use fixed light and dark color tokens. Their main layers are:
|
|
|
64
95
|
Configure the theme and color scheme at runtime:
|
|
65
96
|
|
|
66
97
|
```ts
|
|
98
|
+
import { ApplicationConfig } from '@angular/core';
|
|
67
99
|
import { provideNgsTheme } from '@ngstarter-ui/components/core';
|
|
68
100
|
|
|
69
|
-
export const appConfig = {
|
|
101
|
+
export const appConfig: ApplicationConfig = {
|
|
70
102
|
providers: [
|
|
71
103
|
provideNgsTheme({
|
|
72
104
|
theme: 'default',
|
|
73
105
|
colorScheme: 'auto',
|
|
74
|
-
colorPreset: 'default',
|
|
75
106
|
}),
|
|
76
107
|
],
|
|
77
108
|
};
|
|
78
109
|
```
|
|
79
110
|
|
|
80
|
-
|
|
111
|
+
`theme` accepts `'default'` or `'chalk'`. `colorScheme` accepts `'light'`, `'dark'`, or
|
|
112
|
+
`'auto'`; auto follows the operating system preference. These options default to `'default'`
|
|
113
|
+
and `'auto'`, respectively.
|
|
114
|
+
|
|
115
|
+
`colorPreset` is optional and currently supports only `'default'`. The theme manager always
|
|
116
|
+
uses that value, so it can be omitted. Customize colors and geometry through CSS tokens.
|
|
117
|
+
|
|
118
|
+
Preferences are stored in localStorage under `ngs-admin` by default. Set `persist: false` to
|
|
119
|
+
disable persistence or use `storageKey` to choose another key. Stored preferences take
|
|
120
|
+
precedence over the initial theme and color scheme when persistence is enabled.
|
|
121
|
+
|
|
122
|
+
Use `ThemeManagerService` to change preferences from a component:
|
|
81
123
|
|
|
82
124
|
```ts
|
|
83
|
-
|
|
84
|
-
|
|
125
|
+
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
|
126
|
+
import { Button } from '@ngstarter-ui/components/button';
|
|
127
|
+
import { ThemeManagerService } from '@ngstarter-ui/components/core';
|
|
128
|
+
|
|
129
|
+
@Component({
|
|
130
|
+
selector: 'app-theme-preferences',
|
|
131
|
+
standalone: true,
|
|
132
|
+
imports: [Button],
|
|
133
|
+
template: `
|
|
134
|
+
<button ngsButton (click)="themeManager.setTheme('chalk')">Chalk</button>
|
|
135
|
+
<button ngsButton (click)="themeManager.setColorScheme('auto')">System theme</button>
|
|
136
|
+
<button ngsButton (click)="themeManager.setColorScheme('dark')">Dark mode</button>
|
|
137
|
+
`,
|
|
138
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
139
|
+
})
|
|
140
|
+
export class ThemePreferences {
|
|
141
|
+
readonly themeManager = inject(ThemeManagerService);
|
|
142
|
+
}
|
|
85
143
|
```
|
|
86
144
|
|
|
87
|
-
The
|
|
145
|
+
The service synchronizes document attributes and the `dark` class. Without the runtime
|
|
146
|
+
service, the imported stylesheets can also be controlled with document attributes:
|
|
88
147
|
|
|
89
148
|
```html
|
|
90
149
|
<html data-ngs-theme="chalk" data-ngs-color-scheme="dark">
|
|
@@ -96,8 +155,13 @@ The documentation site includes live demos and API examples for each component:
|
|
|
96
155
|
|
|
97
156
|
- [Documentation](https://docs.ngstarter.com)
|
|
98
157
|
- [Installation](https://docs.ngstarter.com/installation)
|
|
158
|
+
- [Theming](https://docs.ngstarter.com/theme)
|
|
99
159
|
- [AI component registry](https://docs.ngstarter.com/ai/component-registry.json)
|
|
100
160
|
|
|
161
|
+
The package also includes the registry at
|
|
162
|
+
`node_modules/@ngstarter-ui/components/ai/component-registry.json` for local component
|
|
163
|
+
discovery and AI-assisted development.
|
|
164
|
+
|
|
101
165
|
### Forms
|
|
102
166
|
|
|
103
167
|
- [Autocomplete](https://docs.ngstarter.com/forms/autocomplete)
|
|
@@ -107,6 +171,7 @@ The documentation site includes live demos and API examples for each component:
|
|
|
107
171
|
- [Country Select](https://docs.ngstarter.com/forms/country)
|
|
108
172
|
- [Currency Select](https://docs.ngstarter.com/forms/currency-select)
|
|
109
173
|
- [Date Format Select](https://docs.ngstarter.com/forms/date-format-select)
|
|
174
|
+
- [Filter Select](https://docs.ngstarter.com/forms/filter-select)
|
|
110
175
|
- [Inline Text Edit](https://docs.ngstarter.com/forms/inline-text-edit)
|
|
111
176
|
- [Input](https://docs.ngstarter.com/forms/input)
|
|
112
177
|
- [Input Mask](https://docs.ngstarter.com/forms/input-mask)
|
|
@@ -134,9 +199,17 @@ The documentation site includes live demos and API examples for each component:
|
|
|
134
199
|
|
|
135
200
|
- [Content Editor](https://docs.ngstarter.com/libraries/content-editor)
|
|
136
201
|
- [Data View](https://docs.ngstarter.com/libraries/data-view)
|
|
202
|
+
- [Form Builder](https://docs.ngstarter.com/libraries/form-builder)
|
|
203
|
+
- [Headless Editor](https://docs.ngstarter.com/libraries/headless-editor)
|
|
137
204
|
- [Image Designer](https://docs.ngstarter.com/libraries/image-designer)
|
|
138
205
|
- [Kanban Board](https://docs.ngstarter.com/libraries/kanban-board)
|
|
139
206
|
- [Micro Charts](https://docs.ngstarter.com/micro-charts)
|
|
207
|
+
- [Bar Chart](https://docs.ngstarter.com/micro-charts/bar-chart)
|
|
208
|
+
- [Line Chart](https://docs.ngstarter.com/micro-charts/line-chart)
|
|
209
|
+
- [Pie Chart](https://docs.ngstarter.com/micro-charts/pie-chart)
|
|
210
|
+
- [PDF Builder](https://docs.ngstarter.com/libraries/pdf-builder)
|
|
211
|
+
- [PDF Signer](https://docs.ngstarter.com/libraries/pdf-signer)
|
|
212
|
+
- [PDF Viewer](https://docs.ngstarter.com/libraries/pdf-viewer)
|
|
140
213
|
- [Video Player](https://docs.ngstarter.com/libraries/video-player)
|
|
141
214
|
- [Visual Builder](https://docs.ngstarter.com/libraries/visual-builder)
|
|
142
215
|
|
|
@@ -149,6 +222,7 @@ The documentation site includes live demos and API examples for each component:
|
|
|
149
222
|
- [Badge](https://docs.ngstarter.com/components/badge)
|
|
150
223
|
- [Block Loader](https://docs.ngstarter.com/components/block-loader)
|
|
151
224
|
- [Bottom Sheet](https://docs.ngstarter.com/components/bottom-sheet)
|
|
225
|
+
- [Calendar](https://docs.ngstarter.com/components/calendar)
|
|
152
226
|
- [Card](https://docs.ngstarter.com/components/card)
|
|
153
227
|
- [Card Overlay](https://docs.ngstarter.com/components/card-overlay)
|
|
154
228
|
- [Carousel](https://docs.ngstarter.com/components/carousel)
|
|
@@ -163,17 +237,21 @@ The documentation site includes live demos and API examples for each component:
|
|
|
163
237
|
- [Cookie Popup](https://docs.ngstarter.com/components/cookie-popup)
|
|
164
238
|
- [Crop](https://docs.ngstarter.com/components/crop)
|
|
165
239
|
- [Datepicker](https://docs.ngstarter.com/components/datepicker)
|
|
240
|
+
- [Digit Roller](https://docs.ngstarter.com/components/digit-roller)
|
|
166
241
|
- [Dialog](https://docs.ngstarter.com/components/dialog)
|
|
167
242
|
- [Divider](https://docs.ngstarter.com/components/divider)
|
|
168
243
|
- [Drawer](https://docs.ngstarter.com/components/drawer)
|
|
169
244
|
- [Emoji Picker](https://docs.ngstarter.com/components/emoji-picker)
|
|
170
245
|
- [Empty State](https://docs.ngstarter.com/components/empty-state)
|
|
246
|
+
- [Events](https://docs.ngstarter.com/components/events)
|
|
171
247
|
- [Expand](https://docs.ngstarter.com/components/expand)
|
|
172
248
|
- [Expansion Panel](https://docs.ngstarter.com/components/expansion-panel)
|
|
249
|
+
- [File Type](https://docs.ngstarter.com/components/file-type)
|
|
173
250
|
- [Filter Builder](https://docs.ngstarter.com/components/filter-builder)
|
|
174
251
|
- [Gauge](https://docs.ngstarter.com/components/gauge)
|
|
175
252
|
- [Grid](https://docs.ngstarter.com/components/grid)
|
|
176
253
|
- [Guided Tour](https://docs.ngstarter.com/components/guided-tour)
|
|
254
|
+
- [Headless Stepper](https://docs.ngstarter.com/components/headless-stepper)
|
|
177
255
|
- [Icon](https://docs.ngstarter.com/components/icon)
|
|
178
256
|
- [Image Placeholder](https://docs.ngstarter.com/components/image-placeholder)
|
|
179
257
|
- [Image Resizer](https://docs.ngstarter.com/components/image-resizer)
|
|
@@ -198,12 +276,13 @@ The documentation site includes live demos and API examples for each component:
|
|
|
198
276
|
- [Skeleton](https://docs.ngstarter.com/components/skeleton)
|
|
199
277
|
- [Slider](https://docs.ngstarter.com/components/slider)
|
|
200
278
|
- [Snack Bar](https://docs.ngstarter.com/components/snackbar)
|
|
279
|
+
- [Sort](https://docs.ngstarter.com/components/sort)
|
|
201
280
|
- [Split Pane](https://docs.ngstarter.com/components/split-pane)
|
|
281
|
+
- [Step Tracker](https://docs.ngstarter.com/components/step-tracker)
|
|
202
282
|
- [Stepper](https://docs.ngstarter.com/components/stepper)
|
|
203
283
|
- [Suggestions](https://docs.ngstarter.com/components/suggestions)
|
|
204
284
|
- [Table](https://docs.ngstarter.com/components/table)
|
|
205
285
|
- [Tabs](https://docs.ngstarter.com/components/tabs)
|
|
206
|
-
- [Text Editor](https://docs.ngstarter.com/components/text-editor)
|
|
207
286
|
- [Thumbnail Maker](https://docs.ngstarter.com/components/thumbnail-maker)
|
|
208
287
|
- [Tiles](https://docs.ngstarter.com/components/tiles)
|
|
209
288
|
- [Timeline](https://docs.ngstarter.com/components/timeline)
|
|
@@ -211,5 +290,46 @@ The documentation site includes live demos and API examples for each component:
|
|
|
211
290
|
- [Toolbar](https://docs.ngstarter.com/components/toolbar)
|
|
212
291
|
- [Tooltip](https://docs.ngstarter.com/components/tooltip)
|
|
213
292
|
- [Tree](https://docs.ngstarter.com/components/tree)
|
|
293
|
+
- [Typed Signature Pad](https://docs.ngstarter.com/components/typed-signature-pad)
|
|
214
294
|
- [Upload](https://docs.ngstarter.com/components/upload)
|
|
215
295
|
- [Video Viewer](https://docs.ngstarter.com/components/video-viewer)
|
|
296
|
+
|
|
297
|
+
## Repository Development
|
|
298
|
+
|
|
299
|
+
Clone the repository and install its dependencies to run the docs locally:
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
git clone https://github.com/elementarlabsdev/ngstarter.git
|
|
303
|
+
cd ngstarter
|
|
304
|
+
npm ci
|
|
305
|
+
npm run start:docs
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
The workspace contains:
|
|
309
|
+
|
|
310
|
+
| Directory | Purpose |
|
|
311
|
+
| --- | --- |
|
|
312
|
+
| `projects/components` | Publishable library, secondary entry points, themes, and schematics |
|
|
313
|
+
| `projects/docs` | Documentation application and live component examples |
|
|
314
|
+
| `projects/admin` | Admin demo application |
|
|
315
|
+
| `projects/admin-modern` | Modern admin application |
|
|
316
|
+
| `projects/admin-corporate` | Corporate admin application |
|
|
317
|
+
| `projects/admin-classic` | Placeholder for a future admin application |
|
|
318
|
+
|
|
319
|
+
Use the relevant command for the part of the workspace you are changing:
|
|
320
|
+
|
|
321
|
+
| Command | Purpose |
|
|
322
|
+
| --- | --- |
|
|
323
|
+
| `npm run build:components:prod` | Build the library, AI metadata, and schematics |
|
|
324
|
+
| `npm run verify:components:package` | Validate the generated package after building it |
|
|
325
|
+
| `npm run build:docs:prod` | Build the documentation application |
|
|
326
|
+
| `npm run start:admin:modern` | Run the Modern admin application |
|
|
327
|
+
| `npm run start:admin:corporate` | Run the Corporate admin application |
|
|
328
|
+
| `npm run verify:admin:components` | Check admin composition against NgStarter conventions |
|
|
329
|
+
| `npm run test:components` | Run library unit tests |
|
|
330
|
+
| `npm run test:docs` | Run documentation application tests |
|
|
331
|
+
| `npm run test` | Run all configured unit test targets |
|
|
332
|
+
| `npm run generate:ai` | Regenerate the AI component registry and usage guidance |
|
|
333
|
+
|
|
334
|
+
Follow `AGENTS.md` for component structure, public imports, admin composition, and validation.
|
|
335
|
+
Keep changes in source files; do not edit generated files under `dist/`.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngstarter-ui/components",
|
|
3
3
|
"description": "NgStarter - AI-friendly Enterprise Angular UI Components and Admin Panel",
|
|
4
|
-
"version": "22.1.
|
|
4
|
+
"version": "22.1.4",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/elementarlabsdev/ngstarter.git"
|