@bigbinary/neeto-molecules 0.0.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/README.md +60 -0
- package/dist/BrowserSupport.cjs.js +1727 -0
- package/dist/BrowserSupport.cjs.js.map +1 -0
- package/dist/BrowserSupport.js +1721 -0
- package/dist/BrowserSupport.js.map +1 -0
- package/dist/Columns.cjs.js +191 -0
- package/dist/Columns.cjs.js.map +1 -0
- package/dist/Columns.js +184 -0
- package/dist/Columns.js.map +1 -0
- package/dist/Container.cjs.js +1277 -0
- package/dist/Container.cjs.js.map +1 -0
- package/dist/Container.js +1271 -0
- package/dist/Container.js.map +1 -0
- package/dist/CopyToClipboardButton.cjs.js +78 -0
- package/dist/CopyToClipboardButton.cjs.js.map +1 -0
- package/dist/CopyToClipboardButton.js +72 -0
- package/dist/CopyToClipboardButton.js.map +1 -0
- package/dist/CustomDomain.cjs.js +680 -0
- package/dist/CustomDomain.cjs.js.map +1 -0
- package/dist/CustomDomain.js +654 -0
- package/dist/CustomDomain.js.map +1 -0
- package/dist/CustomDomainDashboard.cjs.js +2306 -0
- package/dist/CustomDomainDashboard.cjs.js.map +1 -0
- package/dist/CustomDomainDashboard.js +2279 -0
- package/dist/CustomDomainDashboard.js.map +1 -0
- package/dist/DateFormat.cjs.js +51 -0
- package/dist/DateFormat.cjs.js.map +1 -0
- package/dist/DateFormat.js +45 -0
- package/dist/DateFormat.js.map +1 -0
- package/dist/DateRangeFilter.cjs.js +236 -0
- package/dist/DateRangeFilter.cjs.js.map +1 -0
- package/dist/DateRangeFilter.js +229 -0
- package/dist/DateRangeFilter.js.map +1 -0
- package/dist/DynamicVariables.cjs.js +112 -0
- package/dist/DynamicVariables.cjs.js.map +1 -0
- package/dist/DynamicVariables.js +106 -0
- package/dist/DynamicVariables.js.map +1 -0
- package/dist/EmailPreview.cjs.js +102 -0
- package/dist/EmailPreview.cjs.js.map +1 -0
- package/dist/EmailPreview.js +96 -0
- package/dist/EmailPreview.js.map +1 -0
- package/dist/ErrorPage.cjs.js +208 -0
- package/dist/ErrorPage.cjs.js.map +1 -0
- package/dist/ErrorPage.js +184 -0
- package/dist/ErrorPage.js.map +1 -0
- package/dist/Header.cjs.js +219 -0
- package/dist/Header.cjs.js.map +1 -0
- package/dist/Header.js +213 -0
- package/dist/Header.js.map +1 -0
- package/dist/IconPicker.cjs.js +1307 -0
- package/dist/IconPicker.cjs.js.map +1 -0
- package/dist/IconPicker.js +1301 -0
- package/dist/IconPicker.js.map +1 -0
- package/dist/IntegrationCard.cjs.js +75 -0
- package/dist/IntegrationCard.cjs.js.map +1 -0
- package/dist/IntegrationCard.js +69 -0
- package/dist/IntegrationCard.js.map +1 -0
- package/dist/IntegrationDisconnectAlert.cjs.js +81 -0
- package/dist/IntegrationDisconnectAlert.cjs.js.map +1 -0
- package/dist/IntegrationDisconnectAlert.js +75 -0
- package/dist/IntegrationDisconnectAlert.js.map +1 -0
- package/dist/IntegrationWalkthroughModal.cjs.js +42 -0
- package/dist/IntegrationWalkthroughModal.cjs.js.map +1 -0
- package/dist/IntegrationWalkthroughModal.js +36 -0
- package/dist/IntegrationWalkthroughModal.js.map +1 -0
- package/dist/IpRestriction.cjs.js +3764 -0
- package/dist/IpRestriction.cjs.js.map +1 -0
- package/dist/IpRestriction.js +3738 -0
- package/dist/IpRestriction.js.map +1 -0
- package/dist/KeyboardShortcuts.cjs.js +2242 -0
- package/dist/KeyboardShortcuts.cjs.js.map +1 -0
- package/dist/KeyboardShortcuts.js +2235 -0
- package/dist/KeyboardShortcuts.js.map +1 -0
- package/dist/LoginPage.cjs.js +618 -0
- package/dist/LoginPage.cjs.js.map +1 -0
- package/dist/LoginPage.js +593 -0
- package/dist/LoginPage.js.map +1 -0
- package/dist/MenuBar.cjs.js +31044 -0
- package/dist/MenuBar.cjs.js.map +1 -0
- package/dist/MenuBar.js +31038 -0
- package/dist/MenuBar.js.map +1 -0
- package/dist/NeetoWidget.cjs.js +3369 -0
- package/dist/NeetoWidget.cjs.js.map +1 -0
- package/dist/NeetoWidget.js +3343 -0
- package/dist/NeetoWidget.js.map +1 -0
- package/dist/PageLoader.cjs.js +158 -0
- package/dist/PageLoader.cjs.js.map +1 -0
- package/dist/PageLoader.js +134 -0
- package/dist/PageLoader.js.map +1 -0
- package/dist/PhoneNumber.cjs.js +7021 -0
- package/dist/PhoneNumber.cjs.js.map +1 -0
- package/dist/PhoneNumber.js +6989 -0
- package/dist/PhoneNumber.js.map +1 -0
- package/dist/PublishBlock.cjs.js +189 -0
- package/dist/PublishBlock.cjs.js.map +1 -0
- package/dist/PublishBlock.js +183 -0
- package/dist/PublishBlock.js.map +1 -0
- package/dist/Rename.cjs.js +306 -0
- package/dist/Rename.cjs.js.map +1 -0
- package/dist/Rename.js +300 -0
- package/dist/Rename.js.map +1 -0
- package/dist/ResponsiveDevicePicker.cjs.js +260 -0
- package/dist/ResponsiveDevicePicker.cjs.js.map +1 -0
- package/dist/ResponsiveDevicePicker.js +254 -0
- package/dist/ResponsiveDevicePicker.js.map +1 -0
- package/dist/Schedule.cjs.js +952 -0
- package/dist/Schedule.cjs.js.map +1 -0
- package/dist/Schedule.js +921 -0
- package/dist/Schedule.js.map +1 -0
- package/dist/Scrollable.cjs.js +184 -0
- package/dist/Scrollable.cjs.js.map +1 -0
- package/dist/Scrollable.js +178 -0
- package/dist/Scrollable.js.map +1 -0
- package/dist/ShareViaEmail.cjs.js +2992 -0
- package/dist/ShareViaEmail.cjs.js.map +1 -0
- package/dist/ShareViaEmail.js +2966 -0
- package/dist/ShareViaEmail.js.map +1 -0
- package/dist/ShareViaLink.cjs.js +1385 -0
- package/dist/ShareViaLink.cjs.js.map +1 -0
- package/dist/ShareViaLink.js +1360 -0
- package/dist/ShareViaLink.js.map +1 -0
- package/dist/Sidebar.cjs.js +32222 -0
- package/dist/Sidebar.cjs.js.map +1 -0
- package/dist/Sidebar.js +32196 -0
- package/dist/Sidebar.js.map +1 -0
- package/dist/SubHeader.cjs.js +272 -0
- package/dist/SubHeader.cjs.js.map +1 -0
- package/dist/SubHeader.js +265 -0
- package/dist/SubHeader.js.map +1 -0
- package/dist/TableWrapper.cjs.js +87 -0
- package/dist/TableWrapper.cjs.js.map +1 -0
- package/dist/TableWrapper.js +81 -0
- package/dist/TableWrapper.js.map +1 -0
- package/dist/ThemeSidebar.cjs.js +13618 -0
- package/dist/ThemeSidebar.cjs.js.map +1 -0
- package/dist/ThemeSidebar.js +13593 -0
- package/dist/ThemeSidebar.js.map +1 -0
- package/dist/TimeFormat.cjs.js +53 -0
- package/dist/TimeFormat.cjs.js.map +1 -0
- package/dist/TimeFormat.js +47 -0
- package/dist/TimeFormat.js.map +1 -0
- package/dist/TimezoneMismatchModal.cjs.js +176 -0
- package/dist/TimezoneMismatchModal.cjs.js.map +1 -0
- package/dist/TimezoneMismatchModal.js +168 -0
- package/dist/TimezoneMismatchModal.js.map +1 -0
- package/package.json +185 -0
- package/src/translations/en.json +449 -0
- package/types/BrowserSupport.d.ts +86 -0
- package/types/Columns.d.ts +53 -0
- package/types/Container.d.ts +35 -0
- package/types/CopyToClipboardButton.d.ts +21 -0
- package/types/CustomDomain.d.ts +19 -0
- package/types/CustomDomainDashboard.d.ts +33 -0
- package/types/DateFormat.d.ts +18 -0
- package/types/DateRangeFilter.d.ts +52 -0
- package/types/DynamicVariables.d.ts +45 -0
- package/types/EmailPreview.d.ts +41 -0
- package/types/ErrorPage.d.ts +15 -0
- package/types/Header.d.ts +30 -0
- package/types/IconPicker.d.ts +43 -0
- package/types/IntegrationCard.d.ts +45 -0
- package/types/IntegrationDisconnectAlert.d.ts +37 -0
- package/types/IntegrationWalkthroughModal.d.ts +31 -0
- package/types/IpRestriction.d.ts +23 -0
- package/types/KeyboardShortcuts.d.ts +147 -0
- package/types/LoginPage.d.ts +43 -0
- package/types/MenuBar.d.ts +125 -0
- package/types/NeetoWidget.d.ts +41 -0
- package/types/PageLoader.d.ts +38 -0
- package/types/PhoneNumber.d.ts +106 -0
- package/types/PublishBlock.d.ts +84 -0
- package/types/Rename.d.ts +60 -0
- package/types/ResponsiveDevicePicker.d.ts +30 -0
- package/types/Schedule.d.ts +132 -0
- package/types/Scrollable.d.ts +28 -0
- package/types/ShareViaEmail.d.ts +99 -0
- package/types/ShareViaLink.d.ts +117 -0
- package/types/Sidebar.d.ts +63 -0
- package/types/SubHeader.d.ts +97 -0
- package/types/TableWrapper.d.ts +38 -0
- package/types/TimeFormat.d.ts +17 -0
- package/types/TimezoneMismatchModal.d.ts +39 -0
- package/types/themeSidebar.d.ts +80 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TFunction } from "i18next";
|
|
3
|
+
interface Shortcut {
|
|
4
|
+
sequence: string;
|
|
5
|
+
description: TFunction;
|
|
6
|
+
}
|
|
7
|
+
interface Category {
|
|
8
|
+
[index: string]: Shortcut | string;
|
|
9
|
+
fullShortcutsLink?: string;
|
|
10
|
+
}
|
|
11
|
+
interface ShortcutsObject {
|
|
12
|
+
[index: string | TFunction]: Category;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* A common component that accept's a list of all the keyboard shortcuts in a
|
|
17
|
+
*
|
|
18
|
+
* product and renders a side panel on the right side of the screen upon pressing a
|
|
19
|
+
*
|
|
20
|
+
* defined hotkey (shift+/).
|
|
21
|
+
*
|
|
22
|
+
* 
|
|
23
|
+
*
|
|
24
|
+
* All the global shortcuts like open pane, close modal etc will be rendered by
|
|
25
|
+
*
|
|
26
|
+
* default by the component. It provides a single prop called productShortcuts
|
|
27
|
+
*
|
|
28
|
+
* which is used to pass in the product specific keyboard shortcuts. The prop's
|
|
29
|
+
*
|
|
30
|
+
* structure is given below:
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
*
|
|
34
|
+
* {
|
|
35
|
+
* [i18n.t("shortcuts.category1.categoryName")]: {
|
|
36
|
+
* shortcutName: {
|
|
37
|
+
* sequence: "command+shift+r",
|
|
38
|
+
* description: "",
|
|
39
|
+
* },
|
|
40
|
+
* },
|
|
41
|
+
* [i18n.t("shortcuts.category2.categoryName")]: {
|
|
42
|
+
* shortcutName2: {
|
|
43
|
+
* sequence: "r s",
|
|
44
|
+
* description: "",
|
|
45
|
+
* fullShortcutsLink: "www.example.com/all-shortcuts"
|
|
46
|
+
* },
|
|
47
|
+
* },
|
|
48
|
+
* }
|
|
49
|
+
* @endexample
|
|
50
|
+
* fullShortcutsLink is an optional property in the data structure which can be
|
|
51
|
+
*
|
|
52
|
+
* used to render links which points to external pages that lists all the
|
|
53
|
+
*
|
|
54
|
+
* shortcuts. This will be useful when the number of shortcuts under a category is
|
|
55
|
+
*
|
|
56
|
+
* very large.
|
|
57
|
+
*
|
|
58
|
+
* The sequence should be passed in MacOS format and the component will take care
|
|
59
|
+
*
|
|
60
|
+
* of detecting & converting it to the users platform. The component supports three
|
|
61
|
+
*
|
|
62
|
+
* kinds of sequence.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
*
|
|
66
|
+
* import KeyboardShortcuts from "@bigbinary/neeto-molecules/KeyboardShortcuts";
|
|
67
|
+
*
|
|
68
|
+
* const App = () => (
|
|
69
|
+
* <Main />
|
|
70
|
+
* <KeyboardShortcuts.Pane productShortcuts={{
|
|
71
|
+
* [i18n.t("shortcuts.tickets.categoryName")]: {
|
|
72
|
+
* openNotes: {
|
|
73
|
+
* sequence: "command+shift+r",
|
|
74
|
+
* description: i18n.t("shortcuts.tickets.openNotes"),
|
|
75
|
+
* },
|
|
76
|
+
* },
|
|
77
|
+
* }}/>
|
|
78
|
+
* )
|
|
79
|
+
* @endexample
|
|
80
|
+
* This hook can be used to manage the behavior of KeyboardShortcuts pane.
|
|
81
|
+
*
|
|
82
|
+
* This hook will return an array with exactly 2 values just like useState hook.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
*
|
|
86
|
+
* import KeyboardShortcuts from "@bigbinary/neeto-molecules/KeyboardShortcuts";
|
|
87
|
+
*
|
|
88
|
+
* const [isOpen, setIsOpen] = KeyboardShortcuts.usePaneState();
|
|
89
|
+
*
|
|
90
|
+
* return (
|
|
91
|
+
* <>
|
|
92
|
+
* <button onClick={() => setIsOpen(true)}> Open shortcuts pane</button>
|
|
93
|
+
* <button onClick={() => setIsOpen(prevIsOpen => !prevIsOpen)}>
|
|
94
|
+
* Toggle shortcuts pane
|
|
95
|
+
* </button>
|
|
96
|
+
* </>
|
|
97
|
+
* );
|
|
98
|
+
* @endexample
|
|
99
|
+
* This constant exposes the list of global shortcuts displayed by the pane to the
|
|
100
|
+
*
|
|
101
|
+
* product.
|
|
102
|
+
*
|
|
103
|
+
* It will give the following shortcuts:
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
*
|
|
107
|
+
* {
|
|
108
|
+
* GLOBAL: {
|
|
109
|
+
* openKeyboardShortcutsPane: {
|
|
110
|
+
* sequence: "shift+/",
|
|
111
|
+
* description: "See keyboard shortcuts",
|
|
112
|
+
* },
|
|
113
|
+
* close: {
|
|
114
|
+
* sequence: "esc",
|
|
115
|
+
* description: "Close modals, panes",
|
|
116
|
+
* },
|
|
117
|
+
* submitForm: {
|
|
118
|
+
* sequence: "command+return",
|
|
119
|
+
* description: "Submit form or text input",
|
|
120
|
+
* },
|
|
121
|
+
* },
|
|
122
|
+
* }
|
|
123
|
+
* @endexample
|
|
124
|
+
* It can be used by the product to implement the shortcuts without needing to
|
|
125
|
+
*
|
|
126
|
+
* define the shortcut constant again.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
*
|
|
130
|
+
* import KeyboardShortcuts from "@bigbinary/neeto-molecules/KeyboardShortcuts";
|
|
131
|
+
* import { useHotKeys } from "neetocommons/react-utils";
|
|
132
|
+
*
|
|
133
|
+
* useHotKeys(
|
|
134
|
+
* KeyboardShortcuts.GLOBAL_SHORTCUTS.GLOBAL.submitForm.sequence,
|
|
135
|
+
* keyboardShortCutHandlers.SUBMIT_FORM,
|
|
136
|
+
* { mode: "global" }
|
|
137
|
+
* );
|
|
138
|
+
* @endexample
|
|
139
|
+
*/
|
|
140
|
+
const KeyboardShortcuts: {
|
|
141
|
+
Pane: React.FC<{
|
|
142
|
+
productShortcuts?: ShortcutsObject;
|
|
143
|
+
}>;
|
|
144
|
+
usePaneState(): [boolean, React.Dispatch<React.SetStateAction<boolean>>];
|
|
145
|
+
GLOBAL_SHORTCUTS: ShortcutsObject;
|
|
146
|
+
};
|
|
147
|
+
export default KeyboardShortcuts;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A common login page for all neeto-applications with dedicated button for oliver
|
|
5
|
+
*
|
|
6
|
+
* to login.
|
|
7
|
+
*
|
|
8
|
+
* undefined
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
*
|
|
12
|
+
* import LoginPage from "@bigbinary/neeto-molecules/LoginPage";
|
|
13
|
+
*
|
|
14
|
+
* // Main.jsx
|
|
15
|
+
* export default function Main() {
|
|
16
|
+
* if (!isLoggedIn) {
|
|
17
|
+
* return <LoginPage handleSubmit={payload => sessionsApi.create(payload)} />;
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* // return main routes
|
|
21
|
+
* }
|
|
22
|
+
* @endexample
|
|
23
|
+
* The payload will be of the following format:
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
*
|
|
27
|
+
* {
|
|
28
|
+
* "user": {
|
|
29
|
+
* "email": "oliver@example.com",
|
|
30
|
+
* "password": "welcome"
|
|
31
|
+
* }
|
|
32
|
+
* }
|
|
33
|
+
* @endexample
|
|
34
|
+
*/
|
|
35
|
+
const LoginPage: React.FC<{
|
|
36
|
+
handleSubmit: (data: {
|
|
37
|
+
user: {
|
|
38
|
+
email: string;
|
|
39
|
+
password: string;
|
|
40
|
+
};
|
|
41
|
+
}) => any;
|
|
42
|
+
}>;
|
|
43
|
+
export default LoginPage;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ButtonProps, InputProps } from "@bigbinary/neetoui";
|
|
3
|
+
import { LinkProps } from "react-router-dom";
|
|
4
|
+
type BlockProps = {
|
|
5
|
+
label: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
count?: number;
|
|
9
|
+
active?: boolean;
|
|
10
|
+
onEdit?: (...args: any[]) => any;
|
|
11
|
+
onClick?: (...args: any[]) => any;
|
|
12
|
+
className?: string;
|
|
13
|
+
} & LinkProps & React.RefAttributes<HTMLAnchorElement> & React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
14
|
+
type ItemProps = {
|
|
15
|
+
label?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
active?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
} & React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
20
|
+
type SubTitleProps = {
|
|
21
|
+
iconProps?: ButtonProps[];
|
|
22
|
+
} & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
23
|
+
type SearchProps = {
|
|
24
|
+
isCollapsed?: boolean;
|
|
25
|
+
onCollapse?: React.MouseEventHandler<HTMLButtonElement>;
|
|
26
|
+
} & InputProps;
|
|
27
|
+
type AddNewProps = {
|
|
28
|
+
label?: string;
|
|
29
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
30
|
+
} & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* Used in neeto products to show a collapsible menu which can be used for adding
|
|
34
|
+
*
|
|
35
|
+
* navigation options to view different sections.
|
|
36
|
+
*
|
|
37
|
+
* 
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
*
|
|
41
|
+
* import MenuBar from "@bigbinary/neeto-molecules/MenuBar";
|
|
42
|
+
*
|
|
43
|
+
* const MenuBarContainer = ({ children }) => {
|
|
44
|
+
* return (
|
|
45
|
+
* <div>
|
|
46
|
+
* <MenuBar showMenu />
|
|
47
|
+
* </div>
|
|
48
|
+
* );
|
|
49
|
+
* };
|
|
50
|
+
* @endexample
|
|
51
|
+
* MenuBar with custom title
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
*
|
|
55
|
+
* import MenuBar from "@bigbinary/neeto-molecules/MenuBar";
|
|
56
|
+
*
|
|
57
|
+
* const MenuBarContainer = ({ children }) => {
|
|
58
|
+
* return (
|
|
59
|
+
* <div>
|
|
60
|
+
* <MenuBar showMenu title="Custom Title" />
|
|
61
|
+
* </div>
|
|
62
|
+
* );
|
|
63
|
+
* };
|
|
64
|
+
* @endexample
|
|
65
|
+
* Props for MenuBar.Block:
|
|
66
|
+
*
|
|
67
|
+
* Props for MenuBar.AddNew:
|
|
68
|
+
*
|
|
69
|
+
* Props for MenuBar.SubTitle:
|
|
70
|
+
*
|
|
71
|
+
* Props for MenuBar.Search:
|
|
72
|
+
*
|
|
73
|
+
* Props for MenuBar.Item:
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
*
|
|
77
|
+
* import MenuBar from "@bigbinary/neeto-molecules/MenuBar";
|
|
78
|
+
*
|
|
79
|
+
* const MenuBarContainer = ({ children }) => {
|
|
80
|
+
* return (
|
|
81
|
+
* <div>
|
|
82
|
+
* <MenuBar showMenu title="Custom Title">
|
|
83
|
+
* <MenuBar.Block active count={13} label="All" />
|
|
84
|
+
* <MenuBar.SubTitle
|
|
85
|
+
* iconProps={[
|
|
86
|
+
* {
|
|
87
|
+
* icon: Search,
|
|
88
|
+
* onClick: () => {},
|
|
89
|
+
* },
|
|
90
|
+
* ]}
|
|
91
|
+
* >
|
|
92
|
+
* <Typography
|
|
93
|
+
* component="h4"
|
|
94
|
+
* style="h5"
|
|
95
|
+
* textTransform="uppercase"
|
|
96
|
+
* weight="bold"
|
|
97
|
+
* >
|
|
98
|
+
* Subtitle
|
|
99
|
+
* </Typography>
|
|
100
|
+
* </MenuBar.SubTitle>
|
|
101
|
+
* <MenuBar.Search isCollapsed={isSearchCollapsed} onCollapse={() => {}} />
|
|
102
|
+
* <MenuBar.AddNew label="Add new button" />
|
|
103
|
+
* <MenuBar.Item
|
|
104
|
+
* description="An Item which can have a subheading and heading"
|
|
105
|
+
* label="Heading"
|
|
106
|
+
* />
|
|
107
|
+
* </MenuBar>
|
|
108
|
+
* </div>
|
|
109
|
+
* );
|
|
110
|
+
* };
|
|
111
|
+
* @endexample
|
|
112
|
+
*/
|
|
113
|
+
const MenuBar: React.FC<{
|
|
114
|
+
title?: string;
|
|
115
|
+
showMenu?: boolean;
|
|
116
|
+
className?: string;
|
|
117
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
118
|
+
}> & {
|
|
119
|
+
Block: React.FC<BlockProps>;
|
|
120
|
+
Item: React.FC<ItemProps>;
|
|
121
|
+
SubTitle: React.FC<SubTitleProps>;
|
|
122
|
+
Search: React.FC<SearchProps>;
|
|
123
|
+
AddNew: React.FC<AddNewProps>;
|
|
124
|
+
};
|
|
125
|
+
export default MenuBar;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type EmbedCode = React.FC<{
|
|
3
|
+
maxWidth?: string;
|
|
4
|
+
primaryApp?: string;
|
|
5
|
+
showSessionContext?: boolean;
|
|
6
|
+
showUserIdentity?: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* This component can be accessed only in SSO mode. To access the component, run
|
|
11
|
+
*
|
|
12
|
+
* neetoAuth in the background and restart the application in SSO mode.
|
|
13
|
+
*
|
|
14
|
+
* This object contains the widget names.
|
|
15
|
+
*
|
|
16
|
+
* This component can be used to render the neetoWidget embed code within any
|
|
17
|
+
*
|
|
18
|
+
* host application. It uses APIs from neeto_sso to query the apiKey from
|
|
19
|
+
*
|
|
20
|
+
* neeto-auth-web, enable/disable widgets, and to allow the user to send the
|
|
21
|
+
*
|
|
22
|
+
* embed code via email.
|
|
23
|
+
*
|
|
24
|
+
* Developers can use the props to customize the component for the host
|
|
25
|
+
*
|
|
26
|
+
* application.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
*
|
|
30
|
+
* <NeetoWidget.EmbedCode primaryApp={NeetoWidget.WIDGET_TYPES.chat} />
|
|
31
|
+
* @endexample
|
|
32
|
+
*/
|
|
33
|
+
const NeetoWidget: {
|
|
34
|
+
EmbedCode: EmbedCode;
|
|
35
|
+
WIDGET_TYPES: {
|
|
36
|
+
changelog: "changelog";
|
|
37
|
+
chat: "chat";
|
|
38
|
+
replay: "replay";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export default NeetoWidget;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Used in neeto products as the page loader to indicate that the page is being
|
|
5
|
+
*
|
|
6
|
+
* loaded.
|
|
7
|
+
*
|
|
8
|
+
* 
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
*
|
|
12
|
+
* import PageLoader from "@bigbinary/neeto-molecules/PageLoader";
|
|
13
|
+
* const PageLoaderContainer = ({ children }) => {
|
|
14
|
+
* return (
|
|
15
|
+
* <div>
|
|
16
|
+
* <PageLoader />
|
|
17
|
+
* </div>
|
|
18
|
+
* );
|
|
19
|
+
* };
|
|
20
|
+
* @endexample
|
|
21
|
+
* PageLoader with custom text
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
*
|
|
25
|
+
* import PageLoader from "@bigbinary/neeto-molecules/PageLoader";
|
|
26
|
+
* const PageLoaderContainer = ({ children }) => {
|
|
27
|
+
* return (
|
|
28
|
+
* <div>
|
|
29
|
+
* <PageLoader text="Loading..." />
|
|
30
|
+
* </div>
|
|
31
|
+
* );
|
|
32
|
+
* };
|
|
33
|
+
* @endexample
|
|
34
|
+
*/
|
|
35
|
+
const PageLoader: React.FC<{
|
|
36
|
+
text?: string;
|
|
37
|
+
}>;
|
|
38
|
+
export default PageLoader;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { InputProps, SelectProps, TypographyProps } from "@bigbinary/neetoui";
|
|
3
|
+
import { CountryCode } from "libphonenumber-js";
|
|
4
|
+
import { StringSchema } from "yup";
|
|
5
|
+
export interface PhoneNumberInputProps extends InputProps {
|
|
6
|
+
value?: string;
|
|
7
|
+
onChange?: (value: string) => any;
|
|
8
|
+
className?: string;
|
|
9
|
+
selectProps?: SelectProps;
|
|
10
|
+
error?: string;
|
|
11
|
+
defaultCountry?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface FormikPhoneNumberInputProps extends PhoneNumberInputProps {
|
|
14
|
+
name: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PhoneNumberProps extends TypographyProps {
|
|
17
|
+
className?: string;
|
|
18
|
+
defaultCountry?: string;
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
showEmoji?: boolean;
|
|
21
|
+
value?: string;
|
|
22
|
+
}
|
|
23
|
+
export const PhoneNumberInput: React.ForwardRefExoticComponent<PhoneNumberInputProps>;
|
|
24
|
+
export const FormikPhoneNumberInput: React.ForwardRefExoticComponent<FormikPhoneNumberInputProps>;
|
|
25
|
+
export
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* An input component to input and validate phone numbers with a country code
|
|
29
|
+
*
|
|
30
|
+
* picker.
|
|
31
|
+
*
|
|
32
|
+
* 
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
*
|
|
36
|
+
* import React, { useState } from "react";
|
|
37
|
+
*
|
|
38
|
+
* import { PhoneNumberInput } from "@bigbinary/neeto-molecules/PhoneNumber";
|
|
39
|
+
*
|
|
40
|
+
* const App = () => {
|
|
41
|
+
* const [phoneNumber, setPhoneNumber] = useState("");
|
|
42
|
+
*
|
|
43
|
+
* return <PhoneNumberInput value={phoneNumber} onChange={setPhoneNumber} />;
|
|
44
|
+
* };
|
|
45
|
+
* @endexample
|
|
46
|
+
* A typography component to display phone numbers along with the flag of the
|
|
47
|
+
*
|
|
48
|
+
* country associated with it.
|
|
49
|
+
*
|
|
50
|
+
* 
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
*
|
|
54
|
+
* import { PhoneNumber } from "@bigbinary/neeto-molecules/PhoneNumber";
|
|
55
|
+
*
|
|
56
|
+
* const App = () => <PhoneNumber showEmoji value="+919988776655" />;
|
|
57
|
+
* @endexample
|
|
58
|
+
* The PhoneNumberInput component wrapped in Formik.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
*
|
|
62
|
+
* import { FormikPhoneNumberInput, validation } from "@bigbinary/neeto-molecules/PhoneNumber";
|
|
63
|
+
* import { Form } from "@bigbinary/neetoui/formik";
|
|
64
|
+
*
|
|
65
|
+
* const App = () => (
|
|
66
|
+
* return (
|
|
67
|
+
* <Form
|
|
68
|
+
* formikProps={{
|
|
69
|
+
* initialValues: { phoneNumber: "+919988776655" },
|
|
70
|
+
* validationSchema: yup.object({ phoneNumber: validation().required() }),
|
|
71
|
+
* onSubmit: ({ phoneNumber }) => alert(phoneNumber),
|
|
72
|
+
* }}
|
|
73
|
+
* >
|
|
74
|
+
* <FormikPhoneNumberInput name="phoneNumber" />
|
|
75
|
+
* </Form>
|
|
76
|
+
* );
|
|
77
|
+
* );
|
|
78
|
+
* @endexample
|
|
79
|
+
* A utility function that exports a Yup validation schema to be used in Formik. It
|
|
80
|
+
*
|
|
81
|
+
* accepts a string as an optional argument to override the default validation
|
|
82
|
+
*
|
|
83
|
+
* message.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
*
|
|
87
|
+
* import { validation } from "@bigbinary/neeto-molecules/PhoneNumber";
|
|
88
|
+
* import * as yup from "yup";
|
|
89
|
+
*
|
|
90
|
+
* const VALIDATION_SCHEMA = yup.object({
|
|
91
|
+
* phoneNumber: validation("Phone number is invalid"),
|
|
92
|
+
* });
|
|
93
|
+
* @endexample
|
|
94
|
+
* A utility function to check whether a phone number is valid. It accepts a phone
|
|
95
|
+
*
|
|
96
|
+
* number and a default country as argument and returns a boolean value specifying
|
|
97
|
+
*
|
|
98
|
+
* whether the phone number is valid or not.
|
|
99
|
+
*
|
|
100
|
+
*/
|
|
101
|
+
const PhoneNumber: React.FC<PhoneNumberProps>;
|
|
102
|
+
export const isPhoneNumberValid: (phoneNumber: string, defaultCountry?: CountryCode | {
|
|
103
|
+
defaultCountry?: CountryCode;
|
|
104
|
+
defaultCallingCode?: string;
|
|
105
|
+
}) => boolean;
|
|
106
|
+
export const validation: (message?: string) => StringSchema<any, any, any>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AlertProps } from "@bigbinary/neetoui";
|
|
3
|
+
interface PublishBlockProps {
|
|
4
|
+
renderDraftButtons: (props: {
|
|
5
|
+
ViewDraftButton: JSX.Element;
|
|
6
|
+
ResetDraftButton: JSX.Element;
|
|
7
|
+
}) => React.ReactNode;
|
|
8
|
+
renderPublishButtons: (props: {
|
|
9
|
+
PublishButton: JSX.Element;
|
|
10
|
+
PublishPreviewButton: JSX.Element;
|
|
11
|
+
}) => React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* A common component to manage draft and publish versions.
|
|
16
|
+
*
|
|
17
|
+
* 
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
*
|
|
21
|
+
* import PublishBlock from "@bigbinary/neeto-molecules/PublishBlock";
|
|
22
|
+
*
|
|
23
|
+
* const PublishActionBlock = (
|
|
24
|
+
* {
|
|
25
|
+
* //all variables used in the below example can be passed as props or can be defined in the component itself
|
|
26
|
+
* }
|
|
27
|
+
* ) => {
|
|
28
|
+
* const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>
|
|
29
|
+
* !isDraftBlockHidden && (
|
|
30
|
+
* <>
|
|
31
|
+
* <ViewDraftButton to={previewDraftUrl} />
|
|
32
|
+
* {hasDraftVersion && <ResetDraftButton onClick={handleResetDraft} />}
|
|
33
|
+
* </>
|
|
34
|
+
* );
|
|
35
|
+
*
|
|
36
|
+
* const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (
|
|
37
|
+
* <>
|
|
38
|
+
* <PublishButton disabled={isPublishDisabled} onClick={handlePublish} />
|
|
39
|
+
* <PublishPreviewButton
|
|
40
|
+
* disabled={isPublishPreviewDisabled}
|
|
41
|
+
* to={previewPublishedUrl}
|
|
42
|
+
* />
|
|
43
|
+
* </>
|
|
44
|
+
* );
|
|
45
|
+
* return (
|
|
46
|
+
* <PublishBlock
|
|
47
|
+
* renderDraftButtons={renderDraftButtons}
|
|
48
|
+
* renderPublishButtons={renderPublishButtons}
|
|
49
|
+
* />
|
|
50
|
+
* );
|
|
51
|
+
* };
|
|
52
|
+
* @endexample
|
|
53
|
+
* This optional component can be used to render the reset alert modal for
|
|
54
|
+
*
|
|
55
|
+
* discarding draft.
|
|
56
|
+
*
|
|
57
|
+
* It also accepts all other alert props.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
*
|
|
61
|
+
* import PublishBlock from "@bigbinary/neeto-molecules/PublishBlock";
|
|
62
|
+
*
|
|
63
|
+
* const PublishActionBlock = (
|
|
64
|
+
* {
|
|
65
|
+
* //all variables used in the below example can be passed as props or can be defined in the component itself
|
|
66
|
+
* }
|
|
67
|
+
* ) => {
|
|
68
|
+
* return (
|
|
69
|
+
* <PublishBlock.Alert
|
|
70
|
+
* isOpen={isResetDraftAlertOpen}
|
|
71
|
+
* message="Leaving this page will delete all unpublished changes."
|
|
72
|
+
* title="Are you sure you want to discard changes?"
|
|
73
|
+
* onClose={() => setIsResetDraftAlertOpen(false)}
|
|
74
|
+
* onSubmit={action("handleReset")}
|
|
75
|
+
* //other alert props can also be passed
|
|
76
|
+
* />
|
|
77
|
+
* );
|
|
78
|
+
* };
|
|
79
|
+
* @endexample
|
|
80
|
+
*/
|
|
81
|
+
const PublishBlock: React.FC<PublishBlockProps> & {
|
|
82
|
+
Alert: React.FC<AlertProps>;
|
|
83
|
+
};
|
|
84
|
+
export default PublishBlock;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ButtonProps, InputProps, TypographyProps } from "@bigbinary/neetoui";
|
|
2
|
+
import React from "react";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* The Rename component is used to rename a resource on the page, It can be used as
|
|
6
|
+
*
|
|
7
|
+
* the title in the Header component and provides props for additional actions with
|
|
8
|
+
*
|
|
9
|
+
* the dropdown.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
*
|
|
13
|
+
* import Rename from "@bigbinary/neeto-molecules/Rename";
|
|
14
|
+
*
|
|
15
|
+
* const App = () => {
|
|
16
|
+
* const [value, setValue] = useState("Name");
|
|
17
|
+
* return (
|
|
18
|
+
* <Rename
|
|
19
|
+
* value={value}
|
|
20
|
+
* placeholder="Enter a name"
|
|
21
|
+
* dropdownItems={[
|
|
22
|
+
* {
|
|
23
|
+
* label: "Clone",
|
|
24
|
+
* onClick: () => alert("Clicked on clone"),
|
|
25
|
+
* },
|
|
26
|
+
* ]}
|
|
27
|
+
* onRename={value => setValue(name)}
|
|
28
|
+
* breadcrumbs={[
|
|
29
|
+
* {
|
|
30
|
+
* label: "Home",
|
|
31
|
+
* link: "home",
|
|
32
|
+
* },
|
|
33
|
+
* {
|
|
34
|
+
* label: "Contacts",
|
|
35
|
+
* link: "contacts",
|
|
36
|
+
* },
|
|
37
|
+
* ]}
|
|
38
|
+
* />
|
|
39
|
+
* );
|
|
40
|
+
* };
|
|
41
|
+
* @endexample
|
|
42
|
+
*/
|
|
43
|
+
const Rename: React.FC<{
|
|
44
|
+
className?: string;
|
|
45
|
+
isOpen?: boolean;
|
|
46
|
+
value: string;
|
|
47
|
+
onRename?: (newName: string) => void;
|
|
48
|
+
isUpdating?: boolean;
|
|
49
|
+
placeholder?: string;
|
|
50
|
+
hideMenu?: boolean;
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
dropdownItems?: ButtonProps[];
|
|
53
|
+
textProps?: TypographyProps;
|
|
54
|
+
inputProps?: InputProps;
|
|
55
|
+
breadcrumbs?: {
|
|
56
|
+
text: string;
|
|
57
|
+
link: string;
|
|
58
|
+
}[];
|
|
59
|
+
}>;
|
|
60
|
+
export default Rename;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type SelectedDeviceState = "desktop" | "tablet" | "mobile";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* A common component to switch between different device resolutions.
|
|
6
|
+
*
|
|
7
|
+
* 
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
*
|
|
11
|
+
* import ResponsiveDevicePicker from "@bigbinary/neeto-molecules/ResponsiveDevicePicker";
|
|
12
|
+
*
|
|
13
|
+
* const ResponsiveDevicePickerContainer = ({}) => {
|
|
14
|
+
* const [selectedDevice, setSelectedDevice] = useState("desktop");
|
|
15
|
+
*
|
|
16
|
+
* return (
|
|
17
|
+
* <ResponsiveDevicePicker
|
|
18
|
+
* selectedDevice={selectedDevice}
|
|
19
|
+
* onDeviceChange={setSelectedDevice}
|
|
20
|
+
* />
|
|
21
|
+
* );
|
|
22
|
+
* };
|
|
23
|
+
* @endexample
|
|
24
|
+
*/
|
|
25
|
+
const ResponsiveDevicePicker: React.FC<{
|
|
26
|
+
className?: string;
|
|
27
|
+
selectedDevice?: SelectedDeviceState;
|
|
28
|
+
onDeviceChange?: (device: SelectedDeviceState) => void;
|
|
29
|
+
}>;
|
|
30
|
+
export default ResponsiveDevicePicker;
|