@geoit/ui 0.0.2 → 0.0.4
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 +148 -12
- package/ai/AGENTS.md +5 -4
- package/ai/README.md +2 -2
- package/ai/catalog.json +3064 -424
- package/ai/components/geo-alert.md +75 -21
- package/ai/components/geo-back-button.md +64 -18
- package/ai/components/geo-breadcrumb.md +71 -12
- package/ai/components/geo-button.md +90 -27
- package/ai/components/geo-checkbox.md +69 -20
- package/ai/components/geo-column-picker.md +91 -18
- package/ai/components/geo-confirm-modal.md +93 -27
- package/ai/components/geo-date-picker.md +103 -29
- package/ai/components/geo-date-range-picker.md +99 -28
- package/ai/components/geo-file-picker.md +97 -26
- package/ai/components/geo-form-modal.md +112 -44
- package/ai/components/geo-icon.md +70 -16
- package/ai/components/geo-input.md +92 -29
- package/ai/components/geo-page-title.md +62 -16
- package/ai/components/geo-pagination.md +79 -24
- package/ai/components/geo-radio.md +108 -27
- package/ai/components/geo-row-actions.md +87 -19
- package/ai/components/geo-select.md +106 -28
- package/ai/components/geo-slider.md +72 -21
- package/ai/components/geo-status-tag.md +67 -15
- package/ai/components/geo-step-form-layout.md +122 -38
- package/ai/components/geo-stepper.md +82 -19
- package/ai/components/geo-table-filter.md +91 -29
- package/ai/components/geo-table-pagination.md +73 -23
- package/ai/components/geo-table-toolbar.md +84 -29
- package/ai/components/geo-table.md +194 -59
- package/ai/components/geo-tabs.md +101 -27
- package/ai/components/geo-textarea.md +82 -23
- package/ai/components/geo-toast.md +138 -27
- package/ai/components/geo-tree.md +96 -22
- package/ai/components/geo-typography.md +70 -19
- package/ai/components/geo-upload.md +110 -39
- package/ai/recipes.md +76 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @geoit/ui
|
|
2
2
|
|
|
3
|
-
Angular 18 + ng-zorro
|
|
3
|
+
GEO design system for **Angular 18** + **ng-zorro 18**. Standalone components, design tokens, and AI-ready usage docs.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -8,28 +8,150 @@ Angular 18 + ng-zorro GEO design system.
|
|
|
8
8
|
npm install @geoit/ui
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
**Peer dependencies** (install in your app if missing):
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @angular/animations@^18 @angular/common@^18 @angular/core@^18 \
|
|
15
|
+
@angular/forms@^18 @angular/cdk@^18 @ant-design/icons-angular@^18 ng-zorro-antd@^18
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Setup styles (once per app)
|
|
19
|
+
|
|
20
|
+
In your global styles (e.g. `styles.scss`):
|
|
12
21
|
|
|
13
22
|
```scss
|
|
14
23
|
@import 'node_modules/@geoit/ui/src/lib/styles/design-tokens.scss';
|
|
15
24
|
@import 'node_modules/@geoit/ui/src/lib/styles/theme.scss';
|
|
16
25
|
```
|
|
17
26
|
|
|
18
|
-
|
|
27
|
+
Use tokens in your CSS — do not hardcode brand colors or radius:
|
|
28
|
+
|
|
29
|
+
- `var(--geo-color-primary-default)`
|
|
30
|
+
- `var(--geo-radius)` (default **6px**)
|
|
31
|
+
|
|
32
|
+
## Quick start
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import { Component } from '@angular/core';
|
|
36
|
+
import { FormsModule } from '@angular/forms';
|
|
37
|
+
import {
|
|
38
|
+
GeoButtonComponent,
|
|
39
|
+
GeoInputComponent,
|
|
40
|
+
GeoFormModalComponent,
|
|
41
|
+
GeoToastService,
|
|
42
|
+
} from '@geoit/ui';
|
|
43
|
+
|
|
44
|
+
@Component({
|
|
45
|
+
standalone: true,
|
|
46
|
+
imports: [FormsModule, GeoButtonComponent, GeoInputComponent, GeoFormModalComponent],
|
|
47
|
+
template: `
|
|
48
|
+
<geo-button appearance="primary" color="brand" icon="plus" (clicked)="open = true">
|
|
49
|
+
Thêm mới
|
|
50
|
+
</geo-button>
|
|
51
|
+
|
|
52
|
+
<geo-form-modal
|
|
53
|
+
[open]="open"
|
|
54
|
+
title="Thêm mới"
|
|
55
|
+
cancelText="Hủy bỏ"
|
|
56
|
+
okText="Lưu"
|
|
57
|
+
(openChange)="open = $event"
|
|
58
|
+
(ok)="save()"
|
|
59
|
+
>
|
|
60
|
+
<geo-input label="Tên" [required]="true" [block]="true" [(ngModel)]="name"></geo-input>
|
|
61
|
+
</geo-form-modal>
|
|
62
|
+
`,
|
|
63
|
+
})
|
|
64
|
+
export class DemoComponent {
|
|
65
|
+
open = false;
|
|
66
|
+
name = '';
|
|
67
|
+
|
|
68
|
+
constructor(private toast: GeoToastService) {}
|
|
69
|
+
|
|
70
|
+
save(): void {
|
|
71
|
+
this.toast.success('Thành công!', 'Đã lưu.');
|
|
72
|
+
this.open = false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Common components
|
|
78
|
+
|
|
79
|
+
| Need | Component | Example |
|
|
80
|
+
|------|-----------|---------|
|
|
81
|
+
| Button / CTA | `geo-button` | `<geo-button appearance="primary" color="brand">Lưu</geo-button>` |
|
|
82
|
+
| Text field | `geo-input` | `<geo-input label="Họ tên" [(ngModel)]="name" [block]="true">` |
|
|
83
|
+
| Select | `geo-select` | `<geo-select [options]="opts" [(ngModel)]="v" [block]="true">` |
|
|
84
|
+
| Checkbox | `geo-checkbox` | `<geo-checkbox label="Đồng ý" [(checked)]="ok">` |
|
|
85
|
+
| Radio | `geo-radio` | `<geo-radio [options]="opts" [(ngModel)]="v">` |
|
|
86
|
+
| Form dialog | `geo-form-modal` | See Quick start |
|
|
87
|
+
| Confirm delete | `geo-confirm-modal` | `[visible]` + `(confirm)` |
|
|
88
|
+
| Steps in dialog | `geo-form-modal` + `geo-stepper` | See recipes |
|
|
89
|
+
| Page title | `geo-page-title` | `<geo-page-title title="Chi tiết hồ sơ">` |
|
|
90
|
+
| Breadcrumb | `geo-breadcrumb` | `[items]="[{ label, link? }]"` |
|
|
91
|
+
| Toast | `GeoToastService` | `this.toast.success(title, message)` |
|
|
92
|
+
| Alert | `geo-alert` | `type="success" \| "error" \| …` |
|
|
93
|
+
| Status pill | `geo-status-tag` | `status="success" label="Đã duyệt"` |
|
|
94
|
+
| Table | `geo-table` | `[columns]` + `[data]` + paging |
|
|
95
|
+
| Upload | `geo-upload` | Drag-drop multi-file |
|
|
96
|
+
| Typography | `geo-typography` | `variant="h3" \| "body" \| …` |
|
|
97
|
+
|
|
98
|
+
### Button API (quick)
|
|
99
|
+
|
|
100
|
+
| Input | Values | Default |
|
|
101
|
+
|-------|--------|---------|
|
|
102
|
+
| `appearance` | `primary` \| `secondary` \| `tertiary` | `primary` |
|
|
103
|
+
| `color` | `brand` \| `danger` \| `warning` \| `success` | `brand` |
|
|
104
|
+
| `icon` / `iconPlacement` | Ant icon name; `start` \| `end` | `start` |
|
|
105
|
+
| `disabled` / `iconOnly` / `active` | boolean | `false` |
|
|
106
|
+
|
|
107
|
+
```html
|
|
108
|
+
<geo-button appearance="primary" color="brand" icon="plus">Thêm mới</geo-button>
|
|
109
|
+
<geo-button appearance="primary" icon="right" iconPlacement="end">Tiếp theo</geo-button>
|
|
110
|
+
<geo-button appearance="secondary" (clicked)="cancel()">Hủy</geo-button>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Form controls & `ngModel`
|
|
114
|
+
|
|
115
|
+
These implement **ControlValueAccessor** — use `[(ngModel)]` or reactive forms:
|
|
116
|
+
|
|
117
|
+
`geo-input`, `geo-textarea`, `geo-select`, `geo-radio`, `geo-date-picker`, `geo-date-range-picker`, `geo-slider`
|
|
118
|
+
|
|
119
|
+
`geo-checkbox` uses **`[(checked)]`** (not CVA).
|
|
120
|
+
|
|
121
|
+
### Toast (preferred)
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
import { GeoToastService } from '@geoit/ui';
|
|
125
|
+
|
|
126
|
+
constructor(private toast: GeoToastService) {}
|
|
127
|
+
|
|
128
|
+
this.toast.success('Thành công!', 'Đã lưu hồ sơ.');
|
|
129
|
+
this.toast.error('Lỗi!', 'Không thể lưu.');
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Full docs (shipped in the package)
|
|
19
133
|
|
|
20
|
-
After install
|
|
134
|
+
After install:
|
|
21
135
|
|
|
22
136
|
| Path | Purpose |
|
|
23
137
|
|------|---------|
|
|
24
|
-
| `node_modules/@geoit/ui/AGENTS.md` |
|
|
25
|
-
| `node_modules/@geoit/ui/ai/
|
|
138
|
+
| `node_modules/@geoit/ui/ai/AGENTS.md` | Rules for humans & AI agents |
|
|
139
|
+
| `node_modules/@geoit/ui/ai/README.md` | Component index |
|
|
26
140
|
| `node_modules/@geoit/ui/ai/catalog.json` | Machine-readable catalog |
|
|
27
|
-
| `node_modules/@geoit/ui/ai/components/*.md` | Per-component
|
|
28
|
-
| `node_modules/@geoit/ui/ai/recipes.md` | Copy-paste
|
|
141
|
+
| `node_modules/@geoit/ui/ai/components/*.md` | **Per-component API** (inputs/outputs/examples) |
|
|
142
|
+
| `node_modules/@geoit/ui/ai/recipes.md` | Copy-paste screen patterns |
|
|
143
|
+
|
|
144
|
+
Open a component doc before using it, e.g.:
|
|
145
|
+
|
|
146
|
+
```text
|
|
147
|
+
node_modules/@geoit/ui/ai/components/geo-button.md
|
|
148
|
+
node_modules/@geoit/ui/ai/components/geo-form-modal.md
|
|
149
|
+
node_modules/@geoit/ui/ai/components/geo-table.md
|
|
150
|
+
```
|
|
29
151
|
|
|
30
|
-
###
|
|
152
|
+
### Cursor rule (recommended)
|
|
31
153
|
|
|
32
|
-
|
|
154
|
+
`.cursor/rules/geo-ui.mdc` in your app:
|
|
33
155
|
|
|
34
156
|
```md
|
|
35
157
|
---
|
|
@@ -43,4 +165,18 @@ UI must use `@geoit/ui`. Before writing UI, read:
|
|
|
43
165
|
- node_modules/@geoit/ui/ai/components/<selector>.md when needed
|
|
44
166
|
```
|
|
45
167
|
|
|
46
|
-
|
|
168
|
+
## Design tokens
|
|
169
|
+
|
|
170
|
+
| Group | Examples |
|
|
171
|
+
|-------|----------|
|
|
172
|
+
| Primary | `--geo-color-primary-default` (`#9A4828`), hover, light, dark, background |
|
|
173
|
+
| Neutral | `--geo-color-neutral-900` … `100`, white |
|
|
174
|
+
| Semantic | success / error / warning / info |
|
|
175
|
+
| Radius | `--geo-radius` (6px) |
|
|
176
|
+
| Font | `--geo-font-family` |
|
|
177
|
+
|
|
178
|
+
TypeScript mirror: `geoColorTokens` from `@geoit/ui` (via styles/tokens export).
|
|
179
|
+
|
|
180
|
+
## License
|
|
181
|
+
|
|
182
|
+
Internal / project license — see repository.
|
package/ai/AGENTS.md
CHANGED
|
@@ -9,8 +9,8 @@ Instructions for AI coding agents (Cursor, Copilot, etc.) when building UI with
|
|
|
9
9
|
3. **Do not hardcode** brand colors or border-radius. Use tokens:
|
|
10
10
|
- Colors: `var(--geo-color-*)` or `geoColorTokens` from `@geoit/ui`
|
|
11
11
|
- Radius: `var(--geo-radius)` (default **6px**)
|
|
12
|
-
4. Before implementing a component, **read** `ai/components/<selector>.md` and/or `ai/catalog.json`.
|
|
13
|
-
5. Prefer **copying examples** from those docs /
|
|
12
|
+
4. Before implementing a component, **read the full doc** `ai/components/<selector>.md` (Inputs/Outputs/Examples/Tips) and/or `ai/catalog.json`.
|
|
13
|
+
5. Prefer **copying examples** from those docs — adapt labels/bindings only; do not invent props.
|
|
14
14
|
|
|
15
15
|
## Import pattern
|
|
16
16
|
|
|
@@ -80,7 +80,8 @@ See [`recipes.md`](./recipes.md) for:
|
|
|
80
80
|
## Catalog
|
|
81
81
|
|
|
82
82
|
- Index: [`README.md`](./README.md)
|
|
83
|
-
- Machine catalog: [`catalog.json`](./catalog.json)
|
|
84
|
-
- Per component: [`components/`](./components/)
|
|
83
|
+
- Machine catalog: [`catalog.json`](./catalog.json) (includes input types/defaults)
|
|
84
|
+
- Per component: [`components/`](./components/) — full Inputs/Outputs tables
|
|
85
|
+
- Recipes: [`recipes.md`](./recipes.md)
|
|
85
86
|
|
|
86
87
|
Regenerate docs: `npm run ai:docs`
|
package/ai/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Agent rules: [`AGENTS.md`](./AGENTS.md) · Recipes: [`recipes.md`](./recipes.md)
|
|
|
10
10
|
| `geo-back-button` | navigation | Back navigation control (history or custom click). | [geo-back-button.md](./components/geo-back-button.md) |
|
|
11
11
|
| `geo-breadcrumb` | navigation | Breadcrumb trail; last item active (primary). | [geo-breadcrumb.md](./components/geo-breadcrumb.md) |
|
|
12
12
|
| `geo-button` | actions | Primary action button with brand/semantic colors and icons. | [geo-button.md](./components/geo-button.md) |
|
|
13
|
-
| `geo-checkbox` | forms | Checkbox with label;
|
|
13
|
+
| `geo-checkbox` | forms | Checkbox with label; bind with [(checked)] (not CVA/ngModel). | [geo-checkbox.md](./components/geo-checkbox.md) |
|
|
14
14
|
| `geo-column-picker` | data | Column visibility picker for tables (optional persistence). | [geo-column-picker.md](./components/geo-column-picker.md) |
|
|
15
15
|
| `geo-confirm-modal` | overlay | Confirm / danger dialog (destroy actions). | [geo-confirm-modal.md](./components/geo-confirm-modal.md) |
|
|
16
16
|
| `geo-date-picker` | forms | Single date (optional time) picker. | [geo-date-picker.md](./components/geo-date-picker.md) |
|
|
@@ -39,6 +39,6 @@ Agent rules: [`AGENTS.md`](./AGENTS.md) · Recipes: [`recipes.md`](./recipes.md)
|
|
|
39
39
|
| `geo-typography` | display | Text with GEO type scale (h1–tiny) and semantic colors. | [geo-typography.md](./components/geo-typography.md) |
|
|
40
40
|
| `geo-upload` | forms | Drag-drop upload zone with progress list. | [geo-upload.md](./components/geo-upload.md) |
|
|
41
41
|
|
|
42
|
-
Generated: 2026-07-27T01:
|
|
42
|
+
Generated: 2026-07-27T01:57:41.109Z
|
|
43
43
|
|
|
44
44
|
Regenerate: `npm run ai:docs`
|