@bigbinary/neeto-molecules 1.0.13 → 1.0.14
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/DateRangeFilter.cjs.js +1 -1
- package/dist/DateRangeFilter.js +1 -1
- package/dist/NeetoWidget.cjs.js +3 -3
- package/dist/NeetoWidget.js +3 -3
- package/dist/Schedule.cjs.js +1 -1
- package/dist/Schedule.js +1 -1
- package/package.json +7 -5
- package/src/translations/en.json +1 -1
- package/types/BrowserSupport.d.ts +40 -3
- package/types/Columns.d.ts +66 -3
- package/types/Container.d.ts +31 -3
- package/types/CustomDomain.d.ts +30 -4
- package/types/DateRangeFilter.d.ts +40 -5
- package/types/DynamicVariables.d.ts +32 -5
- package/types/EmailPreview.d.ts +37 -3
- package/types/ErrorPage.d.ts +14 -3
- package/types/IpRestriction.d.ts +21 -3
- package/types/KeyboardShortcuts.d.ts +84 -5
- package/types/LoginPage.d.ts +36 -3
- package/types/MenuBar.d.ts +80 -27
- package/types/NeetoWidget.d.ts +24 -5
- package/types/PageLoader.d.ts +35 -4
- package/types/PublishBlock.d.ts +57 -5
- package/types/Schedule.d.ts +126 -3
- package/types/Scrollable.d.ts +25 -9
- package/types/ShareViaEmail.d.ts +73 -4
- package/types/ShareViaLink.d.ts +63 -3
- package/types/Sidebar.d.ts +27 -4
- package/types/TimeFormat.d.ts +14 -2
- package/types/TimezoneMismatchModal.d.ts +34 -3
|
@@ -1,17 +1,52 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
2
|
import { Dayjs } from "dayjs";
|
|
4
|
-
|
|
5
3
|
interface TimePeriodType {
|
|
6
4
|
startDate: Dayjs;
|
|
7
5
|
endDate: Dayjs;
|
|
8
6
|
rangeType: string;
|
|
9
7
|
}
|
|
10
|
-
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* A common component to manage your date range filters.
|
|
11
|
+
*
|
|
12
|
+
* 
|
|
13
|
+
*
|
|
14
|
+
* 
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* import DateRangeFilter from "@bigbinary/neeto-molecules/DateRangeFilter";
|
|
19
|
+
* const DateRangeFilterActionBlock = (
|
|
20
|
+
* {
|
|
21
|
+
* //pass the necessary props
|
|
22
|
+
* }
|
|
23
|
+
* ) => {
|
|
24
|
+
* const [timePeriod, setTimePeriod] = useState(INITIAL_TIME_PERIOD_VALUE);
|
|
25
|
+
* //INITIAL_TIME_PERIOD_VALUE will be an object with label,value and rangeType as keys
|
|
26
|
+
* return (
|
|
27
|
+
* <DateRangeFilter
|
|
28
|
+
* timePeriod={timePeriod}
|
|
29
|
+
* setTimePeriod={setTimePeriod}
|
|
30
|
+
* timePeriodOptions={[
|
|
31
|
+
* {
|
|
32
|
+
* label: "New filter label",
|
|
33
|
+
* value: {startDate: pass dayjs object , endDate: pass dayjs object , rangeType: "new_range_type"},
|
|
34
|
+
* },
|
|
35
|
+
* ]} // pass this prop only if you want to override default filters available
|
|
36
|
+
* />
|
|
37
|
+
* );
|
|
38
|
+
* };
|
|
39
|
+
* @endexample
|
|
40
|
+
* Note: The value of timePeriod state will contain the startDate, endDate and
|
|
41
|
+
*
|
|
42
|
+
* range_type of the selected filter. This can be passed into the filterParams of
|
|
43
|
+
*
|
|
44
|
+
* your API.
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
11
47
|
const DateRangeFilter: React.FC<{
|
|
12
48
|
timePeriod: TimePeriodType;
|
|
13
49
|
setTimePeriod: React.Dispatch<React.SetStateAction<TimePeriodType>>;
|
|
14
50
|
timePeriodOptions: TimePeriodType[];
|
|
15
51
|
}>;
|
|
16
|
-
|
|
17
|
-
export default DateRangeFilter;
|
|
52
|
+
export default DateRangeFilter;
|
|
@@ -1,18 +1,45 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DropdownProps } from "@bigbinary/neetoui";
|
|
3
|
-
|
|
4
3
|
interface Variable {
|
|
5
4
|
label?: string;
|
|
6
5
|
key?: string;
|
|
7
6
|
value?: string;
|
|
8
7
|
category?: string;
|
|
9
|
-
variables?: Omit<Variable, "variables">[]
|
|
8
|
+
variables?: Omit<Variable, "variables">[];
|
|
10
9
|
}
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* A common component for using dynamic variables.
|
|
13
|
+
*
|
|
14
|
+
* 
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* import DynamicVariables from "@bigbinary/neeto-molecules/DynamicVariables";
|
|
19
|
+
* import { Input } from "neetoui/formik";
|
|
20
|
+
*
|
|
21
|
+
* const DynamicVariablesDemo = () => {
|
|
22
|
+
* return (
|
|
23
|
+
* <Input
|
|
24
|
+
* label="Input with DynamicVariables"
|
|
25
|
+
* name="subject"
|
|
26
|
+
* suffix={
|
|
27
|
+
* <Variables
|
|
28
|
+
* dropdownProps={{ buttonStyle: "text" }}
|
|
29
|
+
* variables={EDITOR_VARIABLES}
|
|
30
|
+
* onVariableClick={variable => {
|
|
31
|
+
* console.log(variable);
|
|
32
|
+
* }}
|
|
33
|
+
* />
|
|
34
|
+
* }
|
|
35
|
+
* />
|
|
36
|
+
* );
|
|
37
|
+
* };
|
|
38
|
+
* @endexample
|
|
39
|
+
*/
|
|
12
40
|
const DynamicVariables: React.FC<{
|
|
13
41
|
onVariableClick?: (variable: Variable) => void;
|
|
14
42
|
variables: Variable[];
|
|
15
43
|
dropdownProps?: DropdownProps;
|
|
16
44
|
}>;
|
|
17
|
-
|
|
18
|
-
export default DynamicVariables;
|
|
45
|
+
export default DynamicVariables;
|
package/types/EmailPreview.d.ts
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A common component to preview emails.
|
|
5
|
+
*
|
|
6
|
+
* 
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
*
|
|
10
|
+
* ["oliver@example.com", "eve@example.com"]
|
|
11
|
+
* @endexample
|
|
12
|
+
* Simple:
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
*
|
|
16
|
+
* import React from "react";
|
|
17
|
+
* import { useFormikContext } from "formik";
|
|
18
|
+
* import EmailPreview from "@bigbinary/neeto-molecules/EmailPreview";
|
|
19
|
+
* const EmailShare = () => {
|
|
20
|
+
* const { values } = useFormikContext();
|
|
21
|
+
* return (
|
|
22
|
+
* <div>
|
|
23
|
+
* <EmailPreview
|
|
24
|
+
* actionButtonText={values.startSurveyButtonText}
|
|
25
|
+
* body={values.emailBody}
|
|
26
|
+
* subject={values.emailSubject}
|
|
27
|
+
* logo={values.logo}
|
|
28
|
+
* to={values.notifyEmails}
|
|
29
|
+
* from={values.emailsFrom}
|
|
30
|
+
* productName="Form"
|
|
31
|
+
* />
|
|
32
|
+
* </div>
|
|
33
|
+
* );
|
|
34
|
+
* };
|
|
35
|
+
* export default EmailShare;
|
|
36
|
+
* @endexample
|
|
37
|
+
*/
|
|
3
38
|
const EmailPreview: React.FC<{
|
|
4
39
|
to?: string[];
|
|
5
40
|
subject?: string;
|
|
@@ -9,5 +44,4 @@ const EmailPreview: React.FC<{
|
|
|
9
44
|
productName?: string;
|
|
10
45
|
actionButtonText?: string;
|
|
11
46
|
}>;
|
|
12
|
-
|
|
13
|
-
export default EmailPreview;
|
|
47
|
+
export default EmailPreview;
|
package/types/ErrorPage.d.ts
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A fallback page for handling 404, 403 and 500 errors.
|
|
5
|
+
*
|
|
6
|
+
* This component accepts two optional props status and homeUrl. status is
|
|
7
|
+
*
|
|
8
|
+
* the status code of the error. 404 is the default value for status. homeUrl
|
|
9
|
+
*
|
|
10
|
+
* is the URL to which the user will be taken to when user clicks on back to home
|
|
11
|
+
*
|
|
12
|
+
* button. / is the default value for homeUrl.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
3
15
|
const ErrorPage: React.FC<{
|
|
4
16
|
homeUrl?: string;
|
|
5
17
|
status?: number;
|
|
6
18
|
}>;
|
|
7
|
-
|
|
8
|
-
export default ErrorPage;
|
|
19
|
+
export default ErrorPage;
|
package/types/IpRestriction.d.ts
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* A common component to restrict IPs in neeto applications.
|
|
5
|
+
*
|
|
6
|
+
* 
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
*
|
|
10
|
+
* import IpRestriction from "@bigbinary/neeto-molecules/IpRestriction";
|
|
11
|
+
*
|
|
12
|
+
* const IpRestrictionSetting = () => (
|
|
13
|
+
* <Container isHeaderFixed className="w-full">
|
|
14
|
+
* <Header title="IP Restrictions" />
|
|
15
|
+
* <Scrollable className="w-full">
|
|
16
|
+
* <IpRestriction />
|
|
17
|
+
* </Scrollable>
|
|
18
|
+
* </Container>
|
|
19
|
+
* );
|
|
20
|
+
* @endexample
|
|
21
|
+
*/
|
|
3
22
|
const IpRestriction: React.FC<{}>;
|
|
4
|
-
|
|
5
|
-
export default IpRestriction;
|
|
23
|
+
export default IpRestriction;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TFunction } from "i18next";
|
|
3
|
-
|
|
4
3
|
interface Shortcut {
|
|
5
4
|
sequence: string;
|
|
6
5
|
description: TFunction;
|
|
@@ -12,12 +11,92 @@ interface Category {
|
|
|
12
11
|
interface ProductShortcuts {
|
|
13
12
|
[index: string | TFunction]: Category;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
* All the global shortcuts like open pane, close modal etc will be rendered by
|
|
23
|
+
*
|
|
24
|
+
* default by the component. It provides a single prop called productShortcuts
|
|
25
|
+
*
|
|
26
|
+
* which is used to pass in the product specific keyboard shortcuts. The prop's
|
|
27
|
+
*
|
|
28
|
+
* structure is given below:
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
*
|
|
32
|
+
* {
|
|
33
|
+
* [i18n.t("shortcuts.category1.categoryName")]: {
|
|
34
|
+
* shortcutName: {
|
|
35
|
+
* sequence: "command+shift+r",
|
|
36
|
+
* description: "",
|
|
37
|
+
* },
|
|
38
|
+
* },
|
|
39
|
+
* [i18n.t("shortcuts.category2.categoryName")]: {
|
|
40
|
+
* shortcutName2: {
|
|
41
|
+
* sequence: "r s",
|
|
42
|
+
* description: "",
|
|
43
|
+
* fullShortcutsLink: "www.example.com/all-shortcuts"
|
|
44
|
+
* },
|
|
45
|
+
* },
|
|
46
|
+
* }
|
|
47
|
+
* @endexample
|
|
48
|
+
* fullShortcutsLink is an optional property in the data structure which can be
|
|
49
|
+
*
|
|
50
|
+
* used to render links which points to external pages that lists all the
|
|
51
|
+
*
|
|
52
|
+
* shortcuts. This will be useful when the number of shortcuts under a category is
|
|
53
|
+
*
|
|
54
|
+
* very large.
|
|
55
|
+
*
|
|
56
|
+
* The sequence should be passed in MacOS format and the component will take care
|
|
57
|
+
*
|
|
58
|
+
* of detecting & converting it to the users platform. The component supports three
|
|
59
|
+
*
|
|
60
|
+
* kinds of sequence.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
*
|
|
64
|
+
* import KeyboardShortcuts from "@bigbinary/neeto-molecules/KeyboardShortcuts";
|
|
65
|
+
*
|
|
66
|
+
* const App = () => (
|
|
67
|
+
* <Main />
|
|
68
|
+
* <KeyboardShortcuts.Pane productShortcuts={{
|
|
69
|
+
* [i18n.t("shortcuts.tickets.categoryName")]: {
|
|
70
|
+
* openNotes: {
|
|
71
|
+
* sequence: "command+shift+r",
|
|
72
|
+
* description: i18n.t("shortcuts.tickets.openNotes"),
|
|
73
|
+
* },
|
|
74
|
+
* },
|
|
75
|
+
* }}/>
|
|
76
|
+
* )
|
|
77
|
+
* @endexample
|
|
78
|
+
* This hook can be used to manage the behavior of KeyboardShortcuts pane.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
*
|
|
82
|
+
* import KeyboardShortcuts from "@bigbinary/neeto-molecules/KeyboardShortcuts";
|
|
83
|
+
*
|
|
84
|
+
* const [isOpen, setIsOpen] = KeyboardShortcuts.usePaneState();
|
|
85
|
+
*
|
|
86
|
+
* return (
|
|
87
|
+
* <>
|
|
88
|
+
* <button onClick={() => setIsOpen(true)}> Open shortcuts pane</button>
|
|
89
|
+
* <button onClick={() => setIsOpen(prevIsOpen => !prevIsOpen)}>
|
|
90
|
+
* Toggle shortcuts pane
|
|
91
|
+
* </button>
|
|
92
|
+
* </>
|
|
93
|
+
* );
|
|
94
|
+
* @endexample
|
|
95
|
+
*/
|
|
96
|
+
const KeyboardShortcuts: {
|
|
17
97
|
Pane: React.FC<{
|
|
18
98
|
productShortcuts?: ProductShortcuts;
|
|
19
99
|
}>;
|
|
20
100
|
usePaneState(): [boolean, React.Dispatch<React.SetStateAction<boolean>>];
|
|
21
101
|
};
|
|
22
|
-
|
|
23
|
-
export default KeyboardShortcutsPane;
|
|
102
|
+
export default KeyboardShortcuts;
|
package/types/LoginPage.d.ts
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
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
|
+
* Usage:
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
*
|
|
14
|
+
* import LoginPage from "@bigbinary/neeto-molecules/LoginPage";
|
|
15
|
+
*
|
|
16
|
+
* // Main.jsx
|
|
17
|
+
* export default function Main() {
|
|
18
|
+
* if (!isLoggedIn) {
|
|
19
|
+
* return <LoginPage handleSubmit={payload => sessionsApi.create(payload)} />;
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* // return main routes
|
|
23
|
+
* }
|
|
24
|
+
* @endexample
|
|
25
|
+
* The payload will be of the following format:
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
*
|
|
29
|
+
* {
|
|
30
|
+
* "user": {
|
|
31
|
+
* "email": "oliver@example.com",
|
|
32
|
+
* "password": "welcome"
|
|
33
|
+
* }
|
|
34
|
+
* }
|
|
35
|
+
* @endexample
|
|
36
|
+
*/
|
|
3
37
|
const LoginPage: React.FC<{
|
|
4
38
|
handleSubmit: (data: {
|
|
5
39
|
user: {
|
|
@@ -8,5 +42,4 @@ const LoginPage: React.FC<{
|
|
|
8
42
|
};
|
|
9
43
|
}) => any;
|
|
10
44
|
}>;
|
|
11
|
-
|
|
12
|
-
export default LoginPage;
|
|
45
|
+
export default LoginPage;
|
package/types/MenuBar.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ButtonProps, InputProps } from "@bigbinary/neetoui";
|
|
3
3
|
import { LinkProps } from "react-router-dom";
|
|
4
|
-
|
|
5
4
|
type BlockProps = {
|
|
6
5
|
label: string;
|
|
7
6
|
url?: string;
|
|
@@ -11,44 +10,99 @@ type BlockProps = {
|
|
|
11
10
|
onEdit?: (...args: any[]) => any;
|
|
12
11
|
onClick?: (...args: any[]) => any;
|
|
13
12
|
className?: string;
|
|
14
|
-
} & LinkProps &
|
|
15
|
-
React.RefAttributes<HTMLAnchorElement> &
|
|
16
|
-
React.DetailedHTMLProps<
|
|
17
|
-
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
18
|
-
HTMLButtonElement
|
|
19
|
-
>;
|
|
20
|
-
|
|
13
|
+
} & LinkProps & React.RefAttributes<HTMLAnchorElement> & React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
21
14
|
type ItemProps = {
|
|
22
15
|
label?: string;
|
|
23
16
|
description?: string;
|
|
24
17
|
active?: boolean;
|
|
25
18
|
className?: string;
|
|
26
|
-
} & React.DetailedHTMLProps<
|
|
27
|
-
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
28
|
-
HTMLButtonElement
|
|
29
|
-
>;
|
|
30
|
-
|
|
19
|
+
} & React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
31
20
|
type SubTitleProps = {
|
|
32
21
|
iconProps?: ButtonProps[];
|
|
33
|
-
} & React.DetailedHTMLProps<
|
|
34
|
-
React.HTMLAttributes<HTMLDivElement>,
|
|
35
|
-
HTMLDivElement
|
|
36
|
-
>;
|
|
37
|
-
|
|
22
|
+
} & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
38
23
|
type SearchProps = {
|
|
39
24
|
isCollapsed?: boolean;
|
|
40
25
|
onCollapse?: React.MouseEventHandler<HTMLButtonElement>;
|
|
41
26
|
} & InputProps;
|
|
42
|
-
|
|
43
27
|
type AddNewProps = {
|
|
44
28
|
label?: string;
|
|
45
29
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
46
|
-
} & React.DetailedHTMLProps<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
+
* MenuBar with child components
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
*
|
|
69
|
+
* import MenuBar from "@bigbinary/neeto-molecules/MenuBar";
|
|
70
|
+
*
|
|
71
|
+
* const MenuBarContainer = ({ children }) => {
|
|
72
|
+
* return (
|
|
73
|
+
* <div>
|
|
74
|
+
* <MenuBar showMenu title="Custom Title">
|
|
75
|
+
* <MenuBar.Block active count={13} label="All" />
|
|
76
|
+
* <MenuBar.SubTitle
|
|
77
|
+
* iconProps={[
|
|
78
|
+
* {
|
|
79
|
+
* icon: Search,
|
|
80
|
+
* onClick: () => {},
|
|
81
|
+
* },
|
|
82
|
+
* ]}
|
|
83
|
+
* >
|
|
84
|
+
* <Typography
|
|
85
|
+
* component="h4"
|
|
86
|
+
* style="h5"
|
|
87
|
+
* textTransform="uppercase"
|
|
88
|
+
* weight="bold"
|
|
89
|
+
* >
|
|
90
|
+
* Subtitle
|
|
91
|
+
* </Typography>
|
|
92
|
+
* </MenuBar.SubTitle>
|
|
93
|
+
* <MenuBar.Search collapse={isSearchCollapsed} onCollapse={() => {}} />
|
|
94
|
+
* <MenuBar.AddNew label="Add new button" />
|
|
95
|
+
* <MenuBar.Item
|
|
96
|
+
* description="An Item which can have a subheading and heading"
|
|
97
|
+
* label="Heading"
|
|
98
|
+
* />
|
|
99
|
+
* </MenuBar>
|
|
100
|
+
* </div>
|
|
101
|
+
* );
|
|
102
|
+
* };
|
|
103
|
+
* @endexample
|
|
104
|
+
*/
|
|
105
|
+
const MenuBar: React.FC<{
|
|
52
106
|
title?: string;
|
|
53
107
|
showMenu?: boolean;
|
|
54
108
|
className?: string;
|
|
@@ -60,5 +114,4 @@ const Menubar: React.FC<{
|
|
|
60
114
|
Search: React.FC<SearchProps>;
|
|
61
115
|
AddNew: React.FC<AddNewProps>;
|
|
62
116
|
};
|
|
63
|
-
|
|
64
|
-
export default Menubar;
|
|
117
|
+
export default MenuBar;
|
package/types/NeetoWidget.d.ts
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
2
|
type EmbedCode = React.FC<{
|
|
4
3
|
primaryApp?: string;
|
|
5
|
-
initialSelectedWidgets?: string[];
|
|
6
4
|
}>;
|
|
7
|
-
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* This object contains the widget names.
|
|
8
|
+
*
|
|
9
|
+
* This component can be used to render the neetoWidget embed code within any
|
|
10
|
+
*
|
|
11
|
+
* host application. It uses APIs from neeto_sso to query the apiKey from
|
|
12
|
+
*
|
|
13
|
+
* neeto-auth-web, enable/disable widgets, and to allow the user to send the
|
|
14
|
+
*
|
|
15
|
+
* embed code via email.
|
|
16
|
+
*
|
|
17
|
+
* Developers can use the props to customize the component for the host
|
|
18
|
+
*
|
|
19
|
+
* application.
|
|
20
|
+
*
|
|
21
|
+
* Usage:
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
*
|
|
25
|
+
* <NeetoWidget.EmbedCode primaryApp={NeetoWidget.WIDGET_TYPES.chat} />
|
|
26
|
+
* @endexample
|
|
27
|
+
*/
|
|
8
28
|
const NeetoWidget: {
|
|
9
29
|
EmbedCode: EmbedCode;
|
|
10
30
|
WIDGET_TYPES: {
|
|
@@ -13,5 +33,4 @@ const NeetoWidget: {
|
|
|
13
33
|
replay: "replay";
|
|
14
34
|
};
|
|
15
35
|
};
|
|
16
|
-
|
|
17
|
-
export default NeetoWidget;
|
|
36
|
+
export default NeetoWidget;
|
package/types/PageLoader.d.ts
CHANGED
|
@@ -1,7 +1,38 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
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
|
+
*/
|
|
3
35
|
const PageLoader: React.FC<{
|
|
4
|
-
|
|
36
|
+
text?: string;
|
|
5
37
|
}>;
|
|
6
|
-
|
|
7
|
-
export default PageLoader;
|
|
38
|
+
export default PageLoader;
|
package/types/PublishBlock.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
2
|
import { AlertProps } from "@bigbinary/neetoui";
|
|
4
|
-
|
|
5
3
|
interface PublishBlockProps {
|
|
6
4
|
renderDraftButtons: (props: {
|
|
7
5
|
ViewDraftButton: JSX.Element;
|
|
@@ -12,9 +10,63 @@ interface PublishBlockProps {
|
|
|
12
10
|
PublishPreviewButton: JSX.Element;
|
|
13
11
|
}) => React.ReactNode;
|
|
14
12
|
}
|
|
15
|
-
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* A common component to manage draft and publish versions.
|
|
16
|
+
*
|
|
17
|
+
* 
|
|
18
|
+
*
|
|
19
|
+
* This optional component can be used to render the reset alert modal for
|
|
20
|
+
*
|
|
21
|
+
* discarding draft.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
*
|
|
25
|
+
* import PublishBlock from "@bigbinary/neeto-molecules/PublishBlock";
|
|
26
|
+
*
|
|
27
|
+
* const PublishActionBlock = (
|
|
28
|
+
* {
|
|
29
|
+
* //all variables used in the below example can be passed as props or can be defined in the component itself
|
|
30
|
+
* }
|
|
31
|
+
* ) => {
|
|
32
|
+
* const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>
|
|
33
|
+
* !isDraftBlockHidden && (
|
|
34
|
+
* <>
|
|
35
|
+
* <ViewDraftButton to={previewDraftUrl} />
|
|
36
|
+
* {hasDraftVersion && <ResetDraftButton onClick={handleResetDraft} />}
|
|
37
|
+
* </>
|
|
38
|
+
* );
|
|
39
|
+
*
|
|
40
|
+
* const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (
|
|
41
|
+
* <>
|
|
42
|
+
* <PublishButton disabled={isPublishDisabled} onClick={handlePublish} />
|
|
43
|
+
* <PublishPreviewButton
|
|
44
|
+
* disabled={isPublishPreviewDisabled}
|
|
45
|
+
* to={previewPublishedUrl}
|
|
46
|
+
* />
|
|
47
|
+
* </>
|
|
48
|
+
* );
|
|
49
|
+
* return (
|
|
50
|
+
* <>
|
|
51
|
+
* <PublishBlock
|
|
52
|
+
* renderDraftButtons={renderDraftButtons}
|
|
53
|
+
* renderPublishButtons={renderPublishButtons}
|
|
54
|
+
* />
|
|
55
|
+
*
|
|
56
|
+
* <PublishBlock.Alert
|
|
57
|
+
* isOpen={isResetDraftAlertOpen}
|
|
58
|
+
* message="Leaving this page will delete all unpublished changes."
|
|
59
|
+
* title="Are you sure you want to discard changes?"
|
|
60
|
+
* onClose={() => setIsResetDraftAlertOpen(false)}
|
|
61
|
+
* onSubmit={action("handleReset")}
|
|
62
|
+
* //other alert props can also be passed
|
|
63
|
+
* />
|
|
64
|
+
* </>
|
|
65
|
+
* );
|
|
66
|
+
* };
|
|
67
|
+
* @endexample
|
|
68
|
+
*/
|
|
16
69
|
const PublishBlock: React.FC<PublishBlockProps> & {
|
|
17
70
|
Alert: React.FC<AlertProps>;
|
|
18
71
|
};
|
|
19
|
-
|
|
20
|
-
export default PublishBlock;
|
|
72
|
+
export default PublishBlock;
|