@takecasper/acuity-design-system 2.1.1 → 2.2.1
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/AudioVolumeIndicator/AudioVolumeIndicator.d.ts +20 -2
- package/dist/components/AudioVolumeIndicator/AudioVolumeIndicator.d.ts.map +1 -1
- package/dist/components/AudioVolumeIndicator/useMicVolume.d.ts +10 -0
- package/dist/components/AudioVolumeIndicator/useMicVolume.d.ts.map +1 -0
- package/dist/components/DevicePicker/DevicePicker.d.ts +59 -0
- package/dist/components/DevicePicker/DevicePicker.d.ts.map +1 -0
- package/dist/components/DevicePicker/useLiveDevices.d.ts +3 -0
- package/dist/components/DevicePicker/useLiveDevices.d.ts.map +1 -0
- package/dist/components/Modal/modal.d.ts.map +1 -1
- package/dist/components/RecordingBadge/RecordingBadge.d.ts +22 -0
- package/dist/components/RecordingBadge/RecordingBadge.d.ts.map +1 -0
- package/dist/docs/storiesList.d.ts.map +1 -1
- package/dist/index.cjs.js +123 -123
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +6625 -6349
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps a raw RMS volume (0, 1) to how full the meter should be (0, 1), on a decibel scale.
|
|
3
|
+
* Speech is usually only 0.02-0.15 RMS, which would barely light a linear meter; in
|
|
4
|
+
* decibels normal speech fills about half of it, which matches how loud it sounds.
|
|
5
|
+
*/
|
|
6
|
+
export declare const toMeterLevel: (rms: number) => number;
|
|
7
|
+
/** Whether bar `i` (1-based, out of `barCount`) is lit at meter `level` (0, 1), filling left to right */
|
|
8
|
+
export declare const isVolumeBarFilled: (i: number, level: number, barCount?: number) => boolean;
|
|
9
|
+
export type AudioVolumeIndicatorSize = 'default' | 'small';
|
|
1
10
|
export interface AudioVolumeIndicatorProps {
|
|
2
11
|
className?: string;
|
|
3
|
-
/** Microphone's volume
|
|
12
|
+
/** Microphone's raw RMS volume (0, 1), e.g. from `useMicVolume` */
|
|
4
13
|
volume: number;
|
|
5
14
|
/**
|
|
6
15
|
* Caption above the meter. Supplied by the consuming app so the copy can be
|
|
7
16
|
* translated there; the default is the English string TEX ships.
|
|
8
17
|
*/
|
|
9
18
|
label?: string;
|
|
19
|
+
/** Hides the caption; the meter keeps `label` as its accessible name
|
|
20
|
+
* @default false */
|
|
21
|
+
hideLabel?: boolean;
|
|
22
|
+
/** How many bars the meter has
|
|
23
|
+
* @default 24 */
|
|
24
|
+
barCount?: number;
|
|
25
|
+
/** 'small' is a compact meter for tight spaces, e.g. the recording badge
|
|
26
|
+
* @default 'default' */
|
|
27
|
+
size?: AudioVolumeIndicatorSize;
|
|
10
28
|
}
|
|
11
29
|
/**
|
|
12
30
|
* A segmented meter showing live microphone input level.
|
|
@@ -15,6 +33,6 @@ export interface AudioVolumeIndicatorProps {
|
|
|
15
33
|
* is actually picking them up — so it reflects `volume` continuously rather than
|
|
16
34
|
* reducing it to a pass/fail verdict.
|
|
17
35
|
*/
|
|
18
|
-
export declare const AudioVolumeIndicator: ({ className, volume, label }: AudioVolumeIndicatorProps) => import("react").JSX.Element;
|
|
36
|
+
export declare const AudioVolumeIndicator: ({ className, volume, label, hideLabel, barCount, size }: AudioVolumeIndicatorProps) => import("react").JSX.Element;
|
|
19
37
|
export default AudioVolumeIndicator;
|
|
20
38
|
//# sourceMappingURL=AudioVolumeIndicator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioVolumeIndicator.d.ts","sourceRoot":"","sources":["../../../src/components/AudioVolumeIndicator/AudioVolumeIndicator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AudioVolumeIndicator.d.ts","sourceRoot":"","sources":["../../../src/components/AudioVolumeIndicator/AudioVolumeIndicator.tsx"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,WAOvC,CAAC;AAEF,yGAAyG;AACzG,eAAO,MAAM,iBAAiB,GAC5B,GAAG,MAAM,EACT,OAAO,MAAM,EACb,iBAA4B,YACQ,CAAC;AAEvC,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,OAAO,CAAC;AAe3D,MAAM,WAAW,yBAAyB;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;wBACoB;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;qBACiB;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;4BACwB;IACxB,IAAI,CAAC,EAAE,wBAAwB,CAAC;CACjC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAI,yDAOlC,yBAAyB,gCA4C3B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live RMS level (0, 1) of a microphone stream, updated every animation frame.
|
|
3
|
+
* Returns 0 while there is no stream. Feed it to `AudioVolumeIndicator`'s `volume`.
|
|
4
|
+
*
|
|
5
|
+
* Because it updates every frame, call it in the smallest component that shows the level
|
|
6
|
+
* so only that component re-renders.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useMicVolume: (stream?: MediaStream) => number;
|
|
9
|
+
export default useMicVolume;
|
|
10
|
+
//# sourceMappingURL=useMicVolume.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMicVolume.d.ts","sourceRoot":"","sources":["../../../src/components/AudioVolumeIndicator/useMicVolume.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,WAAW,WA4ChD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { InputDeviceSelectLabels } from '../InputDeviceSelect/InputDeviceSelect';
|
|
2
|
+
import { MicSignalStatus } from '../InputDeviceSelect/useMicSignalCheck';
|
|
3
|
+
/**
|
|
4
|
+
* The camera and microphone state the picker shows. Field names match tex-ui's
|
|
5
|
+
* `useMediaDeviceMonitor()`, so an app can pass its own state straight through.
|
|
6
|
+
*/
|
|
7
|
+
export interface DevicePickerDevices {
|
|
8
|
+
videoDevices: MediaDeviceInfo[];
|
|
9
|
+
audioDevices: MediaDeviceInfo[];
|
|
10
|
+
activeVideoId: string;
|
|
11
|
+
activeAudioId: string;
|
|
12
|
+
videoStream?: MediaStream;
|
|
13
|
+
audioStream?: MediaStream;
|
|
14
|
+
/** Empty or undefined means the device is fine; anything else shows the select's error */
|
|
15
|
+
videoError?: string;
|
|
16
|
+
audioError?: string;
|
|
17
|
+
videoPerm?: PermissionState;
|
|
18
|
+
audioPerm?: PermissionState;
|
|
19
|
+
onSelectVideo: (deviceId: string) => void;
|
|
20
|
+
onSelectAudio: (deviceId: string) => void;
|
|
21
|
+
}
|
|
22
|
+
/** Copy for the picker, so the consuming app owns translation. */
|
|
23
|
+
export interface DevicePickerLabels {
|
|
24
|
+
/** Grey hint under the microphone select while waiting for sound */
|
|
25
|
+
speakToTest: string;
|
|
26
|
+
/** Red hint under the microphone select when nothing has been heard */
|
|
27
|
+
noSoundDetected: string;
|
|
28
|
+
/** Caption above the level meter */
|
|
29
|
+
inputLevel: string;
|
|
30
|
+
/** Copy for the camera select; defaults to InputDeviceSelect's English copy */
|
|
31
|
+
camera?: InputDeviceSelectLabels;
|
|
32
|
+
/** Copy for the microphone select; defaults to InputDeviceSelect's English copy */
|
|
33
|
+
microphone?: InputDeviceSelectLabels;
|
|
34
|
+
}
|
|
35
|
+
export declare const DEFAULT_DEVICE_PICKER_LABELS: DevicePickerLabels;
|
|
36
|
+
export interface DevicePickerProps {
|
|
37
|
+
/** Device state from the app */
|
|
38
|
+
devices: DevicePickerDevices;
|
|
39
|
+
/**
|
|
40
|
+
* Called whenever the microphone check changes. 'detected' means the selected mic has
|
|
41
|
+
* picked up sound; use it, with the devices' permissions and errors, to enable the
|
|
42
|
+
* app's continue button.
|
|
43
|
+
*/
|
|
44
|
+
onMicStatusChange?: (status: MicSignalStatus) => void;
|
|
45
|
+
/** Override any of the copy for translation */
|
|
46
|
+
labels?: Partial<DevicePickerLabels>;
|
|
47
|
+
className?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The device check's picker: a mirrored webcam preview beside the camera and microphone
|
|
51
|
+
* selects, a live input meter, and a microphone signal check that only passes once the
|
|
52
|
+
* selected mic actually picks up sound.
|
|
53
|
+
*
|
|
54
|
+
* The app owns the page around it — layout, the continue button and any permission
|
|
55
|
+
* message — and the device state, passed in as `devices`.
|
|
56
|
+
*/
|
|
57
|
+
export declare const DevicePicker: ({ devices, onMicStatusChange, labels: labelsProp, className }: DevicePickerProps) => import("react").JSX.Element;
|
|
58
|
+
export default DevicePicker;
|
|
59
|
+
//# sourceMappingURL=DevicePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevicePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DevicePicker/DevicePicker.tsx"],"names":[],"mappings":"AAMA,OAAO,EAEL,uBAAuB,EACxB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,eAAe,EAEhB,MAAM,wCAAwC,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,0FAA0F;IAC1F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C;AAED,kEAAkE;AAClE,MAAM,WAAW,kBAAkB;IACjC,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,eAAe,EAAE,MAAM,CAAC;IACxB,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,mFAAmF;IACnF,UAAU,CAAC,EAAE,uBAAuB,CAAC;CACtC;AAED,eAAO,MAAM,4BAA4B,EAAE,kBAK1C,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,gCAAgC;IAChC,OAAO,EAAE,mBAAmB,CAAC;IAC7B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IACtD,+CAA+C;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAgGD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAI,+DAK1B,iBAAiB,gCAmDnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLiveDevices.d.ts","sourceRoot":"","sources":["../../../src/components/DevicePicker/useLiveDevices.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AA2FrD,eAAO,MAAM,cAAc,QAAO,mBA4GjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAUxC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,GAAG,aAAa,GAAG,MAAM,CAAC;IAC5C,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,QAAA,MAAM,KAAK,GAAI,iHAYZ,UAAU,sBAsGZ,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface RecordingBadgeProps {
|
|
2
|
+
/**
|
|
3
|
+
* The badge text. Supplied by the consuming app so it can be translated there;
|
|
4
|
+
* the default is the English string TEX ships.
|
|
5
|
+
*/
|
|
6
|
+
label?: string;
|
|
7
|
+
/** The selected microphone's stream, for the live input level under the label */
|
|
8
|
+
stream?: MediaStream;
|
|
9
|
+
/** Accessible name of the level meter; translate with `label` */
|
|
10
|
+
levelLabel?: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Shown over the video while a response is being recorded, as two aligned rows: a red dot
|
|
15
|
+
* and "Recording", then a mic icon and a small live mic level, so the candidate can see
|
|
16
|
+
* their answer is being picked up.
|
|
17
|
+
*
|
|
18
|
+
* Positioning is up to the caller — TEX places it in the top-right corner of the video.
|
|
19
|
+
*/
|
|
20
|
+
export declare const RecordingBadge: ({ label, stream, levelLabel, className }: RecordingBadgeProps) => import("react").JSX.Element;
|
|
21
|
+
export default RecordingBadge;
|
|
22
|
+
//# sourceMappingURL=RecordingBadge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecordingBadge.d.ts","sourceRoot":"","sources":["../../../src/components/RecordingBadge/RecordingBadge.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA6BD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,0CAK5B,mBAAmB,gCAkDrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storiesList.d.ts","sourceRoot":"","sources":["../../src/docs/storiesList.tsx"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"storiesList.d.ts","sourceRoot":"","sources":["../../src/docs/storiesList.tsx"],"names":[],"mappings":";;;;;AAAA,wBAmSE"}
|