@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.
Files changed (183) hide show
  1. package/README.md +60 -0
  2. package/dist/BrowserSupport.cjs.js +1727 -0
  3. package/dist/BrowserSupport.cjs.js.map +1 -0
  4. package/dist/BrowserSupport.js +1721 -0
  5. package/dist/BrowserSupport.js.map +1 -0
  6. package/dist/Columns.cjs.js +191 -0
  7. package/dist/Columns.cjs.js.map +1 -0
  8. package/dist/Columns.js +184 -0
  9. package/dist/Columns.js.map +1 -0
  10. package/dist/Container.cjs.js +1277 -0
  11. package/dist/Container.cjs.js.map +1 -0
  12. package/dist/Container.js +1271 -0
  13. package/dist/Container.js.map +1 -0
  14. package/dist/CopyToClipboardButton.cjs.js +78 -0
  15. package/dist/CopyToClipboardButton.cjs.js.map +1 -0
  16. package/dist/CopyToClipboardButton.js +72 -0
  17. package/dist/CopyToClipboardButton.js.map +1 -0
  18. package/dist/CustomDomain.cjs.js +680 -0
  19. package/dist/CustomDomain.cjs.js.map +1 -0
  20. package/dist/CustomDomain.js +654 -0
  21. package/dist/CustomDomain.js.map +1 -0
  22. package/dist/CustomDomainDashboard.cjs.js +2306 -0
  23. package/dist/CustomDomainDashboard.cjs.js.map +1 -0
  24. package/dist/CustomDomainDashboard.js +2279 -0
  25. package/dist/CustomDomainDashboard.js.map +1 -0
  26. package/dist/DateFormat.cjs.js +51 -0
  27. package/dist/DateFormat.cjs.js.map +1 -0
  28. package/dist/DateFormat.js +45 -0
  29. package/dist/DateFormat.js.map +1 -0
  30. package/dist/DateRangeFilter.cjs.js +236 -0
  31. package/dist/DateRangeFilter.cjs.js.map +1 -0
  32. package/dist/DateRangeFilter.js +229 -0
  33. package/dist/DateRangeFilter.js.map +1 -0
  34. package/dist/DynamicVariables.cjs.js +112 -0
  35. package/dist/DynamicVariables.cjs.js.map +1 -0
  36. package/dist/DynamicVariables.js +106 -0
  37. package/dist/DynamicVariables.js.map +1 -0
  38. package/dist/EmailPreview.cjs.js +102 -0
  39. package/dist/EmailPreview.cjs.js.map +1 -0
  40. package/dist/EmailPreview.js +96 -0
  41. package/dist/EmailPreview.js.map +1 -0
  42. package/dist/ErrorPage.cjs.js +208 -0
  43. package/dist/ErrorPage.cjs.js.map +1 -0
  44. package/dist/ErrorPage.js +184 -0
  45. package/dist/ErrorPage.js.map +1 -0
  46. package/dist/Header.cjs.js +219 -0
  47. package/dist/Header.cjs.js.map +1 -0
  48. package/dist/Header.js +213 -0
  49. package/dist/Header.js.map +1 -0
  50. package/dist/IconPicker.cjs.js +1307 -0
  51. package/dist/IconPicker.cjs.js.map +1 -0
  52. package/dist/IconPicker.js +1301 -0
  53. package/dist/IconPicker.js.map +1 -0
  54. package/dist/IntegrationCard.cjs.js +75 -0
  55. package/dist/IntegrationCard.cjs.js.map +1 -0
  56. package/dist/IntegrationCard.js +69 -0
  57. package/dist/IntegrationCard.js.map +1 -0
  58. package/dist/IntegrationDisconnectAlert.cjs.js +81 -0
  59. package/dist/IntegrationDisconnectAlert.cjs.js.map +1 -0
  60. package/dist/IntegrationDisconnectAlert.js +75 -0
  61. package/dist/IntegrationDisconnectAlert.js.map +1 -0
  62. package/dist/IntegrationWalkthroughModal.cjs.js +42 -0
  63. package/dist/IntegrationWalkthroughModal.cjs.js.map +1 -0
  64. package/dist/IntegrationWalkthroughModal.js +36 -0
  65. package/dist/IntegrationWalkthroughModal.js.map +1 -0
  66. package/dist/IpRestriction.cjs.js +3764 -0
  67. package/dist/IpRestriction.cjs.js.map +1 -0
  68. package/dist/IpRestriction.js +3738 -0
  69. package/dist/IpRestriction.js.map +1 -0
  70. package/dist/KeyboardShortcuts.cjs.js +2242 -0
  71. package/dist/KeyboardShortcuts.cjs.js.map +1 -0
  72. package/dist/KeyboardShortcuts.js +2235 -0
  73. package/dist/KeyboardShortcuts.js.map +1 -0
  74. package/dist/LoginPage.cjs.js +618 -0
  75. package/dist/LoginPage.cjs.js.map +1 -0
  76. package/dist/LoginPage.js +593 -0
  77. package/dist/LoginPage.js.map +1 -0
  78. package/dist/MenuBar.cjs.js +31044 -0
  79. package/dist/MenuBar.cjs.js.map +1 -0
  80. package/dist/MenuBar.js +31038 -0
  81. package/dist/MenuBar.js.map +1 -0
  82. package/dist/NeetoWidget.cjs.js +3369 -0
  83. package/dist/NeetoWidget.cjs.js.map +1 -0
  84. package/dist/NeetoWidget.js +3343 -0
  85. package/dist/NeetoWidget.js.map +1 -0
  86. package/dist/PageLoader.cjs.js +158 -0
  87. package/dist/PageLoader.cjs.js.map +1 -0
  88. package/dist/PageLoader.js +134 -0
  89. package/dist/PageLoader.js.map +1 -0
  90. package/dist/PhoneNumber.cjs.js +7021 -0
  91. package/dist/PhoneNumber.cjs.js.map +1 -0
  92. package/dist/PhoneNumber.js +6989 -0
  93. package/dist/PhoneNumber.js.map +1 -0
  94. package/dist/PublishBlock.cjs.js +189 -0
  95. package/dist/PublishBlock.cjs.js.map +1 -0
  96. package/dist/PublishBlock.js +183 -0
  97. package/dist/PublishBlock.js.map +1 -0
  98. package/dist/Rename.cjs.js +306 -0
  99. package/dist/Rename.cjs.js.map +1 -0
  100. package/dist/Rename.js +300 -0
  101. package/dist/Rename.js.map +1 -0
  102. package/dist/ResponsiveDevicePicker.cjs.js +260 -0
  103. package/dist/ResponsiveDevicePicker.cjs.js.map +1 -0
  104. package/dist/ResponsiveDevicePicker.js +254 -0
  105. package/dist/ResponsiveDevicePicker.js.map +1 -0
  106. package/dist/Schedule.cjs.js +952 -0
  107. package/dist/Schedule.cjs.js.map +1 -0
  108. package/dist/Schedule.js +921 -0
  109. package/dist/Schedule.js.map +1 -0
  110. package/dist/Scrollable.cjs.js +184 -0
  111. package/dist/Scrollable.cjs.js.map +1 -0
  112. package/dist/Scrollable.js +178 -0
  113. package/dist/Scrollable.js.map +1 -0
  114. package/dist/ShareViaEmail.cjs.js +2992 -0
  115. package/dist/ShareViaEmail.cjs.js.map +1 -0
  116. package/dist/ShareViaEmail.js +2966 -0
  117. package/dist/ShareViaEmail.js.map +1 -0
  118. package/dist/ShareViaLink.cjs.js +1385 -0
  119. package/dist/ShareViaLink.cjs.js.map +1 -0
  120. package/dist/ShareViaLink.js +1360 -0
  121. package/dist/ShareViaLink.js.map +1 -0
  122. package/dist/Sidebar.cjs.js +32222 -0
  123. package/dist/Sidebar.cjs.js.map +1 -0
  124. package/dist/Sidebar.js +32196 -0
  125. package/dist/Sidebar.js.map +1 -0
  126. package/dist/SubHeader.cjs.js +272 -0
  127. package/dist/SubHeader.cjs.js.map +1 -0
  128. package/dist/SubHeader.js +265 -0
  129. package/dist/SubHeader.js.map +1 -0
  130. package/dist/TableWrapper.cjs.js +87 -0
  131. package/dist/TableWrapper.cjs.js.map +1 -0
  132. package/dist/TableWrapper.js +81 -0
  133. package/dist/TableWrapper.js.map +1 -0
  134. package/dist/ThemeSidebar.cjs.js +13618 -0
  135. package/dist/ThemeSidebar.cjs.js.map +1 -0
  136. package/dist/ThemeSidebar.js +13593 -0
  137. package/dist/ThemeSidebar.js.map +1 -0
  138. package/dist/TimeFormat.cjs.js +53 -0
  139. package/dist/TimeFormat.cjs.js.map +1 -0
  140. package/dist/TimeFormat.js +47 -0
  141. package/dist/TimeFormat.js.map +1 -0
  142. package/dist/TimezoneMismatchModal.cjs.js +176 -0
  143. package/dist/TimezoneMismatchModal.cjs.js.map +1 -0
  144. package/dist/TimezoneMismatchModal.js +168 -0
  145. package/dist/TimezoneMismatchModal.js.map +1 -0
  146. package/package.json +185 -0
  147. package/src/translations/en.json +449 -0
  148. package/types/BrowserSupport.d.ts +86 -0
  149. package/types/Columns.d.ts +53 -0
  150. package/types/Container.d.ts +35 -0
  151. package/types/CopyToClipboardButton.d.ts +21 -0
  152. package/types/CustomDomain.d.ts +19 -0
  153. package/types/CustomDomainDashboard.d.ts +33 -0
  154. package/types/DateFormat.d.ts +18 -0
  155. package/types/DateRangeFilter.d.ts +52 -0
  156. package/types/DynamicVariables.d.ts +45 -0
  157. package/types/EmailPreview.d.ts +41 -0
  158. package/types/ErrorPage.d.ts +15 -0
  159. package/types/Header.d.ts +30 -0
  160. package/types/IconPicker.d.ts +43 -0
  161. package/types/IntegrationCard.d.ts +45 -0
  162. package/types/IntegrationDisconnectAlert.d.ts +37 -0
  163. package/types/IntegrationWalkthroughModal.d.ts +31 -0
  164. package/types/IpRestriction.d.ts +23 -0
  165. package/types/KeyboardShortcuts.d.ts +147 -0
  166. package/types/LoginPage.d.ts +43 -0
  167. package/types/MenuBar.d.ts +125 -0
  168. package/types/NeetoWidget.d.ts +41 -0
  169. package/types/PageLoader.d.ts +38 -0
  170. package/types/PhoneNumber.d.ts +106 -0
  171. package/types/PublishBlock.d.ts +84 -0
  172. package/types/Rename.d.ts +60 -0
  173. package/types/ResponsiveDevicePicker.d.ts +30 -0
  174. package/types/Schedule.d.ts +132 -0
  175. package/types/Scrollable.d.ts +28 -0
  176. package/types/ShareViaEmail.d.ts +99 -0
  177. package/types/ShareViaLink.d.ts +117 -0
  178. package/types/Sidebar.d.ts +63 -0
  179. package/types/SubHeader.d.ts +97 -0
  180. package/types/TableWrapper.d.ts +38 -0
  181. package/types/TimeFormat.d.ts +17 -0
  182. package/types/TimezoneMismatchModal.d.ts +39 -0
  183. package/types/themeSidebar.d.ts +80 -0
