summaryrefslogtreecommitdiff
path: root/shared/components/src/constants.ts
diff options
context:
space:
mode:
authorrxliuli <rxliuli@gmail.com>2025-11-04 05:03:50 +0800
committerrxliuli <rxliuli@gmail.com>2025-11-04 05:03:50 +0800
commitbce557cc2dc767628bed6aac87301a1be7c5431b (patch)
treeb51a051228d01fe3306cd7626d4a96768aadb944 /shared/components/src/constants.ts
init commit
Diffstat (limited to 'shared/components/src/constants.ts')
-rw-r--r--shared/components/src/constants.ts53
1 files changed, 53 insertions, 0 deletions
diff --git a/shared/components/src/constants.ts b/shared/components/src/constants.ts
new file mode 100644
index 0000000..826257c
--- /dev/null
+++ b/shared/components/src/constants.ts
@@ -0,0 +1,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',
+}