@tx-angular-design-system/ui-kit 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/README.md +78 -0
- package/fesm2022/tx-angular-design-system-ui-kit.mjs +10364 -0
- package/fesm2022/tx-angular-design-system-ui-kit.mjs.map +1 -0
- package/package.json +60 -0
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/index.js +305 -0
- package/schematics/ng-add/schema.js +2 -0
- package/schematics/ng-add/schema.json +26 -0
- package/schematics/package.json +3 -0
- package/styles/base.css +330 -0
- package/styles/theme.css +320 -0
- package/styles/ui-kit.css +18 -0
- package/types/tx-angular-design-system-ui-kit.d.ts +3697 -0
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# @tx-angular-design-system/ui-kit
|
|
2
|
+
|
|
3
|
+
An Angular 22 component library styled entirely through Tailwind CSS v4 design
|
|
4
|
+
tokens, built on `@angular/aria` and `@angular/cdk`. No Angular Material.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install @tx-angular-design-system/ui-kit
|
|
10
|
+
ng add @tx-angular-design-system/ui-kit
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`ng add` installs Tailwind v4 and the CDK/Aria peers, writes a PostCSS config,
|
|
14
|
+
wires the theme into your global stylesheet and links the fonts. It is
|
|
15
|
+
idempotent and will not clobber an existing Tailwind setup.
|
|
16
|
+
|
|
17
|
+
Your global stylesheet ends up with:
|
|
18
|
+
|
|
19
|
+
```css
|
|
20
|
+
@import 'tailwindcss';
|
|
21
|
+
@import '@angular/cdk/overlay-prebuilt.css';
|
|
22
|
+
@import '@tx-angular-design-system/ui-kit/styles/ui-kit.css';
|
|
23
|
+
@source '../node_modules/@tx-angular-design-system/ui-kit';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> **If components render unstyled, check the `@source` line first.** Tailwind
|
|
27
|
+
> skips `node_modules` during content detection, so without it none of the kit's
|
|
28
|
+
> utility classes are generated from its compiled templates.
|
|
29
|
+
|
|
30
|
+
## Use
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { TxButtonComponent, TxButtonConfig } from '@tx-angular-design-system/ui-kit';
|
|
34
|
+
|
|
35
|
+
@Component({
|
|
36
|
+
imports: [TxButtonComponent],
|
|
37
|
+
template: `<tx-button [config]="save" (clicked)="onSave()" />`,
|
|
38
|
+
})
|
|
39
|
+
export class MyComponent {
|
|
40
|
+
save: TxButtonConfig = { label: 'Save', variant: 'primary', icon: 'check' };
|
|
41
|
+
|
|
42
|
+
onSave() {
|
|
43
|
+
// Config is a signal input — replace the object, never mutate it.
|
|
44
|
+
this.save = { ...this.save, loading: true };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Every component takes its simple property configuration through one
|
|
50
|
+
strongly-typed `Tx<Name>Config` object. Data (options, columns, tree nodes) comes
|
|
51
|
+
through its own input, and structural customisation is content projection or a
|
|
52
|
+
`TemplateRef` — never a field on the config.
|
|
53
|
+
|
|
54
|
+
## Theme
|
|
55
|
+
|
|
56
|
+
Override any token at a narrower scope, after the kit's import:
|
|
57
|
+
|
|
58
|
+
```css
|
|
59
|
+
:root {
|
|
60
|
+
--color-tx-brand-500: #1f6fd0;
|
|
61
|
+
--color-tx-brand-700: #17529b;
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Every semantic role is a `var()` reference into the numbered palette, so this
|
|
66
|
+
re-colours every component that uses `--color-tx-primary` with no code change.
|
|
67
|
+
`success`, `danger`, `warning` and `info` are independent families and do not
|
|
68
|
+
follow `brand`.
|
|
69
|
+
|
|
70
|
+
## Components
|
|
71
|
+
|
|
72
|
+
Button · input · textarea · checkbox · radio group · switch · select ·
|
|
73
|
+
multiselect · dropdown tree · chips input · datepicker · table · tree · reorder
|
|
74
|
+
list · dialog · toaster · spinner · tooltip · alert · skeleton · header ·
|
|
75
|
+
sidebar · tabs · accordion · card · badge · breadcrumb · divider · empty state ·
|
|
76
|
+
pagination · icon registry · form field.
|
|
77
|
+
|
|
78
|
+
See the workspace README for the full architecture notes.
|