@jdpo2008/ngx-ds 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jose Daniel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,147 @@
1
- # Temporary Holding Version
1
+ # @jdpo2008/ngx-ds
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An Angular 21 component library: standalone components, a signal-based API, `OnPush` change detection and CSS custom-property design tokens with an opt-in dark theme.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ ng add @jdpo2008/ngx-ds
9
+ ```
10
+
11
+ `ng add` installs the package and `lucide-angular`, and adds the design tokens stylesheet to the `styles` of your application in `angular.json`. In a workspace with several applications, pass `--project <name>`.
12
+
13
+ To set it up by hand instead:
14
+
15
+ ```bash
16
+ npm install @jdpo2008/ngx-ds lucide-angular
17
+ ```
18
+
19
+ then load the stylesheet as described in [Styles](#styles).
20
+
21
+ Peer dependencies: `@angular/common`, `@angular/core`, `@angular/forms` and `@angular/platform-browser` 21, and `lucide-angular` 1.
22
+
23
+ ## Styles
24
+
25
+ `ng add` does this for you. Otherwise, load the design tokens once, globally. Add the stylesheet to `angular.json`:
26
+
27
+ ```json
28
+ "styles": ["node_modules/@jdpo2008/ngx-ds/styles/ngx-ds.scss", "src/styles.scss"]
29
+ ```
30
+
31
+ or `@use` it from your global `styles.scss`:
32
+
33
+ ```scss
34
+ @use '@jdpo2008/ngx-ds/styles/ngx-ds';
35
+ ```
36
+
37
+ No Tailwind is required. Components use the `Poppins` font family by default but do not load it. Load it yourself, or point `--ngx-primary-font-family` at another font.
38
+
39
+ ### Theming
40
+
41
+ Every color is a CSS custom property (`--primary-600`, `--text-base`, `--surface-base`, `--border-base`, …). Override any of them in your own `:root`:
42
+
43
+ ```css
44
+ :root {
45
+ --primary-600: #0d9488;
46
+ }
47
+ ```
48
+
49
+ The dark theme is opt-in. Set `data-theme="dark"` on `<html>`, add the `dark` class to an ancestor, or use the `theme` option of `provideNgxDs()` (see [Configuration](#configuration)).
50
+
51
+ ## Usage
52
+
53
+ Every component is standalone. Import it where you use it:
54
+
55
+ ```ts
56
+ import { Component } from '@angular/core';
57
+ import { ButtonComponent, InputComponent } from '@jdpo2008/ngx-ds';
58
+
59
+ @Component({
60
+ selector: 'app-root',
61
+ imports: [ButtonComponent, InputComponent],
62
+ template: `
63
+ <ngx-ds-input [(value)]="name" />
64
+ <ngx-ds-button (click)="save()">Save</ngx-ds-button>
65
+ `,
66
+ })
67
+ export class AppComponent {
68
+ name = '';
69
+ save() {}
70
+ }
71
+ ```
72
+
73
+ Form controls (Input, Select, Checkbox, Datepicker, …) implement `ControlValueAccessor`, so they also work with `ngModel` and reactive forms. SearchInput is the exception: bind it with `[(value)]`.
74
+
75
+ They also work with Signal Forms (`@angular/forms/signals`, experimental in Angular 21). Bind them with `[formField]`:
76
+
77
+ ```ts
78
+ import { FormField, form, required } from '@angular/forms/signals';
79
+
80
+ @Component({
81
+ imports: [FormField, InputComponent],
82
+ template: `<ngx-ds-input label="Name" [formField]="f.name" />`,
83
+ })
84
+ export class Profile {
85
+ model = signal({ name: '' });
86
+ f = form(this.model, (p) => required(p.name));
87
+ }
88
+ ```
89
+
90
+ The field's value, touched and disabled state stay in sync. The field's `min` and `max` validators also set the limits of NumberInput and RangeSlider, and `max` sets the star count of Rating. Error messages are not shown automatically: pass them with `[errorMessage]`.
91
+
92
+ ### Toasts and confirmations
93
+
94
+ Place the hosts once, usually in the root component, and trigger them from the services:
95
+
96
+ <!-- prettier-ignore -->
97
+ ```html
98
+ <ngx-ds-toast />
99
+ <ngx-ds-confirmation />
100
+ ```
101
+
102
+ ```ts
103
+ const toastr = inject(ToastrService);
104
+ const confirmation = inject(ConfirmationService);
105
+
106
+ toastr.success('Changes saved');
107
+ const ok = await confirmation.confirm({
108
+ title: 'Delete',
109
+ message: 'Are you sure?',
110
+ type: 'danger',
111
+ });
112
+ ```
113
+
114
+ ### Configuration
115
+
116
+ Labels default to Spanish and dates to `es-ES`. Configure the library app-wide with `provideNgxDs()`:
117
+
118
+ ```ts
119
+ import { provideNgxDs } from '@jdpo2008/ngx-ds';
120
+
121
+ bootstrapApplication(AppComponent, {
122
+ providers: [provideNgxDs({ locale: 'en-US', labels: { close: 'Dismiss' }, theme: 'system' })],
123
+ });
124
+ ```
125
+
126
+ | Option | Default | Effect |
127
+ | -------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
128
+ | `locale` | `'es-ES'` | Month and weekday names, date and number formatting. An `en-*` locale also switches the labels to English. |
129
+ | `labels` | — | Overrides individual labels. Missing keys come from the locale's set. |
130
+ | `theme` | — | `'light'`, `'dark'` or `'system'` (follows `prefers-color-scheme` and updates live). Sets `data-theme` on `<html>`. Omit it to manage the theme yourself. |
131
+
132
+ `provideNgxDsLocale()` and `provideNgxDsLabels()` still work for setting one thing at a time.
133
+
134
+ ## Components
135
+
136
+ - **Atoms:** Avatar, Badge, Button, Divider, Icon, IconButton, Kbd, MenuButton, ProgressBar, Skeleton, Spinner, Tag, Tooltip.
137
+ - **Molecules:** Alert, Autocomplete, AvatarGroup, Breadcrumb, ButtonGroup, Card, Checkbox, ChipGroup, ColorPicker, Datepicker, DateRangePicker, Dropdown, EmptyState, FileUpload, FormField, Input, Menu, MultiSelect, NumberInput, OtpInput, PasswordStrength, Radio, RangeSlider, Rating, SearchInput, SegmentedControl, Select, Switch, Textarea.
138
+ - **Organisms:** Accordion, Calendar, CommandPalette, Confirmation, ContextMenu, Drawer, Modal, NotificationCenter, Pagination, Popover, Sidebar, Stepper, Table, Tabs, Timeline, Toast, TreeView, UserMenu.
139
+ - **Directives:** FocusTrap.
140
+
141
+ ## Changelog
142
+
143
+ See [CHANGELOG.md](https://github.com/jdpo2008/ngx-ds/blob/master/CHANGELOG.md).
144
+
145
+ ## License
146
+
147
+ [MIT](https://github.com/jdpo2008/ngx-ds/blob/master/LICENSE)