@takecasper/acuity-design-system 2.0.6 → 2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"AudioVolumeIndicator.d.ts","sourceRoot":"","sources":["../../../src/components/AudioVolumeIndicator/AudioVolumeIndicator.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,yBAAyB;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAI,8BAIlC,yBAAyB,gCAiC3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"AudioVolumeIndicator.d.ts","sourceRoot":"","sources":["../../../src/components/AudioVolumeIndicator/AudioVolumeIndicator.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,yBAAyB;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAI,8BAIlC,yBAAyB,gCAyC3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -30,6 +30,17 @@ export interface InputDeviceSelectProps {
30
30
  type: InputDeviceType;
31
31
  onChange: (value: string) => void;
32
32
  showMessage?: boolean;
33
+ /**
34
+ * When set, shown in grey in place of `okMessage` — e.g. while a hardware check
35
+ * waits for the microphone to pick up sound (see `useMicSignalCheck`).
36
+ */
37
+ pendingMessage?: string;
38
+ /**
39
+ * 'error' shows `pendingMessage` with the red error icon and colour, for a check that
40
+ * has failed (e.g. no sound detected).
41
+ * @default 'neutral'
42
+ */
43
+ pendingTone?: 'neutral' | 'error';
33
44
  /** Compact mode for smaller audio dropdown (329px)
34
45
  * @default false */
35
46
  compact?: boolean;
@@ -49,6 +60,6 @@ export interface InputDeviceSelectProps {
49
60
  * `compact` and `hideLabel` produce the denser variants used inside the in-test
50
61
  * device switcher, where the field label is folded into the control itself.
51
62
  */
52
- export declare const InputDeviceSelect: ({ className, disabled, error, hideLabel, options, type, value, onChange, showMessage, compact, labels }: InputDeviceSelectProps) => import("react").JSX.Element;
63
+ export declare const InputDeviceSelect: ({ className, disabled, error, hideLabel, options, type, value, onChange, showMessage, pendingMessage, pendingTone, compact, labels }: InputDeviceSelectProps) => import("react").JSX.Element;
53
64
  export default InputDeviceSelect;
54
65
  //# sourceMappingURL=InputDeviceSelect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InputDeviceSelect.d.ts","sourceRoot":"","sources":["../../../src/components/InputDeviceSelect/InputDeviceSelect.tsx"],"names":[],"mappings":"AAaA,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhD,uEAAuE;AACvE,MAAM,WAAW,uBAAuB;IACtC,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAC;CACtB;AAiBD,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;wBACoB;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;wBACoB;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC;AAaD;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAAI,yGAY/B,sBAAsB,gCA8KxB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"InputDeviceSelect.d.ts","sourceRoot":"","sources":["../../../src/components/InputDeviceSelect/InputDeviceSelect.tsx"],"names":[],"mappings":"AAcA,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhD,uEAAuE;AACvE,MAAM,WAAW,uBAAuB;IACtC,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAC;CACtB;AAiBD,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;wBACoB;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAClC;wBACoB;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC;AAaD;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAAI,sIAc/B,sBAAsB,gCAuMxB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,29 @@
1
+ /** RMS volume (0, 1) above which the mic counts as picking up sound rather than background noise */
2
+ export declare const MIC_SIGNAL_THRESHOLD = 0.02;
3
+ /** Total time the volume must be above the threshold before the mic counts as working.
4
+ * Pauses between words don't reset it, so a single short word is enough. */
5
+ export declare const MIC_SIGNAL_SUSTAIN_MS = 250;
6
+ /** How long to wait for sound before telling the user nothing was detected */
7
+ export declare const MIC_SILENCE_TIMEOUT_MS = 8000;
8
+ /**
9
+ * idle - no stream to check yet
10
+ * listening - waiting for the user to make some sound
11
+ * silent - no sound after MIC_SILENCE_TIMEOUT_MS (can still move to detected)
12
+ * detected - enough sound picked up from the selected mic
13
+ */
14
+ export type MicSignalStatus = 'idle' | 'listening' | 'silent' | 'detected';
15
+ /**
16
+ * Checks that the selected microphone is actually receiving input.
17
+ * A microphone that grants permission but picks up nothing (wrong device, muted, etc.)
18
+ * never reaches 'detected'. Pass a new stream when the user switches microphones to
19
+ * restart the check.
20
+ *
21
+ * Pair it with `InputDeviceSelect`'s `pendingMessage` to show a grey hint until the
22
+ * status is 'detected', and gate the hardware check's continue button on it.
23
+ *
24
+ * @param volume Current RMS microphone level (0, 1), e.g. from an AnalyserNode
25
+ * @param stream The selected microphone's stream; its identity keys the check
26
+ */
27
+ export declare const useMicSignalCheck: (volume: number, stream?: MediaStream) => MicSignalStatus;
28
+ export default useMicSignalCheck;
29
+ //# sourceMappingURL=useMicSignalCheck.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMicSignalCheck.d.ts","sourceRoot":"","sources":["../../../src/components/InputDeviceSelect/useMicSignalCheck.ts"],"names":[],"mappings":"AAEA,oGAAoG;AACpG,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC;4EAC4E;AAC5E,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,8EAA8E;AAC9E,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE3E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,MAAM,EACd,SAAS,WAAW,KACnB,eA0CF,CAAC;AAEF,eAAe,iBAAiB,CAAC"}