@@ -0,0 +1,132 @@
1
+ import React from "react";
2
+ /**
3
+ *
4
+ * It is a component which allows setting working hours for the week.
5
+ *
6
+ * ![image](https://user-images.githubusercontent.com/35630321/198989580-36a91233-8e7b-4300-b980-f50d2b0efcaa.png|height=200|width=300)
7
+ *
8
+ * How to Reset Form from outside Schedule Component:
9
+ *
10
+ * How to get the form errors from outside Schedule Component:
11
+ *
12
+ * This is the data structure for the periods prop:
13
+ *
14
+ * @example
15
+ *
16
+ * const periods = {
17
+ * sunday: [],
18
+ * monday: [
19
+ * {
20
+ * id: "cf329f59-cbcb-445b-b567-ad04a2813b8c",
21
+ * periodableType: "Availability",
22
+ * periodableId: "2b9d8d31-8928-4f8e-87d2-8e8989b5be72",
23
+ * wday: "monday",
24
+ * period: null,
25
+ * createdAt: "2022-10-31T07:07:44.796Z",
26
+ * updatedAt: "2022-10-31T07:07:44.796Z",
27
+ * startTime: "09:00 AM",
28
+ * endTime: "05:00 PM",
29
+ * },
30
+ * {
31
+ * id: "9ad79a58-1a0f-4ee7-b540-d86d55765874",
32
+ * periodableType: "Availability",
33
+ * periodableId: "2b9d8d31-8928-4f8e-87d2-8e8989b5be72",
34
+ * wday: "monday",
35
+ * period: null,
36
+ * createdAt: "2022-10-31T07:07:44.801Z",
37
+ * updatedAt: "2022-10-31T07:07:44.801Z",
38
+ * startTime: "06:00 PM",
39
+ * endTime: "07:00 PM",
40
+ * },
41
+ * ],
42
+ * tuesday: [
43
+ * {
44
+ * id: "8cd6d2c6-50f5-436f-89f5-35db1a4c44bb",
45
+ * periodableType: "Availability",
46
+ * periodableId: "2b9d8d31-8928-4f8e-87d2-8e8989b5be72",
47
+ * wday: "tuesday",
48
+ * period: null,
49
+ * createdAt: "2022-10-31T07:07:44.806Z",
50
+ * updatedAt: "2022-10-31T07:07:44.806Z",
51
+ * startTime: "09:00 AM",
52
+ * endTime: "05:00 PM",
53
+ * },
54
+ * ],
55
+ * wednesday: [
56
+ * {
57
+ * id: "1ea6c1b7-2fdb-4b2b-b35a-dc75f58cb84d",
58
+ * periodableType: "Availability",
59
+ * periodableId: "2b9d8d31-8928-4f8e-87d2-8e8989b5be72",
60
+ * wday: "wednesday",
61
+ * period: null,
62
+ * createdAt: "2022-10-31T07:07:44.810Z",
63
+ * updatedAt: "2022-10-31T07:07:44.810Z",
64
+ * startTime: "09:00 AM",
65
+ * endTime: "05:00 PM",
66
+ * },
67
+ * ],
68
+ * thursday: [
69
+ * {
70
+ * id: "a9b5ea22-4765-4db2-b0f8-78aa1dd458f2",
71
+ * periodableType: "Availability",
72
+ * periodableId: "2b9d8d31-8928-4f8e-87d2-8e8989b5be72",
73
+ * wday: "thursday",
74
+ * period: null,
75
+ * createdAt: "2022-10-31T07:07:44.812Z",
76
+ * updatedAt: "2022-10-31T07:07:44.812Z",
77
+ * startTime: "09:00 AM",
78
+ * endTime: "05:00 PM",
79
+ * },
80
+ * ],
81
+ * friday: [
82
+ * {
83
+ * id: "b1e4852c-d91f-419e-bb95-1ead12da69b2",
84
+ * periodableType: "Availability",
85
+ * periodableId: "2b9d8d31-8928-4f8e-87d2-8e8989b5be72",
86
+ * wday: "friday",
87
+ * period: null,
88
+ * createdAt: "2022-10-31T07:07:44.823Z",
89
+ * updatedAt: "2022-10-31T07:07:44.823Z",
90
+ * startTime: "09:00 AM",
91
+ * endTime: "05:00 PM",
92
+ * },
93
+ * ],
94
+ * saturday: [],
95
+ * };
96
+ * @endexample
97
+ * @example
98
+ *
99
+ * import React, { useState } from "react";
100
+ * import Schedule from "@bigbinary/neeto-molecules/Schedule";
101
+ * import { periods } from "constants";
102
+ *
103
+ * const App = () => {
104
+ * const [isEditing, setIsEditing] = useState(false);
105
+ *
106
+ * return (
107
+ * <div>
108
+ * <Schedule
109
+ * handleSubmit={value => {
110
+ * setIsEditing(false);
111
+ * }}
112
+ * isEditing={isEditing}
113
+ * periods={periods}
114
+ * setIsEditing={setIsEditing}
115
+ * />
116
+ * </div>
117
+ * );
118
+ * };
119
+ * @endexample
120
+ */
121
+ const Schedule: React.FC<{
122
+ isEditing?: boolean;
123
+ setIsEditing?: React.Dispatch<React.SetStateAction<boolean>>;
124
+ handleSubmit?: Function;
125
+ handleValuesChanged?: Function;
126
+ showHeader?: boolean;
127
+ periods: {
128
+ [key: string]: Array<any>;
129
+ };
130
+ ref?: React.MutableRefObject;
131
+ }>;
132
+ export default Schedule;
@@ -0,0 +1,28 @@
1
+ import { SIZES } from "components/Scrollable/constants";
2
+ import React from "react";
3
+ /**
4
+ *
5
+ * The Scrollable component can be used along with the Header and SubHeader to show
6
+ *
7
+ * large tables or UI that needs scrolling. It provides a scrollable container in
8
+ *
9
+ * the remaining space.
10
+ *
11
+ * @example
12
+ *
13
+ * import Scrollable from "@bigbinary/neeto-molecules/Scrollable";
14
+ *
15
+ * const App = () => (
16
+ * <Scrollable>
17
+ * {[...Array(20)].map((_, i) => (
18
+ * <DummyCard key={i} />
19
+ * ))}
20
+ * </Scrollable>
21
+ * );
22
+ * @endexample
23
+ */
24
+ const Scrollable: React.FC<{
25
+ className?: string;
26
+ size?: keyof typeof SIZES;
27
+ } & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
28
+ export default Scrollable;
@@ -0,0 +1,99 @@
1
+ import React from "react";
2
+ /**
3
+ *
4
+ * A common component to share entities via email.
5
+ *
6
+ * ![ShareViaEmail](https://user-images.githubusercontent.com/66865722/229559580-b58d4418-8b03-4afc-9f63-c2dfa756c0fa.png|height=200|width=300)
7
+ *
8
+ * Simple:
9
+ *
10
+ * @example
11
+ *
12
+ * import React from "react";
13
+ * import ShareViaEmail from "@bigbinary/neeto-molecules/ShareViaEmail";
14
+ * import Scrollable from "@bigbinary/neeto-molecules/Scrollable";
15
+ *
16
+ * const ShareViaEmail = () => {
17
+ * const handleSubmit = () => {
18
+ * //api call
19
+ * };
20
+ *
21
+ * return (
22
+ * <Scrollable className="flex w-full flex-col p-0">
23
+ * <ShareViaEmail
24
+ * backToUrl="/home/share"
25
+ * handleSubmit={handleSubmit}
26
+ * description="Share form via email"
27
+ * />
28
+ * </Scrollable>
29
+ * );
30
+ * };
31
+ * export default ShareViaEmail;
32
+ * @endexample
33
+ * With children and EmailPreview props:
34
+ *
35
+ * @example
36
+ *
37
+ * import React, {useState} from "react";
38
+ * import ShareViaEmail from "@bigbinary/neeto-molecules/ShareViaEmail";
39
+ * import Scrollable from "@bigbinary/neeto-molecules/Scrollable";
40
+ *
41
+ * const ShareViaEmail = () => {
42
+ * const [startButtonText, setStartButtonText] = useState("")
43
+ *
44
+ * const handleSubmit = () => {
45
+ * //custom validations and API call
46
+ * };
47
+ *
48
+ * const StartButtonText => (
49
+ * //input field
50
+ * )
51
+ *
52
+ * return (
53
+ * <Scrollable className="flex w-full flex-col p-0">
54
+ * <ShareViaEmail
55
+ * backToUrl="/home/share"
56
+ * handleSubmit={handleSubmit}
57
+ * productName="Form"
58
+ * >
59
+ * <StartButtonText />
60
+ * {other child components}
61
+ * </ShareViaEmail>
62
+ * </Scrollable>
63
+ * );
64
+ * };
65
+ * export default ShareViaEmail;
66
+ * @endexample
67
+ */
68
+ const ShareViaEmail: React.FC<{
69
+ backToUrl?: string;
70
+ children?: React.ReactNode;
71
+ description?: string;
72
+ disableReplyTo?: boolean;
73
+ productName?: string;
74
+ defaultValues?: {
75
+ sendFromEmail?: string;
76
+ replyToEmail?: string;
77
+ emailSubject?: string;
78
+ emailBody?: string;
79
+ actionButtonText?: string;
80
+ };
81
+ handleSubmit: (data: {
82
+ sendFromEmail: string;
83
+ replyToEmail: string;
84
+ notifyEmails: {
85
+ label: string;
86
+ value: string;
87
+ valid: boolean;
88
+ }[];
89
+ emailSubject: string;
90
+ emailBody: string;
91
+ isSendLaterEnabled: boolean;
92
+ sendEmailDatetime: string;
93
+ category: string;
94
+ actionButtonText: string;
95
+ }) => void;
96
+ showVideoEmbedInEditor?: boolean;
97
+ title?: string;
98
+ }>;
99
+ export default ShareViaEmail;
@@ -0,0 +1,117 @@
1
+ import React from "react";
2
+ /**
3
+ *
4
+ * A common component to share the link in multiple ways.
5
+ *
6
+ * ![ShareViaLink](https://user-images.githubusercontent.com/54279092/220558650-b00669cf-1b59-4fff-8b21-10d12f801939.png|height=200|width=300)
7
+ *
8
+ * Regenerate URL enabled
9
+ *
10
+ * @example
11
+ *
12
+ * import { useRegenerateUrl } from "hooks/reactQuery/useQuizzesApi";
13
+ * import ShareViaLink from "@bigbinary/neeto-molecules/ShareViaLink";
14
+ *
15
+ * const Share = ({ quiz }) => {
16
+ * const { mutate: regenerateURL, isLoading: isRegenerating } =
17
+ * useRegenerateUrl();
18
+ *
19
+ * return (
20
+ * <ShareViaLink
21
+ * enabledOptions={{ regenerate: true }}
22
+ * entity={quiz}
23
+ * entityName="quiz"
24
+ * handleRegenerate={regenerateURL}
25
+ * isLoading={isRegenerating}
26
+ * socialMediaPostTitle="Hi, can you please attend this quiz?"
27
+ * url={quizUrl}
28
+ * />
29
+ * );
30
+ * };
31
+ * @endexample
32
+ * Regenerate URL and Edit URL enabled
33
+ *
34
+ * @example
35
+ *
36
+ * import { useRegenerateUrl, useUpdateUrl } from "hooks/reactQuery/useQuizzesApi";
37
+ * import ShareViaLink from "@bigbinary/neeto-molecules/ShareViaLink";
38
+ *
39
+ * const Share = ({ quiz }) => {
40
+ * const { mutate: regenerateURL, isLoading: isRegenerating } =
41
+ * useRegenerateUrl();
42
+ *
43
+ * const { mutate: updateUrl, isLoading: isUpdating } = useUpdateUrl();
44
+ *
45
+ * return (
46
+ * <ShareViaLink
47
+ * editUrlProps={{
48
+ * prefix: `${window.location.origin}/`,
49
+ * editablePath: window.location.pathname,
50
+ * }}
51
+ * enabledOptions={{ regenerate: true, edit: true }}
52
+ * entity={quiz}
53
+ * entityName="quiz"
54
+ * handleEdit={updateUrl}
55
+ * handleRegenerate={regenerateURL}
56
+ * isLoading={isRegenerating || isUpdating}
57
+ * socialMediaPostTitle="Hi, can you please attend this quiz?"
58
+ * url={quizUrl}
59
+ * />
60
+ * );
61
+ * };
62
+ * @endexample
63
+ * Regenerate URL and Edit URL disabled
64
+ *
65
+ * @example
66
+ *
67
+ * import ShareViaLink from "@bigbinary/neeto-molecules/ShareViaLink";
68
+ *
69
+ * const Share = ({ quiz }) => (
70
+ * <ShareViaLink
71
+ * entity={quiz}
72
+ * entityName="quiz"
73
+ * socialMediaPostTitle="Hi, can you please attend this quiz?"
74
+ * url={quizUrl}
75
+ * />
76
+ * );
77
+ * @endexample
78
+ * With preview URL
79
+ *
80
+ * @example
81
+ *
82
+ * import ShareViaLink from "@bigbinary/neeto-molecules/ShareViaLink";
83
+ *
84
+ * const Share = ({ quiz }) => (
85
+ * <ShareViaLink
86
+ * entity={quiz}
87
+ * entityName="quiz"
88
+ * previewUrl={quizPreviewUrl}
89
+ * socialMediaPostTitle="Hi, can you please attend this quiz?"
90
+ * url={quizUrl}
91
+ * />
92
+ * );
93
+ * @endexample
94
+ */
95
+ const ShareViaLink: React.FC<{
96
+ isLoading?: boolean;
97
+ editUrlProps?: {
98
+ prefix?: string;
99
+ editablePath?: string;
100
+ maxLength?: number;
101
+ };
102
+ enabledOptions?: {
103
+ regenerate?: boolean;
104
+ edit?: boolean;
105
+ };
106
+ entity: {
107
+ id: string;
108
+ name: string;
109
+ };
110
+ entityName: string;
111
+ handleEdit?: Function;
112
+ handleRegenerate?: Function;
113
+ previewUrl?: string;
114
+ socialMediaPostTitle: string;
115
+ url: string;
116
+ }>;
117
+ export default ShareViaLink;
@@ -0,0 +1,63 @@
1
+ import React from "react";
2
+ import { NavLinkProps } from "react-router-dom";
3
+ import { AvatarProps } from "@bigbinary/neetoui";
4
+ type NavLinkItemType = {
5
+ to: string;
6
+ label?: React.ReactNode;
7
+ icon?: any;
8
+ description?: React.ReactNode;
9
+ } & React.PropsWithoutRef<NavLinkProps<any>> & React.RefAttributes<HTMLAnchorElement>;
10
+ type LinkType = {
11
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
12
+ label?: React.ReactNode;
13
+ icon?: any;
14
+ } & React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
15
+ interface ProfileInfo {
16
+ name?: string;
17
+ email?: string;
18
+ topLinks?: LinkType[];
19
+ bottomLinks?: LinkType[];
20
+ customContent?: React.ReactNode;
21
+ changelogProps?: LinkType;
22
+ helpProps?: LinkType;
23
+ }
24
+ interface HelpLinks {
25
+ liveChatProps?: LinkType;
26
+ helpCenterProps?: LinkType;
27
+ changelogProps?: LinkType;
28
+ keyboardShortcutProps?: LinkType;
29
+ }
30
+ /**
31
+ *
32
+ * Used in neeto products for showing options like: settings, profile, whats new,
33
+ *
34
+ * app switcher etc. App switcher UI & Changelog display UI are all implemented
35
+ *
36
+ * internally in this component.
37
+ *
38
+ * ![image](https://user-images.githubusercontent.com/29166133/220422846-7cb06cd1-396c-4f5e-b493-531c96c70e43.png|height=200|width=300)
39
+ *
40
+ * @example
41
+ *
42
+ * import Sidebar from "@bigbinary/neeto-molecules/Sidebar";
43
+ * import { SIDEBAR_LINKS } from "components/constants";
44
+ *
45
+ * const SidebarContainer = ({ children }) => {
46
+ * // custom app logic
47
+ * return (
48
+ * <div>
49
+ * <Sidebar showAppSwitcher={false} navLinks={SIDEBAR_LINKS} />
50
+ * {children}
51
+ * </div>
52
+ * );
53
+ * };
54
+ * @endexample
55
+ */
56
+ const Sidebar: React.FC<{
57
+ navLinks?: NavLinkItemType[];
58
+ profileInfoOverrides?: ProfileInfo & AvatarProps;
59
+ helpLinkOverrides?: HelpLinks;
60
+ extraTopLinks?: LinkType[];
61
+ showAppSwitcher?: boolean;
62
+ }>;
63
+ export default Sidebar;
@@ -0,0 +1,97 @@
1
+ import React from "react";
2
+ import { CheckboxProps, DropdownProps, InputProps } from "neetoui";
3
+ import { Filters } from "neetofilters";
4
+ type ColumnData = {
5
+ dataIndex: string;
6
+ title: string;
7
+ key: string;
8
+ };
9
+ type DownloadButtonProps = {
10
+ count?: number;
11
+ onClick: () => void;
12
+ "data-cy"?: string;
13
+ };
14
+ type ColumnsButtonProps = {
15
+ onChange: (columns: ColumnData[]) => void;
16
+ actionBlock?: React.ReactNode;
17
+ checkboxProps?: Partial<CheckboxProps>;
18
+ columnData?: ColumnData[];
19
+ dropdownProps?: Partial<DropdownProps>;
20
+ fixedColumns?: string[];
21
+ isSearchable?: boolean;
22
+ localStorageKey?: string;
23
+ initialValue?: string[];
24
+ noColumnMessage?: string;
25
+ searchProps?: Partial<InputProps>;
26
+ };
27
+ interface RightBlockComposition {
28
+ RightBlock: React.FC<{
29
+ downloadButtonProps?: DownloadButtonProps;
30
+ filterProps?: React.ComponentProps<typeof Filters>;
31
+ columnsButtonProps?: ColumnsButtonProps;
32
+ }>;
33
+ }
34
+ /**
35
+ *
36
+ * The SubHeader component is used alongside the header component to display
37
+ *
38
+ * additional information or actions.
39
+ *
40
+ * @example
41
+ *
42
+ * import SubHeader from "@bigbinary/neeto-molecules/SubHeader";
43
+ *
44
+ * const App = () => (
45
+ * <SubHeader
46
+ * leftActionBlock={
47
+ * <Typography component="h4" style="h4">
48
+ * 118 Contacts
49
+ * </Typography>
50
+ * }
51
+ * rightActionBlock={
52
+ * <>
53
+ * <Button icon={Delete} label="Delete" style="secondary" />
54
+ * <Button label="Disable" style="secondary" />
55
+ * </>
56
+ * }
57
+ * />
58
+ * );
59
+ * @endexample
60
+ * @example
61
+ *
62
+ * import SubHeader from "@bigbinary/neeto-molecules/SubHeader";
63
+ *
64
+ * const App = () => (
65
+ * <SubHeader
66
+ * leftActionBlock={
67
+ * <Typography component="h4" style="h4">
68
+ * 118 Contacts
69
+ * </Typography>
70
+ * }
71
+ * rightActionBlock={
72
+ * <SubHeader.RightBlock
73
+ * downloadButtonProps={{
74
+ * onClick: download(),
75
+ * }}
76
+ * filterProps={
77
+ * {
78
+ * NeetoFilters props
79
+ * }
80
+ * }
81
+ * columnsButtonProps={
82
+ * {
83
+ * Columns props
84
+ * }
85
+ * }
86
+ * />
87
+ * }
88
+ * />
89
+ * );
90
+ * @endexample
91
+ */
92
+ const SubHeader: React.FC<{
93
+ className?: string;
94
+ leftActionBlock?: React.ReactNode;
95
+ rightActionBlock?: React.ReactNode;
96
+ }> & RightBlockComposition;
97
+ export default SubHeader;
@@ -0,0 +1,38 @@
1
+ import React from "react";
2
+ /**
3
+ *
4
+ * TableWrapper is used to wrap the table component. It is used to avoid the
5
+ *
6
+ * dynamic height calculation and inconsistency in heights for the parent container
7
+ *
8
+ * of the table component. TableWrapper is used to wrap the table component. It is
9
+ *
10
+ * used to avoid the dynamic height calculation and inconsistency in heights for
11
+ *
12
+ * the parent container of the table component.
13
+ *
14
+ * TableWrapper should be used only with Tables used in the listing layout as shown
15
+ *
16
+ * below.
17
+ *
18
+ * @example
19
+ *
20
+ * import TableWrapper from "@bigbinary/neeto-molecules/TableWrapper";
21
+ *
22
+ * const App = () => (
23
+ * <Container>
24
+ * <Header />
25
+ * <SubHeader />
26
+ * <TableWrapper>
27
+ * <Table columnData={columnData} rowData={rowData} />
28
+ * </TableWrapper>
29
+ * </Container>
30
+ * );
31
+ * @endexample
32
+ */
33
+ const TableWrapper: React.FC<{
34
+ hasPagination?: boolean;
35
+ className?: string;
36
+ children: React.ReactNode;
37
+ }>;
38
+ export default TableWrapper;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+
3
+ import { TooltipProps, TypographyProps } from "@bigbinary/neetoui";
4
+ import {
5
+ timeFormat,
6
+ DateTimeType,
7
+ } from "@bigbinary/neeto-commons-frontend/utils";
8
+
9
+ const TimeFormat: {
10
+ [key in Capitalize<keyof typeof timeFormat>]: React.FC<{
11
+ date: DateTimeType;
12
+ typographyProps?: Partial<TypographyProps>;
13
+ tooltipProps?: Partial<TooltipProps>;
14
+ }>;
15
+ };
16
+
17
+ export default TimeFormat;
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ /**
3
+ *
4
+ * A modal to show when the user's timezone is different from the timezone of the
5
+ *
6
+ * browser. The user can choose to continue with the users timezone or update the
7
+ *
8
+ * user timezone to the browsers's timezone.
9
+ *
10
+ * @example
11
+ *
12
+ * import TimezoneMismatchModal from "@bigbinary/neeto-molecules/TimezoneMismatchModal";
13
+ *
14
+ * const App = () => (
15
+ * <div>
16
+ * <TimezoneMismatchModal />
17
+ * </div>
18
+ * );
19
+ * @endexample
20
+ * To control the visibility of the modal, use the isOpen prop. You can also pass
21
+ *
22
+ * a callback to the onClose prop to be called when the modal is closed. Usage:
23
+ *
24
+ * @example
25
+ *
26
+ * import TimezoneMismatchModal from "@bigbinary/neeto-molecules/TimezoneMismatchModal";
27
+ *
28
+ * const App = () => (
29
+ * <div>
30
+ * <TimezoneMismatchModal isOpen={true} onClose={() => {}} />
31
+ * </div>
32
+ * );
33
+ * @endexample
34
+ */
35
+ const TimezoneMismatchModal: React.FC<{
36
+ isOpen?: boolean;
37
+ onClose?: Function;
38
+ }>;
39
+ export default TimezoneMismatchModal;