summaryrefslogtreecommitdiff
path: root/shared/components/src/constants.ts
blob: 826257c714212af0d52874f7ab06f1d773a4edc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// eslint-disable-next-line import/prefer-default-export
export const TEXT_DIRECTION = {
    LTR: 'ltr',
    RTL: 'rtl',
} as const;

// https://www.fileformat.info/info/unicode/char/200e/index.htm
// these are unicode characters in four hexadecimal digits
export const LTR_MARK = '\u200e';
export const RTL_MARK = '\u200f';

export const PLAY_STATES = {
    PLAY: 'play',
    PAUSE: 'pause',
    BUFFER: 'buffer',
    PLAYING: 'playing',
} as const;

// eslint-disable-next-line import/prefer-default-export
export const SEARCH_EVENTS = {
    MAKE_SEARCH_QUERY_FROM_SUGGESTION: 'makeSearchQueryFromSuggestion',
    MAKE_SEARCH_QUERY_FROM_INPUT: 'makeSearchQueryFromInput',
    CLICKED_OUTSIDE_SUGGESTIONS: 'clickedOutsideSuggestions',
    CLICKED_OUTSIDE: 'clickedOutside',
    RESET_SEARCH_INPUT: 'resetSearchInput',
    SUGGESTION_CLICKED: 'suggestionClicked',
    SUGGESTION_FOCUSED: 'suggestionFocused',
    SEARCH_INPUT_HAS_FOCUS: 'searchInputHasFocus',
    MENU_ITEM_CLICK: 'menuItemClick',
    SHOW_SEARCH_SUGGESTIONS: 'showSearchSuggestions',
    CLEAR: 'clear',
} as const;

/**
 * Locations where `SearchInput` component `clear` event can be called from.
 *
 * @remarks
 * clear event can be triggered from two different locations
 * rerturn object provides a way to distinguish between
 * call points.
 *
 */
export enum ClearEventLocation {
    Cancel = 'cancel',
    Input = 'input',
}

export enum PopoverAnchorPositioning {
    Top = 'top',
    Bottom = 'bottom',
    Left = 'left',
    Right = 'right',
}