@popmenu/common-ui 0.16.0 → 0.18.2

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,3 @@
1
+ import { FC } from 'react';
2
+ import { AudioPlayerProps } from './AudioPlayerProps';
3
+ export declare const AudioPlayer: FC<AudioPlayerProps>;
@@ -0,0 +1,4 @@
1
+ export interface AudioPlayerProps {
2
+ /** The URL of the audio to embed. */
3
+ src?: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ export { AudioPlayer as default } from './AudioPlayer';
2
+ export { AudioPlayerProps } from './AudioPlayerProps';
@@ -0,0 +1,11 @@
1
+ import { PLAYBACK_STATES, CONTROL_LABELS, AudioPlayerState, AudioPlayerEvent, VOLUME_CONTROL_STATES } from './types';
2
+ export declare const initialAudioPlayerState: {
3
+ playback: PLAYBACK_STATES;
4
+ volumeControls: VOLUME_CONTROL_STATES;
5
+ context: {
6
+ volume: number;
7
+ playbackButtonLabel: CONTROL_LABELS;
8
+ volumeButtonLabel: CONTROL_LABELS;
9
+ };
10
+ };
11
+ export declare const audioPlayerReducer: (state: AudioPlayerState, event: AudioPlayerEvent) => AudioPlayerState;
@@ -0,0 +1 @@
1
+ export declare const formatTime: (time: number, remaning?: boolean) => string;
@@ -0,0 +1,5 @@
1
+ export { audioPlayerReducer, initialAudioPlayerState } from './audioPlayerReducer';
2
+ export { useVolumeIcon } from './useVolumeIcon';
3
+ export { formatTime } from './formatTime';
4
+ export { setupAudioRef } from './setupAudioRef';
5
+ export * from './types';
@@ -0,0 +1,8 @@
1
+ import { RefObject } from 'react';
2
+ import { AudioPlayerEvent } from './types';
3
+ interface Config {
4
+ audioRef: RefObject<HTMLAudioElement>;
5
+ send: (event: AudioPlayerEvent) => void;
6
+ }
7
+ export declare const setupAudioRef: (config: Config) => () => (() => void);
8
+ export {};
@@ -0,0 +1,77 @@
1
+ import { RefObject } from 'react';
2
+ export declare enum AUDIO_PLAYER_EVENT_TYPES {
3
+ TOGGLE_PLAYBACK = "TOGGLE_PLAYBACK",
4
+ TOGGLE_VOLUME_CONTROL = "TOGGLE_VOLUME_CONTROL",
5
+ TOGGLE_MUTE = "TOGGLE_MUTE",
6
+ VOLUME_CHANGE = "VOLUME_CHANGE",
7
+ TIME_CHANGE = "TIME_CHANGE",
8
+ DURATION_CHANGE = "DURATION_CHANGE",
9
+ SET_TIME = "SET_TIME",
10
+ CAN_PLAY = "CAN_PLAY",
11
+ RESET = "RESET"
12
+ }
13
+ interface SetVolumeEvent {
14
+ type: AUDIO_PLAYER_EVENT_TYPES.VOLUME_CHANGE;
15
+ context: Pick<AudioPlayerExtendState, 'volume'>;
16
+ }
17
+ interface TogglePlaybackEvent {
18
+ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK;
19
+ }
20
+ interface ToggleVolumeControlEvent {
21
+ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL;
22
+ }
23
+ interface TimeChangeEvent {
24
+ type: AUDIO_PLAYER_EVENT_TYPES.TIME_CHANGE;
25
+ context: {
26
+ currentTime: number;
27
+ };
28
+ }
29
+ interface DurationChangeEvent {
30
+ type: AUDIO_PLAYER_EVENT_TYPES.DURATION_CHANGE;
31
+ context: {
32
+ duration: number;
33
+ };
34
+ }
35
+ interface ToggleMuteEvent {
36
+ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_MUTE;
37
+ }
38
+ interface SetTimeEvent {
39
+ type: AUDIO_PLAYER_EVENT_TYPES.SET_TIME;
40
+ context: {
41
+ time: number;
42
+ };
43
+ }
44
+ interface CanPlayEvent {
45
+ type: AUDIO_PLAYER_EVENT_TYPES.CAN_PLAY;
46
+ }
47
+ interface ResetEvent {
48
+ type: AUDIO_PLAYER_EVENT_TYPES.RESET;
49
+ }
50
+ export declare type AudioPlayerEvent = TogglePlaybackEvent | ToggleVolumeControlEvent | SetVolumeEvent | TimeChangeEvent | DurationChangeEvent | ToggleMuteEvent | SetTimeEvent | CanPlayEvent | ResetEvent;
51
+ export declare enum PLAYBACK_STATES {
52
+ NONE = "NONE",
53
+ PAUSED = "PAUSED",
54
+ PLAYING = "PLAYING"
55
+ }
56
+ export declare enum CONTROL_LABELS {
57
+ PAUSE = "PAUSE",
58
+ PLAY = "PLAY",
59
+ MUTE = "MUTE",
60
+ UNMUTE = "UNMUTE"
61
+ }
62
+ export declare enum VOLUME_CONTROL_STATES {
63
+ SHOW = "SHOW",
64
+ HIDE = "HIDE"
65
+ }
66
+ export interface AudioPlayerExtendState {
67
+ volume: number;
68
+ audioRef: RefObject<HTMLAudioElement>;
69
+ playbackButtonLabel: CONTROL_LABELS;
70
+ volumeButtonLabel: CONTROL_LABELS;
71
+ }
72
+ export interface AudioPlayerState {
73
+ playback: PLAYBACK_STATES;
74
+ volumeControls: VOLUME_CONTROL_STATES;
75
+ context: AudioPlayerExtendState;
76
+ }
77
+ export {};
@@ -0,0 +1,2 @@
1
+ import { AudioPlayerState } from './types';
2
+ export declare const useVolumeIcon: (state: AudioPlayerState) => string;
@@ -1,2 +1,7 @@
1
- export { Box as default } from './Box';
2
- export { BoxProps } from './BoxProps';
1
+ /**
2
+ * Using the customized Box component in Popmenu repo breaks Cypress tests.
3
+ * Many tests fail for TypeError around ResizeObserver
4
+ * export { Box as default } from './Box'
5
+ * export { BoxProps } from './BoxProps'
6
+ */
7
+ export { Box as default, BoxProps } from '@material-ui/core';
@@ -13,6 +13,8 @@ export interface TableProps {
13
13
  label: string;
14
14
  action: (cell: Cell) => void;
15
15
  }>;
16
+ /** Styles the table to not shrink below the height of a full page. */
17
+ enableMinHeight?: boolean;
16
18
  /** Styles the table to take up its containers full width. */
17
19
  fullWidth?: boolean;
18
20
  /** Enables sortability for columns. */
@@ -4,6 +4,7 @@ export { default as AccordionActions, AccordionActionsProps } from './AccordionA
4
4
  export { default as AccordionDetails, AccordionDetailsProps } from './AccordionDetails';
5
5
  export { default as AccordionSummary, AccordionSummaryProps } from './AccordionSummary';
6
6
  export { default as AppBar, AppBarProps } from './AppBar';
7
+ export { default as AudioPlayer, AudioPlayerProps } from './AudioPlayer';
7
8
  export { default as Avatar, AvatarProps } from './Avatar';
8
9
  export { default as Badge, BadgeProps } from './Badge';
9
10
  export { default as Box, BoxProps } from './Box';