@pepperhorn/chordl-react 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,610 @@
1
+ import { autoFingering } from '@pepperhorn/chordl-core';
2
+ import { autoSelectVoicing } from '@pepperhorn/chordl-voicings';
3
+ import { BLACK_KEY_HEIGHT_COMPACT } from '@pepperhorn/chordl-core';
4
+ import { BLACK_KEY_HEIGHT_EXACT } from '@pepperhorn/chordl-core';
5
+ import { BLACK_KEY_OFFSETS } from '@pepperhorn/chordl-core';
6
+ import { BLACK_KEY_OFFSETS_EXACT } from '@pepperhorn/chordl-core';
7
+ import { BLACK_KEY_RY } from '@pepperhorn/chordl-core';
8
+ import { BLACK_KEY_WIDTH } from '@pepperhorn/chordl-core';
9
+ import { BLACK_KEY_WIDTH_EXACT } from '@pepperhorn/chordl-core';
10
+ import { BRAVURA_GLYPHS } from '@pepperhorn/chordl-core';
11
+ import { calculateLayout } from '@pepperhorn/chordl-core';
12
+ import { CHORD_SHEET_SCHEMA_VERSION } from '@pepperhorn/chordl-core';
13
+ import { ChordData } from '@pepperhorn/chordl-core';
14
+ import { ChordDescriptor } from '@pepperhorn/chordl-voicings';
15
+ import { ChordLogEntry } from '@pepperhorn/chordl-core';
16
+ import { chordRef } from '@pepperhorn/chordl-core';
17
+ import { ChordRequest } from '@pepperhorn/chordl-core';
18
+ import { ChordResult } from '@pepperhorn/chordl-core';
19
+ import { ChordSheetData } from '@pepperhorn/chordl-core';
20
+ import { ColorTheme } from '@pepperhorn/chordl-core';
21
+ import { computeKeyboard } from '@pepperhorn/chordl-core';
22
+ import { computeStaffLayout } from '@pepperhorn/chordl-core';
23
+ import { computeSvgDimensions } from '@pepperhorn/chordl-core';
24
+ import { CSSProperties } from 'react';
25
+ import { decodeChordSheet } from '@pepperhorn/chordl-core';
26
+ import { DEFAULT_BLACK_FILL } from '@pepperhorn/chordl-core';
27
+ import { DEFAULT_STROKE } from '@pepperhorn/chordl-core';
28
+ import { DEFAULT_STROKE_WIDTH } from '@pepperhorn/chordl-core';
29
+ import { DEFAULT_WHITE_FILL } from '@pepperhorn/chordl-core';
30
+ import { DisplayDefaults } from '@pepperhorn/chordl-core';
31
+ import { DisplayMode } from '@pepperhorn/chordl-core';
32
+ import { downloadMidi } from '@pepperhorn/chordl-core';
33
+ import { ENABLE_CHORD_LOGGING } from '@pepperhorn/chordl-core';
34
+ import { encodeChordSheet } from '@pepperhorn/chordl-core';
35
+ import { findTemplate } from '@pepperhorn/chordl-core';
36
+ import { findVoicing } from '@pepperhorn/chordl-voicings';
37
+ import { FLAT_TO_SHARP } from '@pepperhorn/chordl-core';
38
+ import { FORM_TEMPLATES } from '@pepperhorn/chordl-core';
39
+ import { Format } from '@pepperhorn/chordl-core';
40
+ import { FormTemplate } from '@pepperhorn/chordl-core';
41
+ import { generateLockedHands } from '@pepperhorn/chordl-voicings';
42
+ import { generateMidiFile } from '@pepperhorn/chordl-core';
43
+ import { getAlternativeVoicings } from '@pepperhorn/chordl-voicings';
44
+ import { getDefaultGlyphs } from '@pepperhorn/chordl-core';
45
+ import { getTheme } from '@pepperhorn/chordl-core';
46
+ import { Hand } from '@pepperhorn/chordl-voicings';
47
+ import { HandBracket } from '@pepperhorn/chordl-core';
48
+ import { inferStyle } from '@pepperhorn/chordl-voicings';
49
+ import { isProgressionRequest } from '@pepperhorn/chordl-core';
50
+ import { JSX } from 'react/jsx-runtime';
51
+ import { KeyDescriptor } from '@pepperhorn/chordl-core';
52
+ import { LayoutOptions } from '@pepperhorn/chordl-core';
53
+ import { LayoutResult } from '@pepperhorn/chordl-core';
54
+ import { LOG_SCHEMA_VERSION } from '@pepperhorn/chordl-core';
55
+ import { logChordRequest } from '@pepperhorn/chordl-core';
56
+ import { LogConfig } from '@pepperhorn/chordl-core';
57
+ import { mapHighlights } from '@pepperhorn/chordl-core';
58
+ import { mapToVoicingQuality } from '@pepperhorn/chordl-voicings';
59
+ import { MAX_EXAMPLES } from '@pepperhorn/chordl-core';
60
+ import { normalizeNote } from '@pepperhorn/chordl-core';
61
+ import { NoteName } from '@pepperhorn/chordl-core';
62
+ import { NoteNameMode } from '@pepperhorn/chordl-core';
63
+ import { parseChordDescription } from '@pepperhorn/chordl-core';
64
+ import { ParsedChordRequest } from '@pepperhorn/chordl-core';
65
+ import { ParsedProgressionRequest } from '@pepperhorn/chordl-core';
66
+ import { parseProgressionRequest } from '@pepperhorn/chordl-core';
67
+ import { PETALUMA_GLYPHS } from '@pepperhorn/chordl-core';
68
+ import { processChordRequest } from '@pepperhorn/chordl-core';
69
+ import { ProgressionChord } from '@pepperhorn/chordl-core';
70
+ import { ProgressionExample } from '@pepperhorn/chordl-core';
71
+ import { ProgressionRequest } from '@pepperhorn/chordl-core';
72
+ import { ProgressionResult } from '@pepperhorn/chordl-core';
73
+ import { Provider } from 'react';
74
+ import { queryVoicings } from '@pepperhorn/chordl-voicings';
75
+ import { ReactNode } from 'react';
76
+ import { RealizedNote } from '@pepperhorn/chordl-voicings';
77
+ import { realizeVoicing } from '@pepperhorn/chordl-voicings';
78
+ import { realizeVoicingFull } from '@pepperhorn/chordl-voicings';
79
+ import { resolveChord } from '@pepperhorn/chordl-core';
80
+ import { ResolvedChord } from '@pepperhorn/chordl-core';
81
+ import { resolveDefaults } from '@pepperhorn/chordl-core';
82
+ import { resolveProgression } from '@pepperhorn/chordl-core';
83
+ import { resolveProgressionRequest } from '@pepperhorn/chordl-core';
84
+ import { resolveTheme } from '@pepperhorn/chordl-core';
85
+ import { SectionData } from '@pepperhorn/chordl-core';
86
+ import { selectByRange } from '@pepperhorn/chordl-voicings';
87
+ import { setDefaultGlyphs } from '@pepperhorn/chordl-core';
88
+ import { solvePolychord } from '@pepperhorn/chordl-voicings';
89
+ import { solveSlashChord } from '@pepperhorn/chordl-voicings';
90
+ import { StaffGlyphSet } from '@pepperhorn/chordl-core';
91
+ import { StaffLayoutOptions } from '@pepperhorn/chordl-core';
92
+ import { StaffLayoutResult } from '@pepperhorn/chordl-core';
93
+ import { StaffNote } from '@pepperhorn/chordl-core';
94
+ import { SYSTEM_DEFAULTS } from '@pepperhorn/chordl-core';
95
+ import { TextSize } from '@pepperhorn/chordl-core';
96
+ import { tokenizeProgression } from '@pepperhorn/chordl-core';
97
+ import { validateVersion } from '@pepperhorn/chordl-core';
98
+ import { VOICING_LIBRARY } from '@pepperhorn/chordl-voicings';
99
+ import { VoicingEntry } from '@pepperhorn/chordl-voicings';
100
+ import { VoicingEra } from '@pepperhorn/chordl-voicings';
101
+ import { voicingPitchClasses } from '@pepperhorn/chordl-voicings';
102
+ import { VoicingQuality } from '@pepperhorn/chordl-voicings';
103
+ import { VoicingQuery } from '@pepperhorn/chordl-voicings';
104
+ import { VoicingStyle } from '@pepperhorn/chordl-voicings';
105
+ import { WHITE_KEY_HEIGHT_COMPACT } from '@pepperhorn/chordl-core';
106
+ import { WHITE_KEY_HEIGHT_EXACT } from '@pepperhorn/chordl-core';
107
+ import { WHITE_KEY_RY } from '@pepperhorn/chordl-core';
108
+ import { WHITE_KEY_WIDTH } from '@pepperhorn/chordl-core';
109
+ import { WHITE_KEY_WIDTH_EXACT } from '@pepperhorn/chordl-core';
110
+ import { WHITE_NOTE_ORDER } from '@pepperhorn/chordl-core';
111
+ import { WHITE_NOTES_WITH_SHARPS } from '@pepperhorn/chordl-core';
112
+ import { WhiteNote } from '@pepperhorn/chordl-core';
113
+
114
+ /** Arpeggiation tempo (quarter note = BPM). Each note triggers on a 16th-note grid. */
115
+ export declare const ARPEGGIO_BPM = 120;
116
+
117
+ /** Compute the ms delay between arpeggiated notes from BPM (16th-note subdivision). */
118
+ export declare function arpeggioDelayMs(bpm?: number): number;
119
+
120
+ export { autoFingering }
121
+
122
+ export { autoSelectVoicing }
123
+
124
+ export { BLACK_KEY_HEIGHT_COMPACT }
125
+
126
+ export { BLACK_KEY_HEIGHT_EXACT }
127
+
128
+ export { BLACK_KEY_OFFSETS }
129
+
130
+ export { BLACK_KEY_OFFSETS_EXACT }
131
+
132
+ export { BLACK_KEY_RY }
133
+
134
+ export { BLACK_KEY_WIDTH }
135
+
136
+ export { BLACK_KEY_WIDTH_EXACT }
137
+
138
+ export { BRAVURA_GLYPHS }
139
+
140
+ export { calculateLayout }
141
+
142
+ export { CHORD_SHEET_SCHEMA_VERSION }
143
+
144
+ export { ChordData }
145
+
146
+ export { ChordDescriptor }
147
+
148
+ export declare function ChordGroup({ chords, label, format, theme, highlightColor, showPlayback, scale, display, showNoteNames, noteNameMode, noteNameSize, showFingering, fingeringSize, onVariation, renderVariationExtras, }: ChordGroupProps): JSX.Element;
149
+
150
+ export declare interface ChordGroupProps {
151
+ chords: ProgressionChord[];
152
+ label?: string;
153
+ format?: Format;
154
+ theme?: ColorTheme | string;
155
+ highlightColor?: string;
156
+ showPlayback?: boolean;
157
+ scale?: number;
158
+ display?: DisplayMode;
159
+ showNoteNames?: boolean;
160
+ noteNameMode?: NoteNameMode;
161
+ noteNameSize?: TextSize;
162
+ showFingering?: boolean;
163
+ fingeringSize?: TextSize;
164
+ onVariation?: OnVariation;
165
+ renderVariationExtras?: RenderVariationExtras;
166
+ }
167
+
168
+ export { ChordLogEntry }
169
+
170
+ export declare interface ChordProps {
171
+ chord: string;
172
+ format?: Format;
173
+ theme?: ColorTheme | string;
174
+ highlightColor?: string;
175
+ padding?: number;
176
+ /** Display scale factor (0.5 = 50%, 1 = 100%). Controls maxWidth of the SVG. */
177
+ scale?: number;
178
+ /** Display mode: keyboard (default), staff notation, or both side-by-side. */
179
+ display?: DisplayMode;
180
+ /** UI chrome theme: "light" (default) or "dark". */
181
+ uiTheme?: UIThemeMode;
182
+ /** Show the inline play/copy/download controls. Default true. Set false for static export. */
183
+ showPlayback?: boolean;
184
+ className?: string;
185
+ style?: CSSProperties;
186
+ /** Called after each render with a snapshot of the rendered variation. */
187
+ onVariation?: OnVariation;
188
+ /** Render extra UI as a sibling to the SVG (e.g. rating buttons). */
189
+ renderVariationExtras?: RenderVariationExtras;
190
+ /** Voicing identifier reported in VariationContext; defaults to "default". */
191
+ voicingId?: string;
192
+ /** Position in a progression; defaults to 0. */
193
+ chordIndex?: number;
194
+ }
195
+
196
+ export { chordRef }
197
+
198
+ export { ChordRequest }
199
+
200
+ export { ChordResult }
201
+
202
+ export declare function ChordSheet({ data, printMode, uiTheme, className, style, onVariation, renderVariationExtras }: ChordSheetProps): JSX.Element;
203
+
204
+ export { ChordSheetData }
205
+
206
+ export declare interface ChordSheetProps {
207
+ data: ChordSheetData;
208
+ /** Hide chord reference IDs (for print / PDF). */
209
+ printMode?: boolean;
210
+ /** UI chrome theme: "light" (default) or "dark". */
211
+ uiTheme?: UIThemeMode;
212
+ className?: string;
213
+ style?: CSSProperties;
214
+ /** Called after each chord renders with a snapshot of the rendered variation. */
215
+ onVariation?: OnVariation;
216
+ /** Render extra UI as a sibling to each chord's SVG (e.g. rating buttons). */
217
+ renderVariationExtras?: RenderVariationExtras;
218
+ }
219
+
220
+ export { ColorTheme }
221
+
222
+ export { computeKeyboard }
223
+
224
+ export { computeStaffLayout }
225
+
226
+ export { computeSvgDimensions }
227
+
228
+ export declare const DARK_THEME: UIThemeTokens;
229
+
230
+ export { decodeChordSheet }
231
+
232
+ export { DEFAULT_BLACK_FILL }
233
+
234
+ export { DEFAULT_STROKE }
235
+
236
+ export { DEFAULT_STROKE_WIDTH }
237
+
238
+ /** Default UI theme mode. Change this to switch the library default. */
239
+ export declare const DEFAULT_UI_THEME: UIThemeMode;
240
+
241
+ export { DEFAULT_WHITE_FILL }
242
+
243
+ export { DisplayDefaults }
244
+
245
+ export { DisplayMode }
246
+
247
+ export { downloadMidi }
248
+
249
+ export declare function downloadPng(svgElement: SVGSVGElement, filename: string, pixelRatio?: number): void;
250
+
251
+ export declare function downloadSvg(svgElement: SVGSVGElement, filename: string): void;
252
+
253
+ export { ENABLE_CHORD_LOGGING }
254
+
255
+ export { encodeChordSheet }
256
+
257
+ export { findTemplate }
258
+
259
+ export { findVoicing }
260
+
261
+ export { FLAT_TO_SHARP }
262
+
263
+ export { FORM_TEMPLATES }
264
+
265
+ export { Format }
266
+
267
+ export { FormTemplate }
268
+
269
+ export { generateLockedHands }
270
+
271
+ export { generateMidiFile }
272
+
273
+ export { getAlternativeVoicings }
274
+
275
+ export { getDefaultGlyphs }
276
+
277
+ export { getTheme }
278
+
279
+ export declare function getUIThemeTokens(mode: UIThemeMode): UIThemeTokens;
280
+
281
+ export declare type GroupMode = "by-progression" | "by-chord";
282
+
283
+ export { Hand }
284
+
285
+ export { HandBracket }
286
+
287
+ export { inferStyle }
288
+
289
+ export { isProgressionRequest }
290
+
291
+ export declare interface KeyboardProps {
292
+ format?: Format;
293
+ size?: number;
294
+ startFrom?: WhiteNote;
295
+ highlightKeys?: NoteName[];
296
+ /** All notes for playback (e.g. LH bass + RH chord). Falls back to highlightKeys. */
297
+ allNotes?: NoteName[];
298
+ /** Left-hand bass notes (for MIDI export with separate clefs). */
299
+ lhNotes?: NoteName[];
300
+ /** Right-hand playback octave (default 4). */
301
+ rhOctave?: number;
302
+ /** Left-hand bass playback octave (default 3). */
303
+ lhOctave?: number;
304
+ theme?: ColorTheme | string;
305
+ highlightColor?: string;
306
+ showPlayback?: boolean;
307
+ chordLabel?: string;
308
+ /** Show chord/scale name as a heading above the keyboard. */
309
+ showHeading?: boolean;
310
+ /** Bracket annotations below the keyboard (e.g. L.H. / R.H.) */
311
+ handBrackets?: HandBracket[];
312
+ /** Display scale factor (0.5 = 50%, 1 = 100%). Controls maxWidth of the SVG. */
313
+ scale?: number;
314
+ /** Show note names (capital letters) below highlighted keys. */
315
+ showNoteNames?: boolean;
316
+ /** Display-friendly note names aligned with highlightKeys (e.g. "Bb" instead of "A#").
317
+ * When omitted, names are derived from highlightKeys (sharp-normalized). */
318
+ displayNoteNames?: string[];
319
+ /** Text size for note name labels (default "base"). */
320
+ noteNameSize?: TextSize;
321
+ /** Note name display mode: "pitch-class" (default, e.g. "C") or "midi" (e.g. "C4"). */
322
+ noteNameMode?: NoteNameMode;
323
+ /** Base MIDI octave for the keyboard's first octave (default 4). Used when noteNameMode="midi". */
324
+ midiBaseOctave?: number;
325
+ /** Fingering values to display below keys (and below note names if present).
326
+ * Array aligned with highlightKeys — numbers 1–5, extra symbols (0, -, x), or "?" for invalid. */
327
+ fingering?: (number | string)[];
328
+ /** Text size for fingering numbers (default "base"). */
329
+ fingeringSize?: TextSize;
330
+ /** Jazz roman numeral degree labels aligned with highlightKeys (e.g. ["I","III","#V","bVII"]). */
331
+ degreeLabels?: string[];
332
+ /** UI chrome theme: "light" (default) or "dark". */
333
+ uiTheme?: UIThemeMode;
334
+ /** Crop half a white key on the left edge (black-key context padding). */
335
+ clipLeft?: boolean;
336
+ /** Crop half a white key on the right edge (black-key context padding). */
337
+ clipRight?: boolean;
338
+ className?: string;
339
+ style?: CSSProperties;
340
+ }
341
+
342
+ export { KeyDescriptor }
343
+
344
+ export { LayoutOptions }
345
+
346
+ export { LayoutResult }
347
+
348
+ export declare const LIGHT_THEME: UIThemeTokens;
349
+
350
+ export { LOG_SCHEMA_VERSION }
351
+
352
+ export { logChordRequest }
353
+
354
+ export { LogConfig }
355
+
356
+ export { mapHighlights }
357
+
358
+ export { mapToVoicingQuality }
359
+
360
+ export { MAX_EXAMPLES }
361
+
362
+ export { normalizeNote }
363
+
364
+ export { NoteName }
365
+
366
+ export declare type OnVariation = (ctx: VariationContext) => void;
367
+
368
+ export { parseChordDescription }
369
+
370
+ export { ParsedChordRequest }
371
+
372
+ export { ParsedProgressionRequest }
373
+
374
+ export { parseProgressionRequest }
375
+
376
+ export { PETALUMA_GLYPHS }
377
+
378
+ export declare function PianoChord(props: ChordProps | KeyboardProps): JSX.Element;
379
+
380
+ export declare type PianoChordProps = ChordProps | KeyboardProps;
381
+
382
+ export declare function PianoKeyboard({ format, size, startFrom, highlightKeys, allNotes, lhNotes, rhOctave, lhOctave, theme, highlightColor, showPlayback, chordLabel, showHeading, handBrackets, scale, showNoteNames, displayNoteNames, noteNameSize, noteNameMode, midiBaseOctave, fingering, fingeringSize, degreeLabels, clipLeft, clipRight, uiTheme, className, style, }: KeyboardProps): JSX.Element;
383
+
384
+ /**
385
+ * Play notes one at a time from bottom to top (arpeggiated).
386
+ */
387
+ export declare function playArpeggiated(notes: string[], octave?: number, delayMs?: number, duration?: number): Promise<void>;
388
+
389
+ /**
390
+ * Play all notes simultaneously (block chord).
391
+ */
392
+ export declare function playBlock(notes: string[], octave?: number, duration?: number): Promise<void>;
393
+
394
+ export { processChordRequest }
395
+
396
+ export { ProgressionChord }
397
+
398
+ export { ProgressionExample }
399
+
400
+ export { ProgressionRequest }
401
+
402
+ export { ProgressionResult }
403
+
404
+ export declare function ProgressionView({ result, format, theme, highlightColor, showPlayback, defaultGroupMode, uiTheme, onVariation, renderVariationExtras, }: ProgressionViewProps): JSX.Element;
405
+
406
+ export declare interface ProgressionViewProps {
407
+ result: ProgressionResult;
408
+ format?: Format;
409
+ theme?: ColorTheme | string;
410
+ highlightColor?: string;
411
+ showPlayback?: boolean;
412
+ defaultGroupMode?: GroupMode;
413
+ /** UI chrome theme: "light" (default) or "dark". */
414
+ uiTheme?: UIThemeMode;
415
+ onVariation?: OnVariation;
416
+ renderVariationExtras?: RenderVariationExtras;
417
+ }
418
+
419
+ export { queryVoicings }
420
+
421
+ export { RealizedNote }
422
+
423
+ export { realizeVoicing }
424
+
425
+ export { realizeVoicingFull }
426
+
427
+ export declare type RenderVariationExtras = (ctx: VariationContext) => ReactNode;
428
+
429
+ export { resolveChord }
430
+
431
+ export { ResolvedChord }
432
+
433
+ export { resolveDefaults }
434
+
435
+ export { resolveProgression }
436
+
437
+ export { resolveProgressionRequest }
438
+
439
+ export { resolveTheme }
440
+
441
+ export declare function resolveUITheme(uiTheme?: UIThemeMode): UIThemeContext;
442
+
443
+ export { SectionData }
444
+
445
+ export { selectByRange }
446
+
447
+ export { setDefaultGlyphs }
448
+
449
+ /** Default: show note names below highlighted keys. */
450
+ export declare const SHOW_NOTE_NAMES = false;
451
+
452
+ export { solvePolychord }
453
+
454
+ export { solveSlashChord }
455
+
456
+ export { StaffGlyphSet }
457
+
458
+ export { StaffLayoutOptions }
459
+
460
+ export { StaffLayoutResult }
461
+
462
+ export declare function StaffNotation({ notes, lhNotes, rhOctave, lhOctave, octaveQualifiedNotes, chordLabel, scale, showPlayback, glyphs, className, style, }: StaffNotationProps): JSX.Element;
463
+
464
+ export declare interface StaffNotationProps {
465
+ notes: string[];
466
+ lhNotes?: string[];
467
+ rhOctave?: number;
468
+ lhOctave?: number;
469
+ /** Pre-resolved octave-qualified notes (e.g. "C:4", "G#:5").
470
+ * When provided, bypasses internal octave assignment for exact matching. */
471
+ octaveQualifiedNotes?: string[];
472
+ chordLabel?: string;
473
+ scale?: number;
474
+ showPlayback?: boolean;
475
+ glyphs?: StaffGlyphSet;
476
+ className?: string;
477
+ style?: CSSProperties;
478
+ }
479
+
480
+ export { StaffNote }
481
+
482
+ export { SYSTEM_DEFAULTS }
483
+
484
+ export { TextSize }
485
+
486
+ export { tokenizeProgression }
487
+
488
+ declare interface UIThemeContext {
489
+ mode: UIThemeMode;
490
+ tokens: UIThemeTokens;
491
+ }
492
+
493
+ export declare type UIThemeMode = "light" | "dark";
494
+
495
+ export declare const UIThemeProvider: Provider<UIThemeContext>;
496
+
497
+ export declare interface UIThemeTokens {
498
+ /** Primary text color */
499
+ text: string;
500
+ /** Muted text (labels, secondary info) */
501
+ textMuted: string;
502
+ /** Subtle text (voicing style, hints) */
503
+ textSubtle: string;
504
+ /** Border color for inputs and buttons */
505
+ border: string;
506
+ /** Button background (inactive) */
507
+ btnBg: string;
508
+ /** Button background (active/selected) */
509
+ btnBgActive: string;
510
+ /** Button text (inactive) */
511
+ btnText: string;
512
+ /** Button text (active/selected) */
513
+ btnTextActive: string;
514
+ /** Input/select background */
515
+ inputBg: string;
516
+ /** Input/select text */
517
+ inputText: string;
518
+ /** SVG icon fill for playback controls */
519
+ iconFill: string;
520
+ /** Playback button background */
521
+ playbackBg: string;
522
+ /** Playback button active/playing state */
523
+ playbackActive: string;
524
+ /** Glass tray behind playback buttons */
525
+ playbackTrayBg: string;
526
+ /** Glass tray border */
527
+ playbackTrayBorder: string;
528
+ /** Individual button border for glass edge */
529
+ playbackBtnBorder: string;
530
+ /** Bracket annotation color (L.H./R.H.) */
531
+ bracketColor: string;
532
+ /** Unhighlighted white key fill */
533
+ whiteFill: string;
534
+ /** Unhighlighted black key fill */
535
+ blackFill: string;
536
+ /** Key outline stroke */
537
+ keyStroke: string;
538
+ }
539
+
540
+ export declare function useUITheme(): UIThemeContext;
541
+
542
+ export { validateVersion }
543
+
544
+ /**
545
+ * Description of a single rendered (chord, voicing) cell.
546
+ * Surfaced via `renderVariationExtras` and `onVariation` so consumers
547
+ * can attach per-variation overlays (rating UI, telemetry, etc.).
548
+ */
549
+ export declare interface VariationContext {
550
+ /** Chord symbol as rendered, e.g. "Cmaj7#5" */
551
+ chordSymbol: string;
552
+ /** Position in a progression; 0 for a single-chord render */
553
+ chordIndex: number;
554
+ /** Voicing identifier, e.g. "closed" / "drop2" / "open" / "default" */
555
+ voicingId: string;
556
+ /** Notes used in this variation (note-name strings as rendered) */
557
+ notes: string[];
558
+ /** Inline SVG markup of the rendered variation */
559
+ svgString: string;
560
+ }
561
+
562
+ export { VOICING_LIBRARY }
563
+
564
+ export { VoicingEntry }
565
+
566
+ export { VoicingEra }
567
+
568
+ export { voicingPitchClasses }
569
+
570
+ export { VoicingQuality }
571
+
572
+ export { VoicingQuery }
573
+
574
+ export { VoicingStyle }
575
+
576
+ export declare function VoicingVariantToggle({ chord, format, theme, highlightColor, scale, display, uiTheme, onExportStatus, onVariation, renderVariationExtras, chordIndex, }: VoicingVariantToggleProps): JSX.Element;
577
+
578
+ declare interface VoicingVariantToggleProps {
579
+ chord: string;
580
+ format?: "compact" | "exact";
581
+ theme?: string;
582
+ highlightColor?: string;
583
+ scale?: number;
584
+ display?: DisplayMode;
585
+ uiTheme?: UIThemeMode;
586
+ /** Called when zip export starts/finishes — drives the header animation */
587
+ onExportStatus?: (status: "idle" | "preparing") => void;
588
+ onVariation?: OnVariation;
589
+ renderVariationExtras?: RenderVariationExtras;
590
+ /** Position in progression, forwarded to PianoChord. Default 0. */
591
+ chordIndex?: number;
592
+ }
593
+
594
+ export { WHITE_KEY_HEIGHT_COMPACT }
595
+
596
+ export { WHITE_KEY_HEIGHT_EXACT }
597
+
598
+ export { WHITE_KEY_RY }
599
+
600
+ export { WHITE_KEY_WIDTH }
601
+
602
+ export { WHITE_KEY_WIDTH_EXACT }
603
+
604
+ export { WHITE_NOTE_ORDER }
605
+
606
+ export { WHITE_NOTES_WITH_SHARPS }
607
+
608
+ export { WhiteNote }
609
+
610
+ export { }
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@pepperhorn/chordl-react",
3
+ "version": "0.3.0",
4
+ "description": "React component library for SVG piano chord diagrams",
5
+ "type": "module",
6
+ "main": "./dist/chordl.cjs",
7
+ "module": "./dist/chordl.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/chordl.js",
13
+ "require": "./dist/chordl.cjs"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "peerDependencies": {
20
+ "react": ">=18.0.0",
21
+ "react-dom": ">=18.0.0"
22
+ },
23
+ "dependencies": {
24
+ "jszip": "^3.10.1",
25
+ "smplr": "^0.18.1",
26
+ "tonal": "^6.3.0",
27
+ "@pepperhorn/chordl-core": "0.3.0",
28
+ "@pepperhorn/chordl-voicings": "0.3.0"
29
+ },
30
+ "devDependencies": {
31
+ "@testing-library/react": "^16.1.0",
32
+ "@types/react": "^19.0.0",
33
+ "@types/react-dom": "^19.0.0",
34
+ "@vitejs/plugin-react": "^4.3.0",
35
+ "jsdom": "^25.0.0",
36
+ "react": "^19.0.0",
37
+ "react-dom": "^19.0.0",
38
+ "typescript": "^5.7.0",
39
+ "vite": "^6.0.0",
40
+ "vite-plugin-dts": "^4.3.0",
41
+ "vitest": "^4.1.1"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "license": "MIT",
47
+ "scripts": {
48
+ "dev": "vite --host 0.0.0.0",
49
+ "build": "tsc && vite build",
50
+ "build:site": "vite build --config vite.site.config.ts",
51
+ "lint": "tsc --noEmit",
52
+ "test": "vitest",
53
+ "test:run": "vitest run"
54
+ }
55
+ }