@ng-solid/design-system 22.1.1 → 22.2.1

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,76 +1,134 @@
1
- # Angular UI Components
1
+ # @ng-solid/design-system
2
2
 
3
- [![NPM version][npm-image]][npm-url]
4
-
5
- [npm-image]: https://img.shields.io/npm/v/@ng-solid/facebook.svg?style=flat-square
6
- [npm-url]: https://www.npmjs.com/@ng-solid/facebook
7
-
8
- An Angular UI component library based on Ant Design.
3
+ Arvisfy is the default ng-solid design-system preset. It combines Angular
4
+ standalone components, Tailwind CSS composition from SCSS, BEM `ns-*` class
5
+ contracts and a strict three-tier token architecture.
9
6
 
10
7
  ## Installation
11
8
 
12
9
  ```bash
13
- $ ng new PROJECT_NAME
14
- $ cd PROJECT_NAME
15
- $ ng add @ng-solid/design-system
10
+ pnpm add @ng-solid/design-system @ng-solid/icons
11
+ pnpm add -D tailwindcss @tailwindcss/postcss
12
+ ```
13
+
14
+ Tailwind is optional unless the application consumes the semantic utility
15
+ bridge. Configure `@tailwindcss/postcss` in the application's PostCSS setup.
16
+
17
+ Import the Tailwind semantic bridge once in the application stylesheet:
18
+
19
+ ```css
20
+ @import '@ng-solid/design-system/themes/tailwind.css';
16
21
  ```
17
22
 
18
- You can also install `@ng-solid/design-system` with npm or yarn
23
+ Register Arvisfy in the Angular application configuration:
19
24
 
20
- ## Usage
25
+ ```ts
26
+ import { Arvisfy, provideNsTheme } from '@ng-solid/design-system';
21
27
 
22
- Import the component module you want to use in your `app.module.ts` file
23
- or [feature modules](https://angular.io/guide/feature-modules) as you need.
28
+ export const appConfig = {
29
+ providers: [provideNsTheme({ preset: Arvisfy, colorScheme: 'system' })]
30
+ };
31
+ ```
24
32
 
25
- ### Buttons
33
+ `system` follows `prefers-color-scheme`. Explicit `light` and `dark` choices
34
+ are persisted by `NsThemeService` and applied without reloading:
26
35
 
27
36
  ```ts
28
- import { NsButtonModule } from '@ng-solid/design-system';
37
+ import { inject } from '@angular/core';
38
+ import { NsThemeService } from '@ng-solid/design-system';
29
39
 
30
- @NgModule({
31
- imports: [...NsButtonModule]
32
- })
33
- export class AppModule {}
40
+ const theme = inject(NsThemeService);
41
+ theme.setScheme('dark');
34
42
  ```
35
43
 
36
- and in your html template
44
+ ## Extend the preset
45
+
46
+ Use `defineNsPreset` so custom presets retain the primitive → semantic →
47
+ component dependency contract:
37
48
 
38
- ```angular2html
39
- <ns-button label="My Button" [theme]="true"></ns-button>
49
+ ```ts
50
+ import { defineNsPreset, Arvisfy } from '@ng-solid/design-system';
51
+
52
+ export const ProductTheme = defineNsPreset(Arvisfy, {
53
+ name: 'product',
54
+ primitive: {
55
+ color: {
56
+ brand: { 500: '#0052ff' }
57
+ }
58
+ },
59
+ semantic: {
60
+ colorScheme: {
61
+ light: { color: { primary: '{primitive.color.brand.500}' } },
62
+ dark: { color: { primary: '{primitive.color.brand.500}' } }
63
+ }
64
+ },
65
+ components: {
66
+ button: { borderColor: '{semantic.color.primary}' }
67
+ }
68
+ });
40
69
  ```
41
70
 
42
- ### Input groups
71
+ See the packaged `themes/README.md` for the Arvisfy design principles and token
72
+ rules.
73
+
74
+ ## Components
43
75
 
44
- `ns-input-group` is a visual wrapper. Keep `formControlName`, `formControl` or
45
- `ngModel` on every input, checkbox or radio inside the group.
76
+ Components are imported directly from the package:
46
77
 
47
78
  ```ts
48
79
  import {
80
+ NsButtonComponent,
81
+ NsDatePickerComponent,
49
82
  NsInputComponent,
50
83
  NsInputGroupAddonComponent,
51
- NsInputGroupComponent
84
+ NsInputGroupComponent,
85
+ NsModalComponent
52
86
  } from '@ng-solid/design-system';
53
87
  ```
54
88
 
55
89
  ```html
56
- <ns-input-group
57
- append=".tienda-aprovecha.do"
58
- label="Store URL"
59
- size="md"
60
- [wrap]="false"
61
- >
62
- <ns-input formControlName="domain" placeholder="demo" />
63
- </ns-input-group>
90
+ <ns-button variant="primary">Guardar cambios</ns-button>
64
91
 
65
- <ns-input-group label="Amount">
92
+ <ns-input-group>
66
93
  <ns-input-group-addon>$</ns-input-group-addon>
67
94
  <ns-input formControlName="amount" ariaLabel="Amount" />
68
95
  <ns-input-group-addon>USD</ns-input-group-addon>
69
- <ns-button label="Apply" />
70
96
  </ns-input-group>
71
97
  ```
72
98
 
73
- The group supports text addons through `prepend` and `append`, repeated
74
- `ns-input-group-addon` elements, buttons on either side, multiple inputs,
75
- checkbox/radio content, `sm | md | lg` sizing and configurable wrapping. Labels
76
- belong outside the visual row and are associated with the first `ns-input`.
99
+ `ns-input-group` is only a layout wrapper. It has no `label` or `wrap` inputs;
100
+ put labels and form directives on the projected `ns-input` control.
101
+
102
+ Application templates should style their own layout with BEM `ns-*` classes.
103
+ Library component templates never expose Tailwind utilities directly.
104
+
105
+ `ns-button` uses projected content and the semantic `primary`, `secondary`,
106
+ `tertiary`, `success`, and `danger` variants; `color`, `label`, and the former
107
+ `theme` input are not part of its API. `NsModalComponent` supports projected modal content or a
108
+ typed `contentComponent` supplied through `NsModalService`; `nsTemplate` no
109
+ longer registers templates with a modal reference.
110
+
111
+ The package's primary component API is:
112
+
113
+ - `NsAccordionComponent`, `NsAlertComponent`, `NsAvatarComponent`,
114
+ `NsBadgeComponent`, `NsBreadcrumbsComponent`, `NsButtonComponent`,
115
+ `NsButtonGroupComponent`, `NsCardComponent`, `NsCheckboxComponent`,
116
+ `NsChipComponent`, `NsDropdownComponent`.
117
+ - `NsDatePickerComponent`, `NsDateRangePickerComponent`,
118
+ `NsDescriptionComponent`, `NsDrawerComponent`, `NsInputComponent`,
119
+ `NsInputGroupComponent`, `NsInputCodeComponent`, `NsLinkComponent`,
120
+ `NsMeterComponent`, `NsModalComponent`,
121
+ `NsInputNumberComponent`, `NsPaginationComponent`, `NsPopoverComponent`,
122
+ `NsProgressBarComponent`.
123
+ - `NsRadioComponent`, `NsRadioGroupComponent`, `NsInputSearchComponent`,
124
+ `NsDividerComponent`, `NsSkeletonComponent`, `NsSliderComponent`,
125
+ `NsSurfaceComponent`, `NsSwitchComponent`, `NsTabsComponent`,
126
+ `NsTagGroupComponent`, `NsTextAreaComponent`, `NsToastComponent`, and
127
+ `NsTooltipComponent`.
128
+
129
+ Composition helpers such as `NsAccordionItemComponent`,
130
+ `NsBreadcrumbItemComponent`, `NsCardHeaderComponent`, `NsCardBodyComponent`,
131
+ `NsCardFooterComponent`, `NsDropdownItemDirective`,
132
+ `NsTabComponent`, `NsTagComponent`, and
133
+ `NsTooltipDirective` are exported from the same entry point. The pre-refactor
134
+ Bootstrap-based dropdown API and its legacy toast contracts are not exported.