@ng-solid/design-system 22.1.1 → 22.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/README.md +99 -41
- package/fesm2022/ng-solid-design-system.mjs +6697 -1617
- package/fesm2022/ng-solid-design-system.mjs.map +1 -1
- package/package.json +27 -12
- package/themes/README.md +75 -0
- package/themes/fonts/InterVariable.woff2 +0 -0
- package/themes/fonts/OFL.txt +92 -0
- package/themes/fonts/ROBOTO-OFL.txt +93 -0
- package/themes/fonts/Roboto-Variable.ttf +0 -0
- package/themes/index.scss +1 -0
- package/themes/tailwind.css +87 -0
- package/types/ng-solid-design-system.d.ts +1031 -367
package/README.md
CHANGED
|
@@ -1,76 +1,134 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ng-solid/design-system
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
23
|
+
Register Arvisfy in the Angular application configuration:
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
```ts
|
|
26
|
+
import { Arvisfy, provideNsTheme } from '@ng-solid/design-system';
|
|
21
27
|
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
export const appConfig = {
|
|
29
|
+
providers: [provideNsTheme({ preset: Arvisfy, colorScheme: 'system' })]
|
|
30
|
+
};
|
|
31
|
+
```
|
|
24
32
|
|
|
25
|
-
|
|
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 {
|
|
37
|
+
import { inject } from '@angular/core';
|
|
38
|
+
import { NsThemeService } from '@ng-solid/design-system';
|
|
29
39
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
})
|
|
33
|
-
export class AppModule {}
|
|
40
|
+
const theme = inject(NsThemeService);
|
|
41
|
+
theme.setScheme('dark');
|
|
34
42
|
```
|
|
35
43
|
|
|
36
|
-
|
|
44
|
+
## Extend the preset
|
|
45
|
+
|
|
46
|
+
Use `defineNsPreset` so custom presets retain the primitive → semantic →
|
|
47
|
+
component dependency contract:
|
|
37
48
|
|
|
38
|
-
```
|
|
39
|
-
|
|
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
|
-
|
|
71
|
+
See the packaged `themes/README.md` for the Arvisfy design principles and token
|
|
72
|
+
rules.
|
|
73
|
+
|
|
74
|
+
## Components
|
|
43
75
|
|
|
44
|
-
|
|
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-
|
|
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
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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`, `NsSelectorListComponent`.
|
|
117
|
+
- `NsDatePickerComponent`, `NsDateRangePickerComponent`,
|
|
118
|
+
`NsDescriptionComponent`, `NsDrawerComponent`, `NsInputComponent`,
|
|
119
|
+
`NsInputGroupComponent`, `NsInputCodeComponent`, `NsLinkComponent`,
|
|
120
|
+
`NsListBoxComponent`, `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`, `NsListBoxOptionComponent`,
|
|
132
|
+
`NsSelectorListItemComponent`, `NsTabComponent`, `NsTagComponent`, and
|
|
133
|
+
`NsTooltipDirective` are exported from the same entry point. The legacy
|
|
134
|
+
Dropdown API and its legacy toast contracts are not exported.
|