@kouji-ui/core 0.1.5 → 0.3.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.
@@ -0,0 +1,90 @@
1
+ /* ─────────────────────────────────────────────────────────────
2
+ @kouji-ui/core — motion preset library
3
+ Named, composable entrance/exit animations applied via the
4
+ `kjMotion` directive (or a bare `.kj-motion[data-kj-motion]`
5
+ element). Reduced-motion aware: every preset collapses to a
6
+ ~1ms opacity fade with no transform under
7
+ `prefers-reduced-motion: reduce` (WCAG 2.1 AAA 2.3.3).
8
+
9
+ Timing/easing/distance are read from `--kj-motion-*` custom
10
+ properties (themeable via @kouji-ui/themes) with inline
11
+ fallbacks so this file also works standalone.
12
+ ──────────────────────────────────────────────────────────── */
13
+
14
+ @layer kj.component {
15
+ .kj-motion {
16
+ --_kj-motion-duration: var(--kj-motion-duration-md, 250ms);
17
+ --_kj-motion-ease: var(--kj-motion-ease, cubic-bezier(0.16, 1, 0.3, 1));
18
+ --_kj-motion-ease-in: var(--kj-motion-ease-in, cubic-bezier(0.7, 0, 0.84, 0));
19
+ --_kj-motion-ease-spring: var(--kj-motion-ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1));
20
+ --_kj-motion-distance: var(--kj-motion-distance, 0.5rem);
21
+
22
+ animation-duration: var(--_kj-motion-duration);
23
+ animation-timing-function: var(--_kj-motion-ease);
24
+ animation-fill-mode: both;
25
+ }
26
+
27
+ /* Exit keyframes ease "in" (accelerate away). */
28
+ .kj-motion[data-kj-motion-state="exit"] {
29
+ animation-timing-function: var(--_kj-motion-ease-in);
30
+ }
31
+
32
+ /* ── fade ─────────────────────────────────────────────── */
33
+ .kj-motion[data-kj-motion="fade"][data-kj-motion-state="enter"] { animation-name: kj-fade-in; }
34
+ .kj-motion[data-kj-motion="fade"][data-kj-motion-state="exit"] { animation-name: kj-fade-out; }
35
+
36
+ /* ── slide-up / down / left / right (transform only) ──── */
37
+ .kj-motion[data-kj-motion="slide-up"][data-kj-motion-state="enter"] { animation-name: kj-slide-up-in; }
38
+ .kj-motion[data-kj-motion="slide-up"][data-kj-motion-state="exit"] { animation-name: kj-slide-up-out; }
39
+ .kj-motion[data-kj-motion="slide-down"][data-kj-motion-state="enter"] { animation-name: kj-slide-down-in; }
40
+ .kj-motion[data-kj-motion="slide-down"][data-kj-motion-state="exit"] { animation-name: kj-slide-down-out; }
41
+ .kj-motion[data-kj-motion="slide-left"][data-kj-motion-state="enter"] { animation-name: kj-slide-left-in; }
42
+ .kj-motion[data-kj-motion="slide-left"][data-kj-motion-state="exit"] { animation-name: kj-slide-left-out; }
43
+ .kj-motion[data-kj-motion="slide-right"][data-kj-motion-state="enter"] { animation-name: kj-slide-right-in; }
44
+ .kj-motion[data-kj-motion="slide-right"][data-kj-motion-state="exit"] { animation-name: kj-slide-right-out; }
45
+
46
+ /* ── scale ────────────────────────────────────────────── */
47
+ .kj-motion[data-kj-motion="scale"][data-kj-motion-state="enter"] { animation-name: kj-scale-in; }
48
+ .kj-motion[data-kj-motion="scale"][data-kj-motion-state="exit"] { animation-name: kj-scale-out; }
49
+
50
+ /* ── slide-up-fade (composed: transform + opacity) ────── */
51
+ .kj-motion[data-kj-motion="slide-up-fade"][data-kj-motion-state="enter"] { animation-name: kj-slide-up-fade-in; }
52
+ .kj-motion[data-kj-motion="slide-up-fade"][data-kj-motion-state="exit"] { animation-name: kj-slide-up-fade-out; }
53
+
54
+ /* ── scale-spring (springy easing) ────────────────────── */
55
+ .kj-motion[data-kj-motion="scale-spring"] { animation-timing-function: var(--_kj-motion-ease-spring); }
56
+ .kj-motion[data-kj-motion="scale-spring"][data-kj-motion-state="enter"] { animation-name: kj-scale-in; }
57
+ .kj-motion[data-kj-motion="scale-spring"][data-kj-motion-state="exit"] { animation-name: kj-scale-out; }
58
+
59
+ /* ── keyframes ────────────────────────────────────────── */
60
+ @keyframes kj-fade-in { from { opacity: 0; } to { opacity: 1; } }
61
+ @keyframes kj-fade-out { from { opacity: 1; } to { opacity: 0; } }
62
+
63
+ @keyframes kj-slide-up-in { from { transform: translateY(var(--_kj-motion-distance)); } to { transform: translateY(0); } }
64
+ @keyframes kj-slide-up-out { from { transform: translateY(0); } to { transform: translateY(calc(-1 * var(--_kj-motion-distance))); } }
65
+ @keyframes kj-slide-down-in { from { transform: translateY(calc(-1 * var(--_kj-motion-distance))); } to { transform: translateY(0); } }
66
+ @keyframes kj-slide-down-out { from { transform: translateY(0); } to { transform: translateY(var(--_kj-motion-distance)); } }
67
+ @keyframes kj-slide-left-in { from { transform: translateX(var(--_kj-motion-distance)); } to { transform: translateX(0); } }
68
+ @keyframes kj-slide-left-out { from { transform: translateX(0); } to { transform: translateX(calc(-1 * var(--_kj-motion-distance))); } }
69
+ @keyframes kj-slide-right-in { from { transform: translateX(calc(-1 * var(--_kj-motion-distance))); } to { transform: translateX(0); } }
70
+ @keyframes kj-slide-right-out { from { transform: translateX(0); } to { transform: translateX(var(--_kj-motion-distance)); } }
71
+
72
+ @keyframes kj-scale-in { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
73
+ @keyframes kj-scale-out { from { transform: scale(1); opacity: 1; } to { transform: scale(0.92); opacity: 0; } }
74
+
75
+ @keyframes kj-slide-up-fade-in { from { transform: translateY(var(--_kj-motion-distance)); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
76
+ @keyframes kj-slide-up-fade-out { from { transform: translateY(0); opacity: 1; } to { transform: translateY(calc(-1 * var(--_kj-motion-distance))); opacity: 0; } }
77
+
78
+ /* ── reduced motion: strip movement, keep appearance ──────
79
+ Every preset collapses to a near-instant opacity fade. The 1ms
80
+ duration keeps `animationend` firing so state machines that await
81
+ it don't hang. WCAG 2.1 AAA 2.3.3 (Animation from Interactions). */
82
+ @media (prefers-reduced-motion: reduce) {
83
+ .kj-motion {
84
+ animation-duration: 1ms !important;
85
+ animation-timing-function: linear !important;
86
+ }
87
+ .kj-motion[data-kj-motion-state="enter"] { animation-name: kj-fade-in !important; }
88
+ .kj-motion[data-kj-motion-state="exit"] { animation-name: kj-fade-out !important; }
89
+ }
90
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kouji-ui/core",
3
- "version": "0.1.5",
3
+ "version": "0.3.0",
4
4
  "description": "Headless Angular 21 UI primitives — directives over CDK with WCAG 2.1 AAA semantics and zero CSS.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -32,7 +32,18 @@
32
32
  "@angular/cdk": "^22.0.0",
33
33
  "@angular/forms": "^22.0.0",
34
34
  "rxjs": "^7.8.0",
35
- "echarts": "^6.0.0"
35
+ "echarts": "^6.0.0",
36
+ "lexical": "^0.38.0",
37
+ "@lexical/rich-text": "^0.38.0",
38
+ "@lexical/list": "^0.38.0",
39
+ "@lexical/link": "^0.38.0",
40
+ "@lexical/history": "^0.38.0",
41
+ "@lexical/markdown": "^0.38.0",
42
+ "@lexical/code": "^0.38.0",
43
+ "@lexical/html": "^0.38.0",
44
+ "@lexical/selection": "^0.38.0",
45
+ "monaco-editor": "^0.55.0",
46
+ "@monaco-editor/loader": "^1.7.0"
36
47
  },
37
48
  "sideEffects": false,
38
49
  "type": "module",
@@ -47,6 +58,10 @@
47
58
  "style": "./typography/prose.css",
48
59
  "default": "./typography/prose.css"
49
60
  },
61
+ "./motion/motion.css": {
62
+ "style": "./motion/motion.css",
63
+ "default": "./motion/motion.css"
64
+ },
50
65
  "./package.json": {
51
66
  "default": "./package.json"
52
67
  },
@@ -58,6 +73,39 @@
58
73
  "peerDependenciesMeta": {
59
74
  "echarts": {
60
75
  "optional": true
76
+ },
77
+ "lexical": {
78
+ "optional": true
79
+ },
80
+ "@lexical/rich-text": {
81
+ "optional": true
82
+ },
83
+ "@lexical/list": {
84
+ "optional": true
85
+ },
86
+ "@lexical/link": {
87
+ "optional": true
88
+ },
89
+ "@lexical/history": {
90
+ "optional": true
91
+ },
92
+ "@lexical/markdown": {
93
+ "optional": true
94
+ },
95
+ "@lexical/code": {
96
+ "optional": true
97
+ },
98
+ "@lexical/html": {
99
+ "optional": true
100
+ },
101
+ "@lexical/selection": {
102
+ "optional": true
103
+ },
104
+ "monaco-editor": {
105
+ "optional": true
106
+ },
107
+ "@monaco-editor/loader": {
108
+ "optional": true
61
109
  }
62
110
  },
63
111
  "dependencies": {