@kouji-ui/core 0.0.2 → 0.0.3
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/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +6 -0
- package/README.md +75 -43
- package/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @kouji-ui/core@0.0.
|
|
2
|
+
> @kouji-ui/core@0.0.3 build /home/runner/work/kouji-ui/kouji-ui/packages/core
|
|
3
3
|
> ng-packagr -p ng-package.json
|
|
4
4
|
|
|
5
5
|
Building Angular Package
|
|
@@ -23,5 +23,5 @@ Built Angular Package
|
|
|
23
23
|
- to: /home/runner/work/kouji-ui/kouji-ui/dist/kj-core
|
|
24
24
|
------------------------------------------------------------------------------
|
|
25
25
|
|
|
26
|
-
Build at: 2026-05-
|
|
26
|
+
Build at: 2026-05-04T21:22:08.979Z - Time: 4682ms
|
|
27
27
|
|
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,64 +1,96 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @kouji-ui/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Headless Angular 21 UI primitives — directives over CDK with WCAG 2.1 AAA semantics and zero CSS.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
You write the markup. You write the styles. The library wires up keyboard navigation, ARIA, focus management, and state.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
[Documentation](https://kouji-ui.onrender.com) · [GitHub](https://github.com/kouji-dev/kouji-ui)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
ng generate component component-name
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
ng generate --help
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Building
|
|
20
|
-
|
|
21
|
-
To build the library, run:
|
|
9
|
+
## Install
|
|
22
10
|
|
|
23
11
|
```bash
|
|
24
|
-
|
|
12
|
+
pnpm add @kouji-ui/core @angular/cdk
|
|
25
13
|
```
|
|
26
14
|
|
|
27
|
-
|
|
15
|
+
Peer dependencies: `@angular/common` `@angular/core` `@angular/cdk` — all `^21.0.0`.
|
|
28
16
|
|
|
29
|
-
|
|
17
|
+
## Quick start
|
|
30
18
|
|
|
31
|
-
|
|
19
|
+
Every primitive is a standalone directive. Import it where you use it.
|
|
32
20
|
|
|
33
|
-
|
|
21
|
+
```ts
|
|
22
|
+
import { Component } from '@angular/core';
|
|
23
|
+
import { KjButton } from '@kouji-ui/core';
|
|
34
24
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
@Component({
|
|
26
|
+
selector: 'app-example',
|
|
27
|
+
imports: [KjButton],
|
|
28
|
+
template: `<button kjButton (click)="save()">Save</button>`,
|
|
29
|
+
})
|
|
30
|
+
export class ExampleComponent {
|
|
31
|
+
save() { /* ... */ }
|
|
32
|
+
}
|
|
33
|
+
```
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
The directive owns the keyboard contract, ARIA roles, and focus ring — not the look. Style the host element however you want.
|
|
36
|
+
|
|
37
|
+
### A more involved example: dialog
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { Component } from '@angular/core';
|
|
41
|
+
import {
|
|
42
|
+
KjDialog,
|
|
43
|
+
KjDialogTrigger,
|
|
44
|
+
KjDialogOverlay,
|
|
45
|
+
KjDialogTitle,
|
|
46
|
+
KjDialogClose,
|
|
47
|
+
} from '@kouji-ui/core';
|
|
48
|
+
|
|
49
|
+
@Component({
|
|
50
|
+
selector: 'app-confirm',
|
|
51
|
+
imports: [KjDialog, KjDialogTrigger, KjDialogOverlay, KjDialogTitle, KjDialogClose],
|
|
52
|
+
template: `
|
|
53
|
+
<button [kjDialogTrigger]="confirm">Delete</button>
|
|
54
|
+
|
|
55
|
+
<ng-template #confirm>
|
|
56
|
+
<div kjDialog>
|
|
57
|
+
<div kjDialogOverlay></div>
|
|
58
|
+
<h2 kjDialogTitle>Delete this item?</h2>
|
|
59
|
+
<p>This action cannot be undone.</p>
|
|
60
|
+
<button kjDialogClose>Cancel</button>
|
|
61
|
+
<button kjDialogClose (click)="delete()">Delete</button>
|
|
62
|
+
</div>
|
|
63
|
+
</ng-template>
|
|
64
|
+
`,
|
|
65
|
+
})
|
|
66
|
+
export class ConfirmComponent {
|
|
67
|
+
delete() { /* ... */ }
|
|
68
|
+
}
|
|
69
|
+
```
|
|
43
70
|
|
|
44
|
-
|
|
71
|
+
Focus trap, Escape-to-close, scroll lock, ARIA wiring — all handled.
|
|
45
72
|
|
|
46
|
-
|
|
73
|
+
## What's included
|
|
47
74
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
75
|
+
| Domain | Primitives |
|
|
76
|
+
| --------------- | ----------------------------------------------------------- |
|
|
77
|
+
| Buttons & inputs | `KjButton`, `KjInput`, `KjCheckbox`, `KjRadio`, `KjToggle`, `KjSelect` |
|
|
78
|
+
| Form composition | `KjFormField`, `KjFormLabel`, `KjFormError` |
|
|
79
|
+
| Overlays | `KjDialog`, `KjPopover`, `KjTooltip`, `KjToast`, `KjMenu` |
|
|
80
|
+
| Navigation | `KjTabs`, `KjAccordion` |
|
|
81
|
+
| Data display | `KjTable`, `KjBadge`, `KjAvatar`, `KjChart` |
|
|
82
|
+
| A11y primitives | `KjFocusTrap`, `KjFocusRing`, `KjLiveRegion`, `KjRovingTabindex`, `KjVisuallyHidden`, `KjAriaDescribedBy` |
|
|
51
83
|
|
|
52
|
-
|
|
84
|
+
Every primitive ships with examples and an inputs reference at [kouji-ui.onrender.com](https://kouji-ui.onrender.com).
|
|
53
85
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
ng e2e
|
|
58
|
-
```
|
|
86
|
+
## Design principles
|
|
59
87
|
|
|
60
|
-
|
|
88
|
+
- **Headless** — directives, not components. You own the DOM and CSS.
|
|
89
|
+
- **WCAG 2.1 AAA target** — keyboard contracts, focus management, ARIA, and contrast all designed for AAA.
|
|
90
|
+
- **CDK-aligned** — wraps `@angular/cdk` primitives where it makes sense (overlay, focus-trap), never reimplements from scratch.
|
|
91
|
+
- **Signals-first** — public APIs use `input()` / `signal()` / `effect()`.
|
|
92
|
+
- **Zero runtime CSS** — no shipped stylesheet. Bring your own design system.
|
|
61
93
|
|
|
62
|
-
##
|
|
94
|
+
## License
|
|
63
95
|
|
|
64
|
-
|
|
96
|
+
MIT © [kouji-dev](https://github.com/kouji-dev)
|