@stfrigerio/sito-template 0.1.27 → 0.1.28
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/dist/components/atoms/Button/Button.d.ts +3 -0
- package/dist/components/atoms/Button/Button.d.ts.map +1 -1
- package/dist/components/atoms/Button/Button.stories.d.ts +1 -0
- package/dist/components/atoms/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.d.ts +3 -0
- package/dist/components/atoms/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/atoms/DateInput/DateInput.d.ts +4 -1
- package/dist/components/atoms/DateInput/DateInput.d.ts.map +1 -1
- package/dist/components/atoms/NumberStepper/NumberStepper.d.ts +3 -0
- package/dist/components/atoms/NumberStepper/NumberStepper.d.ts.map +1 -1
- package/dist/components/atoms/SelectInput/SelectInput.d.ts +4 -1
- package/dist/components/atoms/SelectInput/SelectInput.d.ts.map +1 -1
- package/dist/components/atoms/Slider/Slider.d.ts +4 -1
- package/dist/components/atoms/Slider/Slider.d.ts.map +1 -1
- package/dist/components/atoms/SoundDemo/SoundDemo.stories.d.ts +17 -0
- package/dist/components/atoms/SoundDemo/SoundDemo.stories.d.ts.map +1 -0
- package/dist/components/atoms/TextInput/TextInput.d.ts +6 -3
- package/dist/components/atoms/TextInput/TextInput.d.ts.map +1 -1
- package/dist/components/atoms/Toggle/Toggle.d.ts +10 -1
- package/dist/components/atoms/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/atoms/ToggleButton/ToggleButton.d.ts +3 -0
- package/dist/components/atoms/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/index.esm.js +638 -21
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +638 -21
- package/dist/index.js.map +1 -1
- package/dist/utils/soundUtils.d.ts +39 -0
- package/dist/utils/soundUtils.d.ts.map +1 -0
- package/dist/utils/useSound.d.ts +22 -0
- package/dist/utils/useSound.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type SoundType = 'click' | 'hover' | 'success' | 'error' | 'warning' | 'toggle' | 'type' | 'delete';
|
|
2
|
+
export type SoundPack = 'digital' | 'fantasy' | 'retro' | 'minimal' | 'mechanical';
|
|
3
|
+
export interface SoundConfig {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
volume?: number;
|
|
6
|
+
soundPack?: SoundPack;
|
|
7
|
+
sounds?: Partial<Record<SoundType, string>>;
|
|
8
|
+
}
|
|
9
|
+
export interface ComponentSoundConfig {
|
|
10
|
+
onClick?: string | boolean;
|
|
11
|
+
onHover?: string | boolean;
|
|
12
|
+
onError?: string | boolean;
|
|
13
|
+
onSuccess?: string | boolean;
|
|
14
|
+
}
|
|
15
|
+
declare class SoundManager {
|
|
16
|
+
private static instance;
|
|
17
|
+
private audioContext;
|
|
18
|
+
private config;
|
|
19
|
+
private constructor();
|
|
20
|
+
static getInstance(): SoundManager;
|
|
21
|
+
private init;
|
|
22
|
+
private ensureAudioContext;
|
|
23
|
+
private playTone;
|
|
24
|
+
private playFromDefinition;
|
|
25
|
+
play(soundType: SoundType | string): void;
|
|
26
|
+
celebration(): void;
|
|
27
|
+
milestone(): void;
|
|
28
|
+
configure(config: SoundConfig): void;
|
|
29
|
+
getConfig(): SoundConfig;
|
|
30
|
+
setVolume(volume: number): void;
|
|
31
|
+
setEnabled(enabled: boolean): void;
|
|
32
|
+
setSoundPack(pack: SoundPack): void;
|
|
33
|
+
getSoundPack(): SoundPack;
|
|
34
|
+
isEnabled(): boolean;
|
|
35
|
+
getAvailablePacks(): SoundPack[];
|
|
36
|
+
}
|
|
37
|
+
export declare const soundManager: SoundManager;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=soundUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"soundUtils.d.ts","sourceRoot":"","sources":["../../src/utils/soundUtils.ts"],"names":[],"mappings":"AAAA,MAAM,MAA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AY,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IAInC,YAAY,IAAI,SAAS;IAIzB,SAAS,IAAI,OAAO;IAIpB,iBAAiB,IAAI,SAAS,EAAE;CAGnC;AAED,eAAO,MAAM,YAAY,cAA6B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SoundType, ComponentSoundConfig } from './soundUtils';
|
|
2
|
+
export type { ComponentSoundConfig, SoundType } from './soundUtils';
|
|
3
|
+
export interface UseSoundOptions {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
volume?: number;
|
|
6
|
+
debounceMs?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface UseSoundReturn {
|
|
9
|
+
playSound: (soundType: SoundType | string) => void;
|
|
10
|
+
isEnabled: () => boolean;
|
|
11
|
+
setEnabled: (enabled: boolean) => void;
|
|
12
|
+
setVolume: (volume: number) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function useSound(options?: UseSoundOptions): UseSoundReturn;
|
|
15
|
+
export declare function useComponentSound(config?: ComponentSoundConfig, options?: UseSoundOptions): {
|
|
16
|
+
handlers: {
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
onMouseEnter?: () => void;
|
|
19
|
+
};
|
|
20
|
+
playSound: (soundType: SoundType | string) => void;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=useSound.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSound.d.ts","sourceRoot":"","sources":["../../src/utils/useSound.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,SAAS,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE7E,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,MAAM,WAAW,eAAe;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,KAAK,IAAI,CAAC;IACnD,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED,wBAAgB,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,cAAc,CAiClE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG;IACzF,QAAQ,EAAE;QACN,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QACrB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;KAC7B,CAAC;IACF,SAAS,EAAE,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,KAAK,IAAI,CAAC;CACtD,CAuBA"}
|
package/package.json
CHANGED