kodeui 0.0.0-stage → 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.
Files changed (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +30 -2
  3. package/bin/kodeui.mjs +89 -0
  4. package/package.json +37 -4
  5. package/skill/kodeui/SKILL.md +105 -0
  6. package/skill/kodeui/assets/tokens.css +40 -0
  7. package/skill/kodeui/components/aurora-input/AuroraInput.tsx +153 -0
  8. package/skill/kodeui/components/aurora-input/aurora-input.css +218 -0
  9. package/skill/kodeui/components/aurora-input/index.ts +2 -0
  10. package/skill/kodeui/components/bloom-wall/BloomWall.tsx +90 -0
  11. package/skill/kodeui/components/bloom-wall/bloom-wall.css +10 -0
  12. package/skill/kodeui/components/bloom-wall/engine.ts +1022 -0
  13. package/skill/kodeui/components/bloom-wall/icons/icons-a.ts +818 -0
  14. package/skill/kodeui/components/bloom-wall/icons/icons-b.ts +827 -0
  15. package/skill/kodeui/components/bloom-wall/icons/index.ts +25 -0
  16. package/skill/kodeui/components/bloom-wall/icons/types.ts +8 -0
  17. package/skill/kodeui/components/bloom-wall/index.ts +12 -0
  18. package/skill/kodeui/components/bloom-wall/paint.ts +113 -0
  19. package/skill/kodeui/components/bloom-wall/palettes.ts +32 -0
  20. package/skill/kodeui/components/blur-in-text/BlurInText.tsx +53 -0
  21. package/skill/kodeui/components/blur-in-text/blur-in-text.css +14 -0
  22. package/skill/kodeui/components/blur-in-text/index.ts +2 -0
  23. package/skill/kodeui/components/glass-reveal/GlassReveal.tsx +108 -0
  24. package/skill/kodeui/components/glass-reveal/glass-reveal.css +126 -0
  25. package/skill/kodeui/components/glass-reveal/index.ts +2 -0
  26. package/skill/kodeui/components/glow-card/GlowCard.tsx +67 -0
  27. package/skill/kodeui/components/glow-card/glow-card.css +134 -0
  28. package/skill/kodeui/components/glow-card/index.ts +2 -0
  29. package/skill/kodeui/components/launch-chip/LaunchChip.tsx +180 -0
  30. package/skill/kodeui/components/launch-chip/icons.tsx +119 -0
  31. package/skill/kodeui/components/launch-chip/index.ts +3 -0
  32. package/skill/kodeui/components/launch-chip/launch-chip.css +345 -0
  33. package/skill/kodeui/components/ring-reveal/RingReveal.tsx +84 -0
  34. package/skill/kodeui/components/ring-reveal/index.ts +4 -0
  35. package/skill/kodeui/components/ring-reveal/ring-reveal.css +10 -0
  36. package/skill/kodeui/components/ring-reveal/ring.ts +298 -0
  37. package/skill/kodeui/components/rolling-text/RollingText.tsx +121 -0
  38. package/skill/kodeui/components/rolling-text/index.ts +4 -0
  39. package/skill/kodeui/components/rolling-text/roll.ts +94 -0
  40. package/skill/kodeui/components/rolling-text/rolling-text.css +43 -0
  41. package/skill/kodeui/components/use-live-transcript/index.ts +2 -0
  42. package/skill/kodeui/components/use-live-transcript/useLiveTranscript.ts +215 -0
  43. package/skill/kodeui/components/voice-input/VoiceInput.tsx +273 -0
  44. package/skill/kodeui/components/voice-input/icons.tsx +27 -0
  45. package/skill/kodeui/components/voice-input/index.ts +4 -0
  46. package/skill/kodeui/components/voice-input/useVoiceRecorder.ts +289 -0
  47. package/skill/kodeui/components/voice-input/voice-input.css +34 -0
  48. package/skill/kodeui/components/voice-note/VoiceNote.tsx +170 -0
  49. package/skill/kodeui/components/voice-note/index.ts +3 -0
  50. package/skill/kodeui/components/voice-note/noteFile.ts +25 -0
  51. package/skill/kodeui/components/voice-note/voice-note.css +45 -0
  52. package/skill/kodeui/references/aurora-input.md +44 -0
  53. package/skill/kodeui/references/bloom-wall.md +59 -0
  54. package/skill/kodeui/references/blur-in-text.md +17 -0
  55. package/skill/kodeui/references/frameworks.md +46 -0
  56. package/skill/kodeui/references/glass-reveal.md +40 -0
  57. package/skill/kodeui/references/glow-card.md +48 -0
  58. package/skill/kodeui/references/launch-chip.md +37 -0
  59. package/skill/kodeui/references/recipes.md +77 -0
  60. package/skill/kodeui/references/ring-reveal.md +35 -0
  61. package/skill/kodeui/references/rolling-text.md +19 -0
  62. package/skill/kodeui/references/theming.md +45 -0
  63. package/skill/kodeui/references/use-live-transcript.md +28 -0
  64. package/skill/kodeui/references/voice-input.md +60 -0
  65. package/skill/kodeui/references/voice-note.md +22 -0
  66. package/skill/kodeui/scripts/add.mjs +192 -0
  67. package/skill/kodeui/scripts/manifest.json +92 -0
@@ -0,0 +1,218 @@
1
+ /*
2
+ * KodeUI Aurora Input
3
+ * A prompt box with a 1 px aurora light on its border and a blurred copy of it behind.
4
+ * The light holds still, then slides a quarter turn, again and again: with the default
5
+ * 3 s step it holds 2.2 s and moves 0.8 s, a full turn every 12 s.
6
+ * Both layers run the same animation from the same moment, so they always agree.
7
+ */
8
+ @property --ku-aurora-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
9
+
10
+ .ku-aurora-input {
11
+ --ku-ai-rest: var(--ku-aurora-input-neutral, var(--ku-surface, #131e18));
12
+ --ku-ai-stops: var(--ku-aurora-stops,
13
+ var(--ku-ai-rest) 0deg, var(--ku-ai-rest) 69deg,
14
+ color-mix(in srgb, var(--ku-seaglass, #3cd6c4) 55%, transparent) 115deg,
15
+ color-mix(in srgb, var(--ku-fern, #5ee08a) 50%, transparent) 193deg,
16
+ var(--ku-ai-rest) 270deg,
17
+ color-mix(in srgb, var(--ku-aurora, #9d8bf7) 50%, transparent) 291deg,
18
+ color-mix(in srgb, var(--ku-bloom, #ff8fc8) 50%, transparent) 322deg,
19
+ var(--ku-ai-rest) 1turn);
20
+
21
+ position: relative;
22
+ isolation: isolate;
23
+ box-sizing: border-box;
24
+ width: 100%;
25
+ padding: 1px;
26
+ border-radius: 24px;
27
+ color: var(--ku-text, #e8f1eb);
28
+ box-shadow: 0 3px 3px -1.5px rgba(4, 10, 7, .04), 0 8px 8px -4px rgba(4, 10, 7, .03), 0 20px 24px -4px rgba(4, 10, 7, .08);
29
+ }
30
+
31
+ .ku-aurora-input::before,
32
+ .ku-aurora-input::after {
33
+ content: '';
34
+ position: absolute;
35
+ inset: 0;
36
+ border-radius: inherit;
37
+ pointer-events: none;
38
+ background: conic-gradient(from var(--ku-aurora-angle, 0deg) at 50% 50%, var(--ku-ai-stops));
39
+ }
40
+ /* the ring: the gradient cut down to its 1 px edge */
41
+ .ku-aurora-input::before {
42
+ padding: 1px;
43
+ opacity: 1;
44
+ -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
45
+ -webkit-mask-composite: xor;
46
+ mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
47
+ }
48
+ /* the glow behind it */
49
+ .ku-aurora-input::after {
50
+ z-index: -1;
51
+ filter: blur(14px);
52
+ opacity: .4;
53
+ }
54
+
55
+ @media (prefers-reduced-motion: no-preference) {
56
+ .ku-aurora-input::before,
57
+ .ku-aurora-input::after {
58
+ animation: ku-aurora-step calc(var(--ku-aurora-step, 3s) * 4) linear infinite;
59
+ }
60
+ }
61
+ /* four quarter turns; each holds 2.2/3 of its step, then glides the rest */
62
+ @keyframes ku-aurora-step {
63
+ 0% { --ku-aurora-angle: 0deg; }
64
+ 18.333% { --ku-aurora-angle: 0deg; animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
65
+ 25% { --ku-aurora-angle: 90deg; }
66
+ 43.333% { --ku-aurora-angle: 90deg; animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
67
+ 50% { --ku-aurora-angle: 180deg; }
68
+ 68.333% { --ku-aurora-angle: 180deg; animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
69
+ 75% { --ku-aurora-angle: 270deg; }
70
+ 93.333% { --ku-aurora-angle: 270deg; animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
71
+ 100% { --ku-aurora-angle: 360deg; }
72
+ }
73
+
74
+ .ku-aurora-input__box {
75
+ position: relative;
76
+ z-index: 1;
77
+ box-sizing: border-box;
78
+ display: flex;
79
+ flex-direction: column;
80
+ gap: 20px;
81
+ min-height: 140px;
82
+ padding: 20px 16px;
83
+ border-radius: 24px;
84
+ background-color: var(--ku-aurora-input-bg, var(--ku-surface, #131e18));
85
+ -webkit-backdrop-filter: blur(0) saturate(100%) brightness(100%);
86
+ backdrop-filter: blur(0) saturate(100%) brightness(100%);
87
+ box-shadow:
88
+ inset 0 0 0 1px rgba(255, 255, 255, 0), inset 0 1px 0 rgba(255, 255, 255, 0), inset 1px 0 0 rgba(255, 255, 255, 0),
89
+ inset 24px 52px 64px -32px rgba(255, 255, 255, 0), inset 0 -1px 0 transparent;
90
+ }
91
+ .ku-aurora-input__box > :not(.ku-aurora-input__overlay) { position: relative; z-index: 1; }
92
+
93
+ /* behind the text, over the box background, clipped to the box */
94
+ .ku-aurora-input__overlay {
95
+ position: absolute;
96
+ inset: 0;
97
+ z-index: 0;
98
+ overflow: hidden;
99
+ border-radius: inherit;
100
+ pointer-events: none;
101
+ }
102
+
103
+ .ku-aurora-input__field {
104
+ flex: 1;
105
+ box-sizing: border-box;
106
+ min-height: 40px;
107
+ margin: 0;
108
+ padding: 0;
109
+ border: 0;
110
+ outline: 0;
111
+ resize: none;
112
+ background: transparent;
113
+ color: var(--ku-text, #e8f1eb);
114
+ font-family: inherit;
115
+ font-size: 14px;
116
+ font-weight: 400;
117
+ line-height: 20px;
118
+ caret-color: currentColor;
119
+ }
120
+ .ku-aurora-input__field::placeholder { color: var(--ku-text-2, #a2b6aa); opacity: 1; }
121
+ .ku-aurora-input__field:disabled { cursor: default; }
122
+
123
+ .ku-aurora-input__actions { display: flex; align-items: center; gap: 8px; }
124
+ .ku-aurora-input__grow { flex: 1; }
125
+
126
+ /* buttons for the action rows */
127
+ .ku-aurora-input__action {
128
+ box-sizing: border-box;
129
+ height: 36px;
130
+ padding: 0 14px;
131
+ display: inline-flex;
132
+ align-items: center;
133
+ gap: 6px;
134
+ border-radius: 9999px;
135
+ border: 1px solid var(--ku-outline, #24342c);
136
+ background-color: var(--ku-surface-highest, #213029);
137
+ color: inherit;
138
+ font: inherit;
139
+ font-weight: 500;
140
+ white-space: nowrap;
141
+ cursor: pointer;
142
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0), inset 0 -1px 0 transparent;
143
+ }
144
+ .ku-aurora-input__action--round { width: 36px; padding: 0; justify-content: center; background-color: transparent; }
145
+ .ku-aurora-input__action svg { width: 16px; height: 16px; flex: none; }
146
+ .ku-aurora-input__action:disabled { opacity: .5; cursor: default; }
147
+ .ku-aurora-input__action:focus { outline: none; }
148
+ .ku-aurora-input__action:focus-visible { outline: 2px solid var(--ku-fern, #5ee08a); outline-offset: 2px; }
149
+
150
+ @media (max-width: 760px) {
151
+ .ku-aurora-input__actions { flex-wrap: wrap; row-gap: 8px; }
152
+ }
153
+
154
+ /*
155
+ * Inside a Glass Reveal (or anything with data-glass): the box turns to frosted glass on
156
+ * the third stagger slot and the aurora fades away; leaving, the aurora comes back late and slow.
157
+ */
158
+ [data-glass='active'] .ku-aurora-input,
159
+ [data-glass='fading'] .ku-aurora-input {
160
+ transition:
161
+ box-shadow var(--ku-glass-t3, .52s) var(--ku-glass-ease, cubic-bezier(.22, 1, .36, 1)),
162
+ color var(--ku-glass-prompt-ink-dur, .42s) var(--ku-glass-ease, cubic-bezier(.22, 1, .36, 1)) var(--ku-glass-prompt-ink-delay, 0s);
163
+ }
164
+ [data-glass='active'] .ku-aurora-input::before,
165
+ [data-glass='active'] .ku-aurora-input::after,
166
+ [data-glass='fading'] .ku-aurora-input::before,
167
+ [data-glass='fading'] .ku-aurora-input::after {
168
+ transition: opacity var(--ku-glass-halo-dur, .45s) var(--ku-glass-ease, cubic-bezier(.22, 1, .36, 1)) var(--ku-glass-halo-delay, 0s);
169
+ }
170
+ [data-glass='active'] .ku-aurora-input__box,
171
+ [data-glass='fading'] .ku-aurora-input__box {
172
+ transition:
173
+ background-color var(--ku-glass-t3, .52s) var(--ku-glass-ease, cubic-bezier(.22, 1, .36, 1)),
174
+ box-shadow var(--ku-glass-t3, .52s) var(--ku-glass-ease, cubic-bezier(.22, 1, .36, 1)),
175
+ backdrop-filter var(--ku-glass-t3, .52s) var(--ku-glass-ease, cubic-bezier(.22, 1, .36, 1)),
176
+ -webkit-backdrop-filter var(--ku-glass-t3, .52s) var(--ku-glass-ease, cubic-bezier(.22, 1, .36, 1));
177
+ }
178
+ [data-glass='active'] .ku-aurora-input__field,
179
+ [data-glass='fading'] .ku-aurora-input__field,
180
+ [data-glass='active'] .ku-aurora-input__field::placeholder,
181
+ [data-glass='fading'] .ku-aurora-input__field::placeholder {
182
+ transition: color var(--ku-glass-prompt-ink-dur, .42s) var(--ku-glass-ease, cubic-bezier(.22, 1, .36, 1)) var(--ku-glass-prompt-ink-delay, 0s);
183
+ }
184
+ [data-glass='active'] .ku-aurora-input__action,
185
+ [data-glass='fading'] .ku-aurora-input__action {
186
+ transition:
187
+ background-color var(--ku-glass-t3, .52s) var(--ku-glass-ease, cubic-bezier(.22, 1, .36, 1)),
188
+ border-color var(--ku-glass-t3, .52s) var(--ku-glass-ease, cubic-bezier(.22, 1, .36, 1)),
189
+ box-shadow var(--ku-glass-t3, .52s) var(--ku-glass-ease, cubic-bezier(.22, 1, .36, 1)),
190
+ color var(--ku-glass-prompt-ink-dur, .42s) var(--ku-glass-ease, cubic-bezier(.22, 1, .36, 1)) var(--ku-glass-prompt-ink-delay, 0s);
191
+ }
192
+
193
+ [data-glass='active'] .ku-aurora-input {
194
+ color: #f4f8f5;
195
+ box-shadow: 0 3px 6px -1.5px rgba(0, 0, 0, .24), 0 8px 16px -4px rgba(0, 0, 0, .32), 0 24px 56px -12px rgba(0, 0, 0, .62);
196
+ }
197
+ [data-glass='active'] .ku-aurora-input::before,
198
+ [data-glass='active'] .ku-aurora-input::after { opacity: 0; }
199
+ [data-glass='active'] .ku-aurora-input__box {
200
+ -webkit-backdrop-filter: blur(28px) saturate(140%) brightness(118%);
201
+ backdrop-filter: blur(28px) saturate(140%) brightness(118%);
202
+ background-color: rgba(62, 82, 72, .58);
203
+ box-shadow:
204
+ inset 0 0 0 1px rgba(255, 255, 255, .11), inset 0 1px 0 rgba(255, 255, 255, .34), inset 1px 0 0 rgba(255, 255, 255, .06),
205
+ inset 24px 52px 64px -32px rgba(255, 255, 255, .18), inset 0 -1px 0 rgba(0, 0, 0, .28);
206
+ }
207
+ [data-glass='active'] .ku-aurora-input__field { caret-color: #9ff7e6; color: #fff; }
208
+ [data-glass='active'] .ku-aurora-input__field::placeholder { color: rgba(234, 242, 237, .82); }
209
+ [data-glass='active'] .ku-aurora-input__action {
210
+ background-color: rgba(255, 255, 255, .12);
211
+ border-color: rgba(255, 255, 255, .09);
212
+ color: #fff;
213
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(0, 0, 0, .24);
214
+ }
215
+ [data-glass='active'] .ku-aurora-input__action:hover:not(:disabled) {
216
+ background-color: rgba(255, 255, 255, .2);
217
+ border-color: rgba(255, 255, 255, .18);
218
+ }
@@ -0,0 +1,2 @@
1
+ export { AuroraInput, AuroraInputAction, auroraStops } from './AuroraInput';
2
+ export type { AuroraInputProps, AuroraInputActionProps } from './AuroraInput';
@@ -0,0 +1,90 @@
1
+ import { forwardRef, useEffect, useImperativeHandle, useRef, type CSSProperties, type RefObject } from 'react';
2
+ import { BloomEngine } from './engine';
3
+ import { NATURE_PALETTES, type Palette } from './palettes';
4
+ import './bloom-wall.css';
5
+
6
+ export type BloomOrigin = RefObject<HTMLElement | null> | (() => { x: number; y: number });
7
+
8
+ export interface BloomWallProps {
9
+ /** true = grow out of the origin and breathe; false = fold back in */
10
+ active: boolean;
11
+ /** ref: the element's centre; function: a point in the wall's own px. Default: the wall's centre */
12
+ origin?: BloomOrigin;
13
+ /** the quick fold used after a click */
14
+ fastFade?: boolean;
15
+ /** 1 = real time, 0.25 = slow motion */
16
+ timeScale?: number;
17
+ palettes?: readonly Palette[];
18
+ className?: string;
19
+ style?: CSSProperties;
20
+ /** called when a fold has finished and the canvas is clear */
21
+ onIdle?: () => void;
22
+ }
23
+
24
+ export interface BloomWallHandle {
25
+ readonly engine: BloomEngine | null;
26
+ }
27
+
28
+ /** Where the ring starts, in the canvas's own CSS px. */
29
+ export function resolveOrigin(origin: BloomOrigin | undefined, canvas: HTMLCanvasElement): { x: number; y: number } {
30
+ if (typeof origin === 'function') return origin();
31
+ const box = canvas.getBoundingClientRect();
32
+ const el = origin ? origin.current : null;
33
+ if (el) {
34
+ const r = el.getBoundingClientRect();
35
+ return { x: r.left + r.width / 2 - box.left, y: r.top + r.height / 2 - box.top };
36
+ }
37
+ return { x: box.width / 2, y: box.height / 2 };
38
+ }
39
+
40
+ const FILL: CSSProperties = { position: 'absolute', inset: 0, width: '100%', height: '100%', pointerEvents: 'none' };
41
+
42
+ /**
43
+ * A wall of glowing nature tiles that grows out of a point when `active` turns on,
44
+ * breathes while it stays on, and folds back in when it turns off.
45
+ * Put it inside a positioned element, under your content.
46
+ */
47
+ export const BloomWall = forwardRef<BloomWallHandle, BloomWallProps>(function BloomWall(
48
+ { active, origin, fastFade = false, timeScale = 1, palettes = NATURE_PALETTES, className, style, onIdle },
49
+ ref,
50
+ ) {
51
+ const canvasRef = useRef<HTMLCanvasElement>(null);
52
+ const engineRef = useRef<BloomEngine | null>(null);
53
+ const originRef = useRef(origin);
54
+ originRef.current = origin;
55
+ const onIdleRef = useRef(onIdle);
56
+ onIdleRef.current = onIdle;
57
+ const firstPalettes = useRef(palettes);
58
+
59
+ useImperativeHandle(ref, () => ({ get engine() { return engineRef.current; } }), []);
60
+
61
+ useEffect(() => {
62
+ const canvas = canvasRef.current;
63
+ if (!canvas) return;
64
+ const engine = new BloomEngine(canvas, {
65
+ origin: () => resolveOrigin(originRef.current, canvas),
66
+ palettes: firstPalettes.current,
67
+ onIdle: () => onIdleRef.current?.(),
68
+ });
69
+ engineRef.current = engine;
70
+ return () => {
71
+ engine.destroy();
72
+ if (engineRef.current === engine) engineRef.current = null;
73
+ };
74
+ }, []);
75
+
76
+ // order matters: speed and fold style are set before the state changes
77
+ useEffect(() => { engineRef.current?.setPalettes(palettes); }, [palettes]);
78
+ useEffect(() => { if (engineRef.current) engineRef.current.timeScale = timeScale > 0 ? timeScale : 1; }, [timeScale]);
79
+ useEffect(() => { engineRef.current?.setFastFade(fastFade); }, [fastFade]);
80
+ useEffect(() => { engineRef.current?.setActive(active); }, [active]);
81
+
82
+ return (
83
+ <canvas
84
+ ref={canvasRef}
85
+ className={'ku-bloom-wall' + (className ? ' ' + className : '')}
86
+ style={style ? { ...FILL, ...style } : FILL}
87
+ aria-hidden="true"
88
+ />
89
+ );
90
+ });
@@ -0,0 +1,10 @@
1
+ /* Bloom Wall: one canvas that fills its positioned parent, under the content. */
2
+ .ku-bloom-wall {
3
+ position: absolute;
4
+ inset: 0;
5
+ display: block;
6
+ width: 100%;
7
+ height: 100%;
8
+ pointer-events: none;
9
+ border-radius: inherit;
10
+ }