@jdpo2008/ngx-ds 0.0.0-stage → 0.1.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 +21 -0
- package/README.md +111 -2
- package/fesm2022/jdpo2008-ngx-ds.mjs +5592 -0
- package/fesm2022/jdpo2008-ngx-ds.mjs.map +1 -0
- package/package.json +45 -3
- package/styles/_legacy.scss +53 -0
- package/styles/_themes.scss +73 -0
- package/styles/_tokens.scss +92 -0
- package/styles/index.scss +11 -0
- package/styles/ngx-ds.scss +23 -0
- package/types/jdpo2008-ngx-ds.d.ts +2130 -0
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,112 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @jdpo2008/ngx-ds
|
|
2
2
|
|
|
3
|
-
|
|
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
|
+
npm install @jdpo2008/ngx-ds lucide-angular
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer dependencies: `@angular/common`, `@angular/core`, `@angular/forms` and `@angular/platform-browser` 21, and `lucide-angular` 1.
|
|
12
|
+
|
|
13
|
+
## Styles
|
|
14
|
+
|
|
15
|
+
Load the design tokens once, globally. Add the stylesheet to `angular.json`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
"styles": ["node_modules/@jdpo2008/ngx-ds/styles/ngx-ds.scss", "src/styles.scss"]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
or `@use` it from your global `styles.scss`:
|
|
22
|
+
|
|
23
|
+
```scss
|
|
24
|
+
@use '@jdpo2008/ngx-ds/styles/ngx-ds';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
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.
|
|
28
|
+
|
|
29
|
+
### Theming
|
|
30
|
+
|
|
31
|
+
Every color is a CSS custom property (`--primary-600`, `--text-base`, `--surface-base`, `--border-base`, …). Override any of them in your own `:root`:
|
|
32
|
+
|
|
33
|
+
```css
|
|
34
|
+
:root {
|
|
35
|
+
--primary-600: #0d9488;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The dark theme is opt-in. Set `data-theme="dark"` on `<html>` or add the `dark` class to an ancestor.
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
Every component is standalone. Import it where you use it:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import { Component } from '@angular/core';
|
|
47
|
+
import { ButtonComponent, InputComponent } from '@jdpo2008/ngx-ds';
|
|
48
|
+
|
|
49
|
+
@Component({
|
|
50
|
+
selector: 'app-root',
|
|
51
|
+
imports: [ButtonComponent, InputComponent],
|
|
52
|
+
template: `
|
|
53
|
+
<ngx-ds-input [(value)]="name" />
|
|
54
|
+
<ngx-ds-button (click)="save()">Save</ngx-ds-button>
|
|
55
|
+
`,
|
|
56
|
+
})
|
|
57
|
+
export class AppComponent {
|
|
58
|
+
name = '';
|
|
59
|
+
save() {}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
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)]`.
|
|
64
|
+
|
|
65
|
+
### Toasts and confirmations
|
|
66
|
+
|
|
67
|
+
Place the hosts once, usually in the root component, and trigger them from the services:
|
|
68
|
+
|
|
69
|
+
<!-- prettier-ignore -->
|
|
70
|
+
```html
|
|
71
|
+
<ngx-ds-toast />
|
|
72
|
+
<ngx-ds-confirmation />
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
const toastr = inject(ToastrService);
|
|
77
|
+
const confirmation = inject(ConfirmationService);
|
|
78
|
+
|
|
79
|
+
toastr.success('Changes saved');
|
|
80
|
+
const ok = await confirmation.confirm({
|
|
81
|
+
title: 'Delete',
|
|
82
|
+
message: 'Are you sure?',
|
|
83
|
+
type: 'danger',
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Language
|
|
88
|
+
|
|
89
|
+
Labels default to Spanish and dates to `es-ES`. To switch app-wide:
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
import { NGX_DS_LABELS_EN, provideNgxDsLabels, provideNgxDsLocale } from '@jdpo2008/ngx-ds';
|
|
93
|
+
|
|
94
|
+
bootstrapApplication(AppComponent, {
|
|
95
|
+
providers: [provideNgxDsLabels(NGX_DS_LABELS_EN), provideNgxDsLocale('en-US')],
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Components
|
|
100
|
+
|
|
101
|
+
- **Atoms:** Avatar, Badge, Button, Divider, Icon, IconButton, Kbd, MenuButton, ProgressBar, Skeleton, Spinner, Tag, Tooltip.
|
|
102
|
+
- **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.
|
|
103
|
+
- **Organisms:** Accordion, Calendar, CommandPalette, Confirmation, ContextMenu, Drawer, Modal, NotificationCenter, Pagination, Popover, Sidebar, Stepper, Table, Tabs, Timeline, Toast, TreeView, UserMenu.
|
|
104
|
+
- **Directives:** FocusTrap.
|
|
105
|
+
|
|
106
|
+
## Changelog
|
|
107
|
+
|
|
108
|
+
See [CHANGELOG.md](https://github.com/jdpo2008/ngx-ds/blob/master/CHANGELOG.md).
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
[MIT](https://github.com/jdpo2008/ngx-ds/blob/master/LICENSE)
|