@jdpo2008/ngx-ds 0.5.0 → 0.7.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 +18 -0
- package/fesm2022/jdpo2008-ngx-ds.mjs +966 -190
- package/fesm2022/jdpo2008-ngx-ds.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/ngx-ds.scss +2 -3
- package/types/jdpo2008-ngx-ds.d.ts +297 -49
- package/styles/_legacy.scss +0 -53
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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
4
|
|
|
5
|
+
Browse every component in the [Storybook](https://jdpo2008.github.io/ngx-ds/).
|
|
6
|
+
|
|
5
7
|
## Install
|
|
6
8
|
|
|
7
9
|
```bash
|
|
@@ -128,9 +130,25 @@ bootstrapApplication(AppComponent, {
|
|
|
128
130
|
| `locale` | `'es-ES'` | Month and weekday names, date and number formatting. An `en-*` locale also switches the labels to English. |
|
|
129
131
|
| `labels` | — | Overrides individual labels. Missing keys come from the locale's set. |
|
|
130
132
|
| `theme` | — | `'light'`, `'dark'` or `'system'` (follows `prefers-color-scheme` and updates live). Sets `data-theme` on `<html>`. Omit it to manage the theme yourself. |
|
|
133
|
+
| `colors` | — | `{ primary: '#0d9488' }` replaces the default indigo. See [Brand colour](#brand-colour). |
|
|
131
134
|
|
|
132
135
|
`provideNgxDsLocale()` and `provideNgxDsLabels()` still work for setting one thing at a time.
|
|
133
136
|
|
|
137
|
+
### Brand colour
|
|
138
|
+
|
|
139
|
+
`colors.primary` takes a `#rgb` or `#rrggbb` colour. It becomes `--primary-600` (buttons, focus rings, selected states) and the rest of the `--primary-*` scale is generated from it in OKLCH, for the light and the dark theme. Pick a colour dark enough for white text: in dev mode, ngx-ds warns when the contrast is below 4.5:1.
|
|
140
|
+
|
|
141
|
+
To change it at runtime, for example per tenant:
|
|
142
|
+
|
|
143
|
+
```ts
|
|
144
|
+
import { applyPrimaryColor } from '@jdpo2008/ngx-ds';
|
|
145
|
+
|
|
146
|
+
applyPrimaryColor('#e11d48'); // switch
|
|
147
|
+
applyPrimaryColor(null); // back to indigo
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
`createPrimaryPalette(color)` returns the generated scale if you need the values elsewhere.
|
|
151
|
+
|
|
134
152
|
## Components
|
|
135
153
|
|
|
136
154
|
- **Atoms:** Avatar, Badge, Button, Divider, Icon, IconButton, Kbd, MenuButton, ProgressBar, Skeleton, Spinner, Tag, Tooltip.
|