@knocklabs/react 0.1.0

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 (194) hide show
  1. package/README.md +114 -0
  2. package/dist/cjs/index.css +1 -0
  3. package/dist/cjs/index.js +2 -0
  4. package/dist/cjs/index.js.map +1 -0
  5. package/dist/cjs/modules/core/components/Button/Button.js +2 -0
  6. package/dist/cjs/modules/core/components/Button/Button.js.map +1 -0
  7. package/dist/cjs/modules/core/components/Button/ButtonGroup.js +2 -0
  8. package/dist/cjs/modules/core/components/Button/ButtonGroup.js.map +1 -0
  9. package/dist/cjs/modules/core/components/Button/ButtonSpinner.js +2 -0
  10. package/dist/cjs/modules/core/components/Button/ButtonSpinner.js.map +1 -0
  11. package/dist/cjs/modules/core/components/Button/styles.css.js +2 -0
  12. package/dist/cjs/modules/core/components/Button/styles.css.js.map +1 -0
  13. package/dist/cjs/modules/core/components/Icons/Bell.js +2 -0
  14. package/dist/cjs/modules/core/components/Icons/Bell.js.map +1 -0
  15. package/dist/cjs/modules/core/components/Icons/CheckmarkCircle.js +2 -0
  16. package/dist/cjs/modules/core/components/Icons/CheckmarkCircle.js.map +1 -0
  17. package/dist/cjs/modules/core/components/Icons/ChevronDown.js +2 -0
  18. package/dist/cjs/modules/core/components/Icons/ChevronDown.js.map +1 -0
  19. package/dist/cjs/modules/core/components/Icons/CloseCircle.js +2 -0
  20. package/dist/cjs/modules/core/components/Icons/CloseCircle.js.map +1 -0
  21. package/dist/cjs/modules/core/components/Spinner/Spinner.js +13 -0
  22. package/dist/cjs/modules/core/components/Spinner/Spinner.js.map +1 -0
  23. package/dist/cjs/modules/core/hooks/useComponentVisible.js +2 -0
  24. package/dist/cjs/modules/core/hooks/useComponentVisible.js.map +1 -0
  25. package/dist/cjs/modules/core/hooks/useOnBottomScroll.js +2 -0
  26. package/dist/cjs/modules/core/hooks/useOnBottomScroll.js.map +1 -0
  27. package/dist/cjs/modules/feed/components/EmptyFeed/EmptyFeed.js +2 -0
  28. package/dist/cjs/modules/feed/components/EmptyFeed/EmptyFeed.js.map +1 -0
  29. package/dist/cjs/modules/feed/components/EmptyFeed/styles.css.js +2 -0
  30. package/dist/cjs/modules/feed/components/EmptyFeed/styles.css.js.map +1 -0
  31. package/dist/cjs/modules/feed/components/NotificationCell/ArchiveButton.js +2 -0
  32. package/dist/cjs/modules/feed/components/NotificationCell/ArchiveButton.js.map +1 -0
  33. package/dist/cjs/modules/feed/components/NotificationCell/Avatar.js +2 -0
  34. package/dist/cjs/modules/feed/components/NotificationCell/Avatar.js.map +1 -0
  35. package/dist/cjs/modules/feed/components/NotificationCell/NotificationCell.js +2 -0
  36. package/dist/cjs/modules/feed/components/NotificationCell/NotificationCell.js.map +1 -0
  37. package/dist/cjs/modules/feed/components/NotificationCell/styles.css.js +2 -0
  38. package/dist/cjs/modules/feed/components/NotificationCell/styles.css.js.map +1 -0
  39. package/dist/cjs/modules/feed/components/NotificationFeed/Dropdown.js +2 -0
  40. package/dist/cjs/modules/feed/components/NotificationFeed/Dropdown.js.map +1 -0
  41. package/dist/cjs/modules/feed/components/NotificationFeed/MarkAsRead.js +2 -0
  42. package/dist/cjs/modules/feed/components/NotificationFeed/MarkAsRead.js.map +1 -0
  43. package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeed.js +2 -0
  44. package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeed.js.map +1 -0
  45. package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeedHeader.js +2 -0
  46. package/dist/cjs/modules/feed/components/NotificationFeed/NotificationFeedHeader.js.map +1 -0
  47. package/dist/cjs/modules/feed/components/NotificationFeed/styles.css.js +2 -0
  48. package/dist/cjs/modules/feed/components/NotificationFeed/styles.css.js.map +1 -0
  49. package/dist/cjs/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.js +2 -0
  50. package/dist/cjs/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.js.map +1 -0
  51. package/dist/cjs/modules/feed/components/NotificationFeedPopover/styles.css.js +2 -0
  52. package/dist/cjs/modules/feed/components/NotificationFeedPopover/styles.css.js.map +1 -0
  53. package/dist/cjs/modules/feed/components/NotificationIconButton/NotificationIconButton.js +2 -0
  54. package/dist/cjs/modules/feed/components/NotificationIconButton/NotificationIconButton.js.map +1 -0
  55. package/dist/cjs/modules/feed/components/NotificationIconButton/styles.css.js +2 -0
  56. package/dist/cjs/modules/feed/components/NotificationIconButton/styles.css.js.map +1 -0
  57. package/dist/cjs/modules/feed/components/UnseenBadge/UnseenBadge.js +2 -0
  58. package/dist/cjs/modules/feed/components/UnseenBadge/UnseenBadge.js.map +1 -0
  59. package/dist/cjs/modules/feed/components/UnseenBadge/styles.css.js +2 -0
  60. package/dist/cjs/modules/feed/components/UnseenBadge/styles.css.js.map +1 -0
  61. package/dist/cjs/theme.css.js +2 -0
  62. package/dist/cjs/theme.css.js.map +1 -0
  63. package/dist/esm/index.mjs +39 -0
  64. package/dist/esm/index.mjs.map +1 -0
  65. package/dist/esm/modules/core/components/Button/Button.mjs +38 -0
  66. package/dist/esm/modules/core/components/Button/Button.mjs.map +1 -0
  67. package/dist/esm/modules/core/components/Button/ButtonGroup.mjs +7 -0
  68. package/dist/esm/modules/core/components/Button/ButtonGroup.mjs.map +1 -0
  69. package/dist/esm/modules/core/components/Button/ButtonSpinner.mjs +14 -0
  70. package/dist/esm/modules/core/components/Button/ButtonSpinner.mjs.map +1 -0
  71. package/dist/esm/modules/core/components/Button/styles.css.mjs +2 -0
  72. package/dist/esm/modules/core/components/Button/styles.css.mjs.map +1 -0
  73. package/dist/esm/modules/core/components/Icons/Bell.mjs +29 -0
  74. package/dist/esm/modules/core/components/Icons/Bell.mjs.map +1 -0
  75. package/dist/esm/modules/core/components/Icons/CheckmarkCircle.mjs +36 -0
  76. package/dist/esm/modules/core/components/Icons/CheckmarkCircle.mjs.map +1 -0
  77. package/dist/esm/modules/core/components/Icons/ChevronDown.mjs +25 -0
  78. package/dist/esm/modules/core/components/Icons/ChevronDown.mjs.map +1 -0
  79. package/dist/esm/modules/core/components/Icons/CloseCircle.mjs +22 -0
  80. package/dist/esm/modules/core/components/Icons/CloseCircle.mjs.map +1 -0
  81. package/dist/esm/modules/core/components/Spinner/Spinner.mjs +65 -0
  82. package/dist/esm/modules/core/components/Spinner/Spinner.mjs.map +1 -0
  83. package/dist/esm/modules/core/hooks/useComponentVisible.mjs +18 -0
  84. package/dist/esm/modules/core/hooks/useComponentVisible.mjs.map +1 -0
  85. package/dist/esm/modules/core/hooks/useOnBottomScroll.mjs +21 -0
  86. package/dist/esm/modules/core/hooks/useOnBottomScroll.mjs.map +1 -0
  87. package/dist/esm/modules/feed/components/EmptyFeed/EmptyFeed.mjs +14 -0
  88. package/dist/esm/modules/feed/components/EmptyFeed/EmptyFeed.mjs.map +1 -0
  89. package/dist/esm/modules/feed/components/EmptyFeed/styles.css.mjs +2 -0
  90. package/dist/esm/modules/feed/components/EmptyFeed/styles.css.mjs.map +1 -0
  91. package/dist/esm/modules/feed/components/NotificationCell/ArchiveButton.mjs +40 -0
  92. package/dist/esm/modules/feed/components/NotificationCell/ArchiveButton.mjs.map +1 -0
  93. package/dist/esm/modules/feed/components/NotificationCell/Avatar.mjs +13 -0
  94. package/dist/esm/modules/feed/components/NotificationCell/Avatar.mjs.map +1 -0
  95. package/dist/esm/modules/feed/components/NotificationCell/NotificationCell.mjs +58 -0
  96. package/dist/esm/modules/feed/components/NotificationCell/NotificationCell.mjs.map +1 -0
  97. package/dist/esm/modules/feed/components/NotificationCell/styles.css.mjs +2 -0
  98. package/dist/esm/modules/feed/components/NotificationCell/styles.css.mjs.map +1 -0
  99. package/dist/esm/modules/feed/components/NotificationFeed/Dropdown.mjs +19 -0
  100. package/dist/esm/modules/feed/components/NotificationFeed/Dropdown.mjs.map +1 -0
  101. package/dist/esm/modules/feed/components/NotificationFeed/MarkAsRead.mjs +32 -0
  102. package/dist/esm/modules/feed/components/NotificationFeed/MarkAsRead.mjs.map +1 -0
  103. package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeed.mjs +67 -0
  104. package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeed.mjs.map +1 -0
  105. package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeedHeader.mjs +33 -0
  106. package/dist/esm/modules/feed/components/NotificationFeed/NotificationFeedHeader.mjs.map +1 -0
  107. package/dist/esm/modules/feed/components/NotificationFeed/styles.css.mjs +2 -0
  108. package/dist/esm/modules/feed/components/NotificationFeed/styles.css.mjs.map +1 -0
  109. package/dist/esm/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.mjs +60 -0
  110. package/dist/esm/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.mjs.map +1 -0
  111. package/dist/esm/modules/feed/components/NotificationFeedPopover/styles.css.mjs +2 -0
  112. package/dist/esm/modules/feed/components/NotificationFeedPopover/styles.css.mjs.map +1 -0
  113. package/dist/esm/modules/feed/components/NotificationIconButton/NotificationIconButton.mjs +27 -0
  114. package/dist/esm/modules/feed/components/NotificationIconButton/NotificationIconButton.mjs.map +1 -0
  115. package/dist/esm/modules/feed/components/NotificationIconButton/styles.css.mjs +2 -0
  116. package/dist/esm/modules/feed/components/NotificationIconButton/styles.css.mjs.map +1 -0
  117. package/dist/esm/modules/feed/components/UnseenBadge/UnseenBadge.mjs +25 -0
  118. package/dist/esm/modules/feed/components/UnseenBadge/UnseenBadge.mjs.map +1 -0
  119. package/dist/esm/modules/feed/components/UnseenBadge/styles.css.mjs +2 -0
  120. package/dist/esm/modules/feed/components/UnseenBadge/styles.css.mjs.map +1 -0
  121. package/dist/index.css +1 -0
  122. package/dist/types/App.d.ts +3 -0
  123. package/dist/types/App.d.ts.map +1 -0
  124. package/dist/types/index.d.ts +4 -0
  125. package/dist/types/index.d.ts.map +1 -0
  126. package/dist/types/main.d.ts +1 -0
  127. package/dist/types/main.d.ts.map +1 -0
  128. package/dist/types/modules/core/components/Button/Button.d.ts +11 -0
  129. package/dist/types/modules/core/components/Button/Button.d.ts.map +1 -0
  130. package/dist/types/modules/core/components/Button/ButtonGroup.d.ts +3 -0
  131. package/dist/types/modules/core/components/Button/ButtonGroup.d.ts.map +1 -0
  132. package/dist/types/modules/core/components/Button/ButtonSpinner.d.ts +7 -0
  133. package/dist/types/modules/core/components/Button/ButtonSpinner.d.ts.map +1 -0
  134. package/dist/types/modules/core/components/Button/index.d.ts +3 -0
  135. package/dist/types/modules/core/components/Button/index.d.ts.map +1 -0
  136. package/dist/types/modules/core/components/Icons/Bell.d.ts +6 -0
  137. package/dist/types/modules/core/components/Icons/Bell.d.ts.map +1 -0
  138. package/dist/types/modules/core/components/Icons/CheckmarkCircle.d.ts +3 -0
  139. package/dist/types/modules/core/components/Icons/CheckmarkCircle.d.ts.map +1 -0
  140. package/dist/types/modules/core/components/Icons/ChevronDown.d.ts +3 -0
  141. package/dist/types/modules/core/components/Icons/ChevronDown.d.ts.map +1 -0
  142. package/dist/types/modules/core/components/Icons/CloseCircle.d.ts +3 -0
  143. package/dist/types/modules/core/components/Icons/CloseCircle.d.ts.map +1 -0
  144. package/dist/types/modules/core/components/Icons/index.d.ts +5 -0
  145. package/dist/types/modules/core/components/Icons/index.d.ts.map +1 -0
  146. package/dist/types/modules/core/components/Spinner/Spinner.d.ts +12 -0
  147. package/dist/types/modules/core/components/Spinner/Spinner.d.ts.map +1 -0
  148. package/dist/types/modules/core/components/Spinner/index.d.ts +2 -0
  149. package/dist/types/modules/core/components/Spinner/index.d.ts.map +1 -0
  150. package/dist/types/modules/core/hooks/index.d.ts +2 -0
  151. package/dist/types/modules/core/hooks/index.d.ts.map +1 -0
  152. package/dist/types/modules/core/hooks/useComponentVisible.d.ts +9 -0
  153. package/dist/types/modules/core/hooks/useComponentVisible.d.ts.map +1 -0
  154. package/dist/types/modules/core/hooks/useOnBottomScroll.d.ts +9 -0
  155. package/dist/types/modules/core/hooks/useOnBottomScroll.d.ts.map +1 -0
  156. package/dist/types/modules/core/index.d.ts +5 -0
  157. package/dist/types/modules/core/index.d.ts.map +1 -0
  158. package/dist/types/modules/feed/components/EmptyFeed/EmptyFeed.d.ts +3 -0
  159. package/dist/types/modules/feed/components/EmptyFeed/EmptyFeed.d.ts.map +1 -0
  160. package/dist/types/modules/feed/components/EmptyFeed/index.d.ts +2 -0
  161. package/dist/types/modules/feed/components/EmptyFeed/index.d.ts.map +1 -0
  162. package/dist/types/modules/feed/components/NotificationCell/ArchiveButton.d.ts +8 -0
  163. package/dist/types/modules/feed/components/NotificationCell/ArchiveButton.d.ts.map +1 -0
  164. package/dist/types/modules/feed/components/NotificationCell/Avatar.d.ts +7 -0
  165. package/dist/types/modules/feed/components/NotificationCell/Avatar.d.ts.map +1 -0
  166. package/dist/types/modules/feed/components/NotificationCell/NotificationCell.d.ts +11 -0
  167. package/dist/types/modules/feed/components/NotificationCell/NotificationCell.d.ts.map +1 -0
  168. package/dist/types/modules/feed/components/NotificationCell/index.d.ts +3 -0
  169. package/dist/types/modules/feed/components/NotificationCell/index.d.ts.map +1 -0
  170. package/dist/types/modules/feed/components/NotificationFeed/Dropdown.d.ts +7 -0
  171. package/dist/types/modules/feed/components/NotificationFeed/Dropdown.d.ts.map +1 -0
  172. package/dist/types/modules/feed/components/NotificationFeed/MarkAsRead.d.ts +7 -0
  173. package/dist/types/modules/feed/components/NotificationFeed/MarkAsRead.d.ts.map +1 -0
  174. package/dist/types/modules/feed/components/NotificationFeed/NotificationFeed.d.ts +24 -0
  175. package/dist/types/modules/feed/components/NotificationFeed/NotificationFeed.d.ts.map +1 -0
  176. package/dist/types/modules/feed/components/NotificationFeed/NotificationFeedHeader.d.ts +10 -0
  177. package/dist/types/modules/feed/components/NotificationFeed/NotificationFeedHeader.d.ts.map +1 -0
  178. package/dist/types/modules/feed/components/NotificationFeed/index.d.ts +4 -0
  179. package/dist/types/modules/feed/components/NotificationFeed/index.d.ts.map +1 -0
  180. package/dist/types/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.d.ts +19 -0
  181. package/dist/types/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.d.ts.map +1 -0
  182. package/dist/types/modules/feed/components/NotificationFeedPopover/index.d.ts +2 -0
  183. package/dist/types/modules/feed/components/NotificationFeedPopover/index.d.ts.map +1 -0
  184. package/dist/types/modules/feed/components/NotificationIconButton/NotificationIconButton.d.ts +8 -0
  185. package/dist/types/modules/feed/components/NotificationIconButton/NotificationIconButton.d.ts.map +1 -0
  186. package/dist/types/modules/feed/components/NotificationIconButton/index.d.ts +2 -0
  187. package/dist/types/modules/feed/components/NotificationIconButton/index.d.ts.map +1 -0
  188. package/dist/types/modules/feed/components/UnseenBadge/UnseenBadge.d.ts +7 -0
  189. package/dist/types/modules/feed/components/UnseenBadge/UnseenBadge.d.ts.map +1 -0
  190. package/dist/types/modules/feed/components/UnseenBadge/index.d.ts +2 -0
  191. package/dist/types/modules/feed/components/UnseenBadge/index.d.ts.map +1 -0
  192. package/dist/types/modules/feed/index.d.ts +7 -0
  193. package/dist/types/modules/feed/index.d.ts.map +1 -0
  194. package/package.json +70 -0
@@ -0,0 +1,67 @@
1
+ import { jsxs as p, jsx as e } from "react/jsx-runtime";
2
+ import { isRequestInFlight as C, NetworkStatus as f } from "@knocklabs/client";
3
+ import { useState as R, useRef as y, useEffect as k, useCallback as B } from "react";
4
+ import { EmptyFeed as q } from "../EmptyFeed/EmptyFeed.mjs";
5
+ import { useKnockFeed as j, useFeedSettings as E, useTranslations as H, FilterStatus as K } from "@knocklabs/react-core";
6
+ import { Spinner as M } from "../../../core/components/Spinner/Spinner.mjs";
7
+ import { NotificationCell as z } from "../NotificationCell/NotificationCell.mjs";
8
+
9
+ import { NotificationFeedHeader as A } from "./NotificationFeedHeader.mjs";
10
+ import "./styles.css.mjs";
11
+ import L from "../../../core/hooks/useOnBottomScroll.mjs";
12
+ const O = (t) => /* @__PURE__ */ e(z, { ...t }, t.item.id), P = (t) => /* @__PURE__ */ e(A, { ...t }), h = ({ colorMode: t }) => /* @__PURE__ */ e("div", { className: "rnf-notification-feed__spinner-container", children: /* @__PURE__ */ e(
13
+ M,
14
+ {
15
+ thickness: 3,
16
+ size: "16px",
17
+ color: t === "dark" ? "rgba(255, 255, 255, 0.65)" : void 0
18
+ }
19
+ ) }), T = "https://knock.app?utm_source=powered-by-knock&utm_medium=referral&utm_campaign=knock-branding-feed", ee = ({
20
+ EmptyComponent: t = /* @__PURE__ */ e(q, {}),
21
+ renderItem: g = O,
22
+ onNotificationClick: _,
23
+ onMarkAllAsReadClick: N,
24
+ initialFilterStatus: r = K.All,
25
+ header: S,
26
+ renderHeader: b = P
27
+ }) => {
28
+ const [i, d] = R(r), { feedClient: o, useFeedStore: F, colorMode: a } = j(), { settings: c } = E(o), { t: v } = H(), { pageInfo: m, items: l, networkStatus: n } = F(), u = y(null);
29
+ k(() => {
30
+ d(r);
31
+ }, [r]), k(() => {
32
+ o.fetch({ status: i });
33
+ }, [o, i]);
34
+ const I = l.length === 0, s = C(n), w = B(() => {
35
+ !s && m.after && o.fetchNextPage();
36
+ }, [s, m, o]);
37
+ return L({
38
+ ref: u,
39
+ callback: w,
40
+ offset: 70
41
+ }), /* @__PURE__ */ p(
42
+ "div",
43
+ {
44
+ className: `rnf-notification-feed rnf-notification-feed--${a}`,
45
+ children: [
46
+ S || b({
47
+ setFilterStatus: d,
48
+ filterStatus: i,
49
+ onMarkAllAsReadClick: N
50
+ }),
51
+ /* @__PURE__ */ p("div", { className: "rnf-notification-feed__container", ref: u, children: [
52
+ n === f.loading && /* @__PURE__ */ e(h, { colorMode: a }),
53
+ /* @__PURE__ */ e("div", { className: "rnf-notification-feed__feed-items-container", children: n !== f.loading && l.map(
54
+ (x) => g({ item: x, onItemClick: _ })
55
+ ) }),
56
+ n === f.fetchMore && /* @__PURE__ */ e(h, { colorMode: a }),
57
+ !s && I && t
58
+ ] }),
59
+ (c == null ? void 0 : c.features.branding_required) && /* @__PURE__ */ e("div", { className: "rnf-notification-feed__knock-branding", children: /* @__PURE__ */ e("a", { href: T, target: "_blank", children: v("poweredBy") }) })
60
+ ]
61
+ }
62
+ );
63
+ };
64
+ export {
65
+ ee as NotificationFeed
66
+ };
67
+ //# sourceMappingURL=NotificationFeed.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationFeed.mjs","sources":["../../../../../../src/modules/feed/components/NotificationFeed/NotificationFeed.tsx"],"sourcesContent":["import { FeedItem, isRequestInFlight, NetworkStatus } from \"@knocklabs/client\";\nimport React, {\n ReactElement,\n ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { EmptyFeed } from \"../EmptyFeed\";\nimport {\n useKnockFeed,\n useFeedSettings,\n ColorMode,\n FilterStatus,\n useTranslations,\n} from \"@knocklabs/react-core\";\nimport { Spinner } from \"../../../core/components/Spinner\";\nimport { NotificationCell } from \"../NotificationCell\";\nimport {\n NotificationFeedHeader,\n NotificationFeedHeaderProps,\n} from \"./NotificationFeedHeader\";\n\nimport \"./styles.css\";\nimport useOnBottomScroll from \"../../../core/hooks/useOnBottomScroll\";\n\nexport type OnNotificationClick = (item: FeedItem) => void;\nexport type RenderItem = ({ item }: RenderItemProps) => ReactNode;\nexport type RenderItemProps = {\n item: FeedItem;\n onItemClick?: OnNotificationClick;\n};\n\nexport interface NotificationFeedProps {\n EmptyComponent?: ReactNode;\n /**\n * @deprecated Use `renderHeader` instead to accept `NotificationFeedHeaderProps`\n */\n header?: ReactElement<any>;\n renderItem?: RenderItem;\n renderHeader?: (props: NotificationFeedHeaderProps) => ReactNode;\n onNotificationClick?: OnNotificationClick;\n onMarkAllAsReadClick?: (e: React.MouseEvent, unreadItems: FeedItem[]) => void;\n initialFilterStatus?: FilterStatus;\n}\n\nconst defaultRenderItem = (props: RenderItemProps) => (\n <NotificationCell key={props.item.id} {...props} />\n);\n\nconst defaultRenderHeader = (props: NotificationFeedHeaderProps) => (\n <NotificationFeedHeader {...props} />\n);\n\nconst LoadingSpinner = ({ colorMode }: { colorMode: ColorMode }) => (\n <div className=\"rnf-notification-feed__spinner-container\">\n <Spinner\n thickness={3}\n size=\"16px\"\n color={colorMode === \"dark\" ? \"rgba(255, 255, 255, 0.65)\" : undefined}\n />\n </div>\n);\n\nconst poweredByKnockUrl =\n \"https://knock.app?utm_source=powered-by-knock&utm_medium=referral&utm_campaign=knock-branding-feed\";\n\nexport const NotificationFeed: React.FC<NotificationFeedProps> = ({\n EmptyComponent = <EmptyFeed />,\n renderItem = defaultRenderItem,\n onNotificationClick,\n onMarkAllAsReadClick,\n initialFilterStatus = FilterStatus.All,\n header,\n renderHeader = defaultRenderHeader,\n}) => {\n const [status, setStatus] = useState(initialFilterStatus);\n const { feedClient, useFeedStore, colorMode } = useKnockFeed();\n const { settings } = useFeedSettings(feedClient);\n const { t } = useTranslations();\n\n const { pageInfo, items, networkStatus } = useFeedStore();\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n setStatus(initialFilterStatus);\n }, [initialFilterStatus]);\n\n useEffect(() => {\n // When the feed client changes, or the status changes issue a re-fetch\n feedClient.fetch({ status });\n }, [feedClient, status]);\n\n const noItems = items.length === 0;\n const requestInFlight = isRequestInFlight(networkStatus);\n\n // Handle fetching more once we reach the bottom of the list\n const onBottomCallback = useCallback(() => {\n if (!requestInFlight && pageInfo.after) {\n feedClient.fetchNextPage();\n }\n }, [requestInFlight, pageInfo, feedClient]);\n\n // Once we scroll to the bottom of the view we want to automatically fetch\n // more items for the feed and bring them into the list\n useOnBottomScroll({\n ref: containerRef,\n callback: onBottomCallback,\n offset: 70,\n });\n\n return (\n <div\n className={`rnf-notification-feed rnf-notification-feed--${colorMode}`}\n >\n {header ||\n renderHeader({\n setFilterStatus: setStatus,\n filterStatus: status,\n onMarkAllAsReadClick,\n })}\n\n <div className=\"rnf-notification-feed__container\" ref={containerRef}>\n {networkStatus === NetworkStatus.loading && (\n <LoadingSpinner colorMode={colorMode} />\n )}\n\n <div className=\"rnf-notification-feed__feed-items-container\">\n {networkStatus !== NetworkStatus.loading &&\n items.map((item: FeedItem) =>\n renderItem({ item, onItemClick: onNotificationClick }),\n )}\n </div>\n\n {networkStatus === NetworkStatus.fetchMore && (\n <LoadingSpinner colorMode={colorMode} />\n )}\n\n {!requestInFlight && noItems && EmptyComponent}\n </div>\n\n {settings?.features.branding_required && (\n <div className=\"rnf-notification-feed__knock-branding\">\n <a href={poweredByKnockUrl} target=\"_blank\">\n {t(\"poweredBy\")}\n </a>\n </div>\n )}\n </div>\n );\n};\n"],"names":["defaultRenderItem","props","jsx","NotificationCell","defaultRenderHeader","NotificationFeedHeader","LoadingSpinner","colorMode","Spinner","poweredByKnockUrl","NotificationFeed","EmptyComponent","EmptyFeed","renderItem","onNotificationClick","onMarkAllAsReadClick","initialFilterStatus","FilterStatus","header","renderHeader","status","setStatus","useState","feedClient","useFeedStore","useKnockFeed","settings","useFeedSettings","t","useTranslations","pageInfo","items","networkStatus","containerRef","useRef","useEffect","noItems","requestInFlight","isRequestInFlight","onBottomCallback","useCallback","useOnBottomScroll","jsxs","NetworkStatus","item"],"mappings":";;;;;;;;;;;AA+CA,MAAMA,IAAoB,CAACC,MACzB,gBAAAC,EAACC,KAAsC,GAAGF,EAAA,GAAnBA,EAAM,KAAK,EAAe,GAG7CG,IAAsB,CAACH,MAC1B,gBAAAC,EAAAG,GAAA,EAAwB,GAAGJ,EAAO,CAAA,GAG/BK,IAAiB,CAAC,EAAE,WAAAC,EAAA,MACvB,gBAAAL,EAAA,OAAA,EAAI,WAAU,4CACb,UAAA,gBAAAA;AAAA,EAACM;AAAA,EAAA;AAAA,IACC,WAAW;AAAA,IACX,MAAK;AAAA,IACL,OAAOD,MAAc,SAAS,8BAA8B;AAAA,EAAA;AAC9D,EACF,CAAA,GAGIE,IACJ,sGAEWC,KAAoD,CAAC;AAAA,EAChE,gBAAAC,sBAAkBC,GAAU,EAAA;AAAA,EAC5B,YAAAC,IAAab;AAAA,EACb,qBAAAc;AAAA,EACA,sBAAAC;AAAA,EACA,qBAAAC,IAAsBC,EAAa;AAAA,EACnC,QAAAC;AAAA,EACA,cAAAC,IAAef;AACjB,MAAM;AACJ,QAAM,CAACgB,GAAQC,CAAS,IAAIC,EAASN,CAAmB,GAClD,EAAE,YAAAO,GAAY,cAAAC,GAAc,WAAAjB,MAAckB,EAAa,GACvD,EAAE,UAAAC,EAAA,IAAaC,EAAgBJ,CAAU,GACzC,EAAE,GAAAK,MAAMC,KAER,EAAE,UAAAC,GAAU,OAAAC,GAAO,eAAAC,MAAkBR,EAAa,GAClDS,IAAeC,EAAuB,IAAI;AAEhD,EAAAC,EAAU,MAAM;AACd,IAAAd,EAAUL,CAAmB;AAAA,EAAA,GAC5B,CAACA,CAAmB,CAAC,GAExBmB,EAAU,MAAM;AAEH,IAAAZ,EAAA,MAAM,EAAE,QAAAH,EAAA,CAAQ;AAAA,EAAA,GAC1B,CAACG,GAAYH,CAAM,CAAC;AAEjB,QAAAgB,IAAUL,EAAM,WAAW,GAC3BM,IAAkBC,EAAkBN,CAAa,GAGjDO,IAAmBC,EAAY,MAAM;AACrC,IAAA,CAACH,KAAmBP,EAAS,SAC/BP,EAAW,cAAc;AAAA,EAE1B,GAAA,CAACc,GAAiBP,GAAUP,CAAU,CAAC;AAIxB,SAAAkB,EAAA;AAAA,IAChB,KAAKR;AAAA,IACL,UAAUM;AAAA,IACV,QAAQ;AAAA,EAAA,CACT,GAGC,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,gDAAgDnC,CAAS;AAAA,MAEnE,UAAA;AAAA,QAAAW,KACCC,EAAa;AAAA,UACX,iBAAiBE;AAAA,UACjB,cAAcD;AAAA,UACd,sBAAAL;AAAA,QAAA,CACD;AAAA,QAEF,gBAAA2B,EAAA,OAAA,EAAI,WAAU,oCAAmC,KAAKT,GACpD,UAAA;AAAA,UAAAD,MAAkBW,EAAc,WAC9B,gBAAAzC,EAAAI,GAAA,EAAe,WAAAC,GAAsB;AAAA,4BAGvC,OAAI,EAAA,WAAU,+CACZ,UAAkByB,MAAAW,EAAc,WAC/BZ,EAAM;AAAA,YAAI,CAACa,MACT/B,EAAW,EAAE,MAAA+B,GAAM,aAAa9B,GAAqB;AAAA,UAAA,GAE3D;AAAA,UAECkB,MAAkBW,EAAc,aAC/B,gBAAAzC,EAACI,KAAe,WAAAC,GAAsB;AAAA,UAGvC,CAAC8B,KAAmBD,KAAWzB;AAAA,QAAA,GAClC;AAAA,SAECe,KAAA,gBAAAA,EAAU,SAAS,sBACjB,gBAAAxB,EAAA,OAAA,EAAI,WAAU,yCACb,UAAA,gBAAAA,EAAC,KAAE,EAAA,MAAMO,GAAmB,QAAO,UAChC,UAAEmB,EAAA,WAAW,EAChB,CAAA,GACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
@@ -0,0 +1,33 @@
1
+ import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
+ import { FilterStatus as o, useTranslations as d } from "@knocklabs/react-core";
3
+ import { Dropdown as c } from "./Dropdown.mjs";
4
+ import { MarkAsRead as l } from "./MarkAsRead.mjs";
5
+ const f = [
6
+ o.All,
7
+ o.Unread,
8
+ o.Read
9
+ ], u = ({
10
+ onMarkAllAsReadClick: a,
11
+ filterStatus: t,
12
+ setFilterStatus: s
13
+ }) => {
14
+ const { t: r } = d();
15
+ return /* @__PURE__ */ i("header", { className: "rnf-notification-feed__header", children: [
16
+ /* @__PURE__ */ i("div", { className: "rnf-notification-feed__selector", children: [
17
+ /* @__PURE__ */ n("span", { className: "rnf-notification-feed__type", children: r("notifications") }),
18
+ /* @__PURE__ */ n(
19
+ c,
20
+ {
21
+ value: t,
22
+ onChange: (e) => s(e.target.value),
23
+ children: f.map((e) => /* @__PURE__ */ n("option", { value: e, children: r(e) }, e))
24
+ }
25
+ )
26
+ ] }),
27
+ /* @__PURE__ */ n(l, { onClick: a })
28
+ ] });
29
+ };
30
+ export {
31
+ u as NotificationFeedHeader
32
+ };
33
+ //# sourceMappingURL=NotificationFeedHeader.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationFeedHeader.mjs","sources":["../../../../../../src/modules/feed/components/NotificationFeed/NotificationFeedHeader.tsx"],"sourcesContent":["import React, { SetStateAction } from \"react\";\nimport { FeedItem } from \"@knocklabs/client\";\n\nimport { FilterStatus, useTranslations } from \"@knocklabs/react-core\";\nimport { Dropdown } from \"./Dropdown\";\nimport { MarkAsRead } from \"./MarkAsRead\";\n\nexport type NotificationFeedHeaderProps = {\n filterStatus: FilterStatus;\n setFilterStatus: React.Dispatch<SetStateAction<FilterStatus>>;\n onMarkAllAsReadClick?: (e: React.MouseEvent, unreadItems: FeedItem[]) => void;\n};\n\nconst OrderedFilterStatuses = [\n FilterStatus.All,\n FilterStatus.Unread,\n FilterStatus.Read,\n];\n\nexport const NotificationFeedHeader: React.FC<NotificationFeedHeaderProps> = ({\n onMarkAllAsReadClick,\n filterStatus,\n setFilterStatus,\n}) => {\n const { t } = useTranslations();\n\n return (\n <header className=\"rnf-notification-feed__header\">\n <div className=\"rnf-notification-feed__selector\">\n <span className=\"rnf-notification-feed__type\">\n {t(\"notifications\")}\n </span>\n <Dropdown\n value={filterStatus}\n onChange={(e) => setFilterStatus(e.target.value)}\n >\n {OrderedFilterStatuses.map((filterStatus) => (\n <option key={filterStatus} value={filterStatus}>\n {t(filterStatus)}\n </option>\n ))}\n </Dropdown>\n </div>\n <MarkAsRead onClick={onMarkAllAsReadClick} />\n </header>\n );\n};\n"],"names":["OrderedFilterStatuses","FilterStatus","NotificationFeedHeader","onMarkAllAsReadClick","filterStatus","setFilterStatus","t","useTranslations","jsxs","jsx","Dropdown","MarkAsRead"],"mappings":";;;;AAaA,MAAMA,IAAwB;AAAA,EAC5BC,EAAa;AAAA,EACbA,EAAa;AAAA,EACbA,EAAa;AACf,GAEaC,IAAgE,CAAC;AAAA,EAC5E,sBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC;AACF,MAAM;AACE,QAAA,EAAE,GAAAC,MAAMC;AAGZ,SAAA,gBAAAC,EAAC,UAAO,EAAA,WAAU,iCAChB,UAAA;AAAA,IAAC,gBAAAA,EAAA,OAAA,EAAI,WAAU,mCACb,UAAA;AAAA,MAAA,gBAAAC,EAAC,QAAK,EAAA,WAAU,+BACb,UAAAH,EAAE,eAAe,GACpB;AAAA,MACA,gBAAAG;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,OAAON;AAAA,UACP,UAAU,CAAC,MAAMC,EAAgB,EAAE,OAAO,KAAK;AAAA,UAE9C,UAAsBL,EAAA,IAAI,CAACI,MACzB,gBAAAK,EAAA,UAAA,EAA0B,OAAOL,GAC/B,UAAEA,EAAAA,CAAY,EADJA,GAAAA,CAEb,CACD;AAAA,QAAA;AAAA,MACH;AAAA,IAAA,GACF;AAAA,IACA,gBAAAK,EAACE,GAAW,EAAA,SAASR,EAAsB,CAAA;AAAA,EAC7C,EAAA,CAAA;AAEJ;"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=styles.css.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,60 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useEffect as v } from "react";
3
+ import { usePopper as x } from "react-popper";
4
+ import { NotificationFeed as y } from "../NotificationFeed/NotificationFeed.mjs";
5
+ import "../NotificationFeed/NotificationFeedHeader.mjs";
6
+ import { useKnockFeed as F } from "@knocklabs/react-core";
7
+
8
+ import N from "../../../core/hooks/useComponentVisible.mjs";
9
+ import "./styles.css.mjs";
10
+ const b = ({ store: e, feedClient: o }) => {
11
+ e.metadata.unseen_count > 0 && o.markAllAsSeen();
12
+ }, E = ({
13
+ isVisible: e,
14
+ onOpen: o = b,
15
+ onClose: i,
16
+ buttonRef: n,
17
+ closeOnClickOutside: f = !0,
18
+ placement: p = "bottom-end",
19
+ ...s
20
+ }) => {
21
+ const { colorMode: m, feedClient: d, useFeedStore: c } = F(), a = c(), { ref: r } = N(e, i, {
22
+ closeOnClickOutside: f
23
+ }), { styles: l, attributes: u } = x(
24
+ n.current,
25
+ r.current,
26
+ {
27
+ strategy: "fixed",
28
+ placement: p,
29
+ modifiers: [
30
+ {
31
+ name: "offset",
32
+ options: {
33
+ offset: [0, 8]
34
+ }
35
+ }
36
+ ]
37
+ }
38
+ );
39
+ return v(() => {
40
+ e && o && o({ store: a, feedClient: d });
41
+ }, [e]), /* @__PURE__ */ t(
42
+ "div",
43
+ {
44
+ className: `rnf-notification-feed-popover rnf-notification-feed-popover--${m}`,
45
+ style: {
46
+ ...l.popper,
47
+ visibility: e ? "visible" : "hidden"
48
+ },
49
+ ref: r,
50
+ ...u.popper,
51
+ role: "dialog",
52
+ tabIndex: -1,
53
+ children: /* @__PURE__ */ t("div", { className: "rnf-notification-feed-popover__inner", children: /* @__PURE__ */ t(y, { ...s }) })
54
+ }
55
+ );
56
+ };
57
+ export {
58
+ E as NotificationFeedPopover
59
+ };
60
+ //# sourceMappingURL=NotificationFeedPopover.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationFeedPopover.mjs","sources":["../../../../../../src/modules/feed/components/NotificationFeedPopover/NotificationFeedPopover.tsx"],"sourcesContent":["import React, { RefObject, useEffect } from \"react\";\nimport { usePopper } from \"react-popper\";\nimport { Placement } from \"@popperjs/core\";\nimport { NotificationFeed, NotificationFeedProps } from \"../NotificationFeed\";\nimport useComponentVisible from \"../../../core/hooks/useComponentVisible\";\n\nimport \"./styles.css\";\nimport { useKnockFeed } from \"@knocklabs/react-core\";\nimport { Feed, FeedStoreState } from \"@knocklabs/client\";\n\ntype OnOpenOptions = {\n store: FeedStoreState;\n feedClient: Feed;\n};\n\nconst defaultOnOpen = ({ store, feedClient }: OnOpenOptions) => {\n if (store.metadata.unseen_count > 0) {\n feedClient.markAllAsSeen();\n }\n};\n\nexport interface NotificationFeedPopoverProps extends NotificationFeedProps {\n isVisible: boolean;\n onOpen?: (arg: OnOpenOptions) => void;\n onClose: (e: Event) => void;\n buttonRef: RefObject<HTMLElement>;\n closeOnClickOutside?: boolean;\n placement?: Placement;\n}\n\nexport const NotificationFeedPopover: React.FC<\n NotificationFeedPopoverProps\n> = ({\n isVisible,\n onOpen = defaultOnOpen,\n onClose,\n buttonRef,\n closeOnClickOutside = true,\n placement = \"bottom-end\",\n ...feedProps\n}) => {\n const { colorMode, feedClient, useFeedStore } = useKnockFeed();\n const store = useFeedStore();\n\n const { ref: popperRef } = useComponentVisible(isVisible, onClose, {\n closeOnClickOutside,\n });\n\n const { styles, attributes } = usePopper(\n buttonRef.current,\n popperRef.current,\n {\n strategy: \"fixed\",\n placement,\n modifiers: [\n {\n name: \"offset\",\n options: {\n offset: [0, 8],\n },\n },\n ],\n },\n );\n\n useEffect(() => {\n // Whenever the feed is opened, we want to invoke the `onOpen` callback\n // function to handle any side effects.\n if (isVisible && onOpen) {\n onOpen({ store, feedClient });\n }\n }, [isVisible]);\n\n return (\n <div\n className={`rnf-notification-feed-popover rnf-notification-feed-popover--${colorMode}`}\n style={{\n ...styles.popper,\n visibility: isVisible ? \"visible\" : \"hidden\",\n }}\n ref={popperRef}\n {...attributes.popper}\n role=\"dialog\"\n tabIndex={-1}\n >\n <div className=\"rnf-notification-feed-popover__inner\">\n <NotificationFeed {...feedProps} />\n </div>\n </div>\n );\n};\n"],"names":["defaultOnOpen","store","feedClient","NotificationFeedPopover","isVisible","onOpen","onClose","buttonRef","closeOnClickOutside","placement","feedProps","colorMode","useFeedStore","useKnockFeed","popperRef","useComponentVisible","styles","attributes","usePopper","useEffect","jsx","NotificationFeed"],"mappings":";;;;;;;;;AAeA,MAAMA,IAAgB,CAAC,EAAE,OAAAC,GAAO,YAAAC,QAAgC;AAC1D,EAAAD,EAAM,SAAS,eAAe,KAChCC,EAAW,cAAc;AAE7B,GAWaC,IAET,CAAC;AAAA,EACH,WAAAC;AAAA,EACA,QAAAC,IAASL;AAAA,EACT,SAAAM;AAAA,EACA,WAAAC;AAAA,EACA,qBAAAC,IAAsB;AAAA,EACtB,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAM;AACJ,QAAM,EAAE,WAAAC,GAAW,YAAAT,GAAY,cAAAU,MAAiBC,EAAa,GACvDZ,IAAQW,KAER,EAAE,KAAKE,EAAA,IAAcC,EAAoBX,GAAWE,GAAS;AAAA,IACjE,qBAAAE;AAAA,EAAA,CACD,GAEK,EAAE,QAAAQ,GAAQ,YAAAC,EAAA,IAAeC;AAAA,IAC7BX,EAAU;AAAA,IACVO,EAAU;AAAA,IACV;AAAA,MACE,UAAU;AAAA,MACV,WAAAL;AAAA,MACA,WAAW;AAAA,QACT;AAAA,UACE,MAAM;AAAA,UACN,SAAS;AAAA,YACP,QAAQ,CAAC,GAAG,CAAC;AAAA,UACf;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EAAA;AAGF,SAAAU,EAAU,MAAM;AAGd,IAAIf,KAAaC,KACRA,EAAA,EAAE,OAAAJ,GAAO,YAAAC,EAAA,CAAY;AAAA,EAC9B,GACC,CAACE,CAAS,CAAC,GAGZ,gBAAAgB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,gEAAgET,CAAS;AAAA,MACpF,OAAO;AAAA,QACL,GAAGK,EAAO;AAAA,QACV,YAAYZ,IAAY,YAAY;AAAA,MACtC;AAAA,MACA,KAAKU;AAAA,MACJ,GAAGG,EAAW;AAAA,MACf,MAAK;AAAA,MACL,UAAU;AAAA,MAEV,UAAA,gBAAAG,EAAC,SAAI,WAAU,wCACb,4BAACC,GAAkB,EAAA,GAAGX,GAAW,EACnC,CAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=styles.css.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ import { jsxs as e, jsx as o } from "react/jsx-runtime";
2
+ import c from "react";
3
+ import { BellIcon as f } from "../../../core/components/Icons/Bell.mjs";
4
+ import { useKnockFeed as a } from "@knocklabs/react-core";
5
+ import { UnseenBadge as m } from "../UnseenBadge/UnseenBadge.mjs";
6
+
7
+ const x = c.forwardRef(({ onClick: t, badgeCountType: n }, i) => {
8
+ const { colorMode: r } = a();
9
+ return /* @__PURE__ */ e(
10
+ "button",
11
+ {
12
+ className: `rnf-notification-icon-button rnf-notification-icon-button--${r}`,
13
+ role: "button",
14
+ "aria-label": "Open notification feed",
15
+ ref: i,
16
+ onClick: t,
17
+ children: [
18
+ /* @__PURE__ */ o(f, {}),
19
+ /* @__PURE__ */ o(m, { badgeCountType: n })
20
+ ]
21
+ }
22
+ );
23
+ });
24
+ export {
25
+ x as NotificationIconButton
26
+ };
27
+ //# sourceMappingURL=NotificationIconButton.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationIconButton.mjs","sources":["../../../../../../src/modules/feed/components/NotificationIconButton/NotificationIconButton.tsx"],"sourcesContent":["import React, { SyntheticEvent } from \"react\";\nimport { BellIcon } from \"../../../core/components/Icons\";\nimport { useKnockFeed } from \"@knocklabs/react-core\";\nimport { BadgeCountType, UnseenBadge } from \"../UnseenBadge\";\n\nimport \"./styles.css\";\n\nexport interface NotificationIconButtonProps {\n // What value should we use to drive the badge count?\n badgeCountType?: BadgeCountType;\n onClick: (e: SyntheticEvent) => void;\n}\n\nexport const NotificationIconButton = React.forwardRef<\n HTMLButtonElement,\n NotificationIconButtonProps\n>(({ onClick, badgeCountType }, ref) => {\n const { colorMode } = useKnockFeed();\n\n return (\n <button\n className={`rnf-notification-icon-button rnf-notification-icon-button--${colorMode}`}\n role=\"button\"\n aria-label=\"Open notification feed\"\n ref={ref}\n onClick={onClick}\n >\n <BellIcon />\n <UnseenBadge badgeCountType={badgeCountType} />\n </button>\n );\n});\n"],"names":["NotificationIconButton","React","onClick","badgeCountType","ref","colorMode","useKnockFeed","jsxs","jsx","BellIcon","UnseenBadge"],"mappings":";;;;;;AAaa,MAAAA,IAAyBC,EAAM,WAG1C,CAAC,EAAE,SAAAC,GAAS,gBAAAC,KAAkBC,MAAQ;AAChC,QAAA,EAAE,WAAAC,MAAcC;AAGpB,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,8DAA8DF,CAAS;AAAA,MAClF,MAAK;AAAA,MACL,cAAW;AAAA,MACX,KAAAD;AAAA,MACA,SAAAF;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAM,EAACC,GAAS,EAAA;AAAA,QACV,gBAAAD,EAACE,KAAY,gBAAAP,GAAgC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGnD,CAAC;"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=styles.css.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { useKnockFeed as s, formatBadgeCount as o } from "@knocklabs/react-core";
3
+
4
+ function c(n, e) {
5
+ switch (n) {
6
+ case "all":
7
+ return e.total_count;
8
+ case "unread":
9
+ return e.unread_count;
10
+ case "unseen":
11
+ return e.unseen_count;
12
+ }
13
+ }
14
+ const i = ({
15
+ badgeCountType: n = "unseen"
16
+ }) => {
17
+ const { useFeedStore: e } = s(), t = e(
18
+ (r) => c(n, r.metadata)
19
+ );
20
+ return t !== 0 ? /* @__PURE__ */ u("div", { className: "rnf-unseen-badge", children: /* @__PURE__ */ u("span", { className: "rnf-unseen-badge__count", children: o(t) }) }) : null;
21
+ };
22
+ export {
23
+ i as UnseenBadge
24
+ };
25
+ //# sourceMappingURL=UnseenBadge.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnseenBadge.mjs","sources":["../../../../../../src/modules/feed/components/UnseenBadge/UnseenBadge.tsx"],"sourcesContent":["import React from \"react\";\nimport { useKnockFeed, formatBadgeCount } from \"@knocklabs/react-core\";\n\nimport \"./styles.css\";\nimport { FeedMetadata } from \"@knocklabs/client\";\n\nexport type BadgeCountType = \"unseen\" | \"unread\" | \"all\";\n\nexport type UnseenBadgeProps = {\n badgeCountType?: BadgeCountType;\n};\n\nfunction selectBadgeCount(\n badgeCountType: BadgeCountType,\n metadata: FeedMetadata,\n) {\n switch (badgeCountType) {\n case \"all\":\n return metadata.total_count;\n case \"unread\":\n return metadata.unread_count;\n case \"unseen\":\n return metadata.unseen_count;\n }\n}\n\nexport const UnseenBadge: React.FC<UnseenBadgeProps> = ({\n badgeCountType = \"unseen\",\n}) => {\n const { useFeedStore } = useKnockFeed();\n const badgeCountValue = useFeedStore((state) =>\n selectBadgeCount(badgeCountType, state.metadata),\n );\n\n return badgeCountValue !== 0 ? (\n <div className=\"rnf-unseen-badge\">\n <span className=\"rnf-unseen-badge__count\">\n {formatBadgeCount(badgeCountValue)}\n </span>\n </div>\n ) : null;\n};\n"],"names":["selectBadgeCount","badgeCountType","metadata","UnseenBadge","useFeedStore","useKnockFeed","badgeCountValue","state","jsx","formatBadgeCount"],"mappings":";;;AAYA,SAASA,EACPC,GACAC,GACA;AACA,UAAQD,GAAgB;AAAA,IACtB,KAAK;AACH,aAAOC,EAAS;AAAA,IAClB,KAAK;AACH,aAAOA,EAAS;AAAA,IAClB,KAAK;AACH,aAAOA,EAAS;AAAA,EACpB;AACF;AAEO,MAAMC,IAA0C,CAAC;AAAA,EACtD,gBAAAF,IAAiB;AACnB,MAAM;AACE,QAAA,EAAE,cAAAG,MAAiBC,KACnBC,IAAkBF;AAAA,IAAa,CAACG,MACpCP,EAAiBC,GAAgBM,EAAM,QAAQ;AAAA,EAAA;AAGjD,SAAOD,MAAoB,IACxB,gBAAAE,EAAA,OAAA,EAAI,WAAU,oBACb,UAAA,gBAAAA,EAAC,QAAK,EAAA,WAAU,2BACb,UAAAC,EAAiBH,CAAe,EACnC,CAAA,GACF,IACE;AACN;"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=styles.css.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index.css ADDED
@@ -0,0 +1 @@
1
+ :root{--rnf-font-size-xs: .75rem;--rnf-font-size-sm: .875rem;--rnf-font-size-md: 1rem;--rnf-font-size-lg: 1.125rem;--rnf-font-size-xl: 1.266rem;--rnf-font-size-2xl: 1.5rem;--rnf-font-size-3xl: 1.75rem;--rnf-spacing-0: 0;--rnf-spacing-1: 4px;--rnf-spacing-2: 8px;--rnf-spacing-3: 12px;--rnf-spacing-4: 16px;--rnf-spacing-5: 20px;--rnf-spacing-6: 24px;--rnf-spacing-7: 32px;--rnf-spacing-8: 42px;--rnf-font-weight-normal: 400;--rnf-font-weight-medium: 500;--rnf-font-weight-semibold: 600;--rnf-font-weight-bold: 700;--rnf-font-family-sanserif: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;--rnf-border-radius-sm: 2px;--rnf-border-radius-md: 4px;--rnf-border-radius-lg: 8px;--rnf-shadow-sm: 0px 5px 10px rgba(0, 0, 0, .12);--rnf-shadow-md: 0px 8px 30px rgba(0, 0, 0, .24);--rnf-color-white: #fff;--rnf-color-white-a-75: rgba(255, 255, 255, .75);--rnf-color-black: #000;--rnf-color-gray-900: #1a1f36;--rnf-color-gray-800: #3c4257;--rnf-color-gray-700: #3c4257;--rnf-color-gray-600: #515669;--rnf-color-gray-500: #697386;--rnf-color-gray-400: #9ea0aa;--rnf-color-gray-300: #a5acb8;--rnf-color-gray-200: #dddee1;--rnf-color-gray-100: #e4e8ee;--rnf-color-brand-500: #e95744;--rnf-color-brand-700: #e4321b;--rnf-color-brand-900: #891e10;--rnf-unread-badge-bg-color: #dd514c;--rnf-avatar-bg-color: #ef8476;--rnf-message-cell-unread-dot-bg-color: #f4ada4;--rnf-message-cell-hover-bg-color: #f1f6fc}:root{--rnf-empty-feed-max-w: 240px;--rnf-empty-feed-header-font-size: var(--rnf-font-size-md);--rnf-empty-feed-body-font-size: var(--rnf-font-size-sm)}.rnf-empty-feed{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative}.rnf-empty-feed__inner{max-width:var(--rnf-empty-feed-max-w);margin:-20px auto 0;text-align:center}.rnf-empty-feed__header{font-size:var(--rnf-empty-feed-header-font-size);font-weight:var(--rnf-font-weight-medium);color:var(--rnf-color-gray-900);margin:0 0 var(--rnf-spacing-1)}.rnf-empty-feed__body{font-size:var(--rnf-empty-feed-body-font-size);color:var(--rnf-color-gray-300);margin:0}.rnf-empty-feed--dark .rnf-empty-feed__header{color:var(--rnf-color-white-a-75)}.rnf-empty-feed--dark .rnf-empty-feed__body{color:var(--rnf-color-gray-400)}:root{--rnf-button-padding-x: 8px;--rnf-button-padding-y: 4px;--rnf-button-border-radius: 4px;--rnf-button-font-weight: var(--rnf-font-weight-medium);--rnf-button-font-size: var(--rnf-font-size-sm);--rnf-button-primary-bg-color: var(--rnf-color-brand-500);--rnf-button-primary-hover-bg-color: var(--rnf-color-brand-700);--rnf-button-primary-border-color: transparent;--rnf-button-primary-text-color: var(--rnf-color-white);--rnf-button-secondary-bg-color: var(--rnf-color-white);--rnf-button-secondary-hover-bg-color: #dddee1;--rnf-button-secondary-border-color: #dddee1;--rnf-button-secondary-text-color: var(--rnf-color-gray-700)}.rnf-button{display:inline-flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;white-space:nowrap;vertical-align:middle;width:auto;padding:var(--rnf-button-padding-y) var(--rnf-button-padding-x);border-radius:var(--rnf-button-border-radius);font-size:var(--rnf-button-font-size);line-height:var(--rnf-font-size-lg);font-weight:var(--rnf-button-font-weight);border:1px solid;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;transition:all .1s ease-in-out}.rnf-button--full-width{width:100%}.rnf-button--primary{background-color:var(--rnf-button-primary-bg-color);color:var(--rnf-button-primary-text-color);border-color:var(--rnf-button-primary-border-color)}.rnf-button--primary:hover:not(:disabled),.rnf-button--primary:active:not(:disabled){background-color:var(--rnf-button-primary-hover-bg-color)}.rnf-button:disabled{opacity:.4;cursor:not-allowed}.rnf-button--secondary{background-color:var(--rnf-button-secondary-bg-color);color:var(--rnf-button-secondary-text-color);border-color:var(--rnf-button-secondary-border-color)}.rnf-button--secondary:hover:not(:disabled),.rnf-button--secondary:active:not(:disabled){background-color:var(--rnf-button-secondary-hover-bg-color)}.rnf-button--dark.rnf-button--secondary{border-color:#43464c;background-color:#43464c;color:var(--rnf-color-white-a-75)}.rnf-button__button-text-hidden{opacity:0}.rnf-button--dark.rnf-button--secondary:hover:not(:disabled),.rnf-button--dark.rnf-button--secondary:active:not(:disabled){background-color:var(--rnf-color-gray-600)}.rnf-button-spinner{display:flex;align-items:center;font-size:1rem;line-height:"normal"}.rnf-button-spinner--without-label{position:absolute}.rnf-button-spinner--with-label{margin-right:6px}.rnf-button--primary .rnf-button-spinner circle{stroke:#fff}.rnf-button--secondary .rnf-button-spinner circle{stroke:var(--rnf-button-secondary-text-color)}.rnf-button--dark.rnf-button--secondary .rnf-button-spinner circle{stroke:var(--rnf-color-white-a-75)}.rnf-button-group>.rnf-button+.rnf-button{margin-left:8px}:root{--rnf-unseen-badge-bg-color: #eb5757;--rnf-unseen-badge-size: 16px;--rnf-unseed-badge-font-size: 9px}.rnf-unseen-badge{background-color:var(--rnf-unseen-badge-bg-color);width:var(--rnf-unseen-badge-size);height:var(--rnf-unseen-badge-size);border-radius:var(--rnf-unseen-badge-size);position:absolute;display:flex;align-items:center;justify-content:center;top:0;right:0}.rnf-unseen-badge__count{font-size:var(--rnf-unseed-badge-font-size);font-weight:var(--rnf-font-weight-medium);color:var(--rnf-color-white);margin-top:-1px}.rnf-unseen-badge--dark{--rnf-unseen-badge-bg-color: #ef3434}:root{--rnf-avatar-bg-color: #ef8476;--rnf-avatar-size: 32px;--rnf-avatar-initials-font-size: var(--rnf-font-size-md);--rnf-avatar-initials-line-height: var(--rnf-font-size-lg);--rnf-avatar-initials-color: #fff;--rnf-notification-cell-border-bottom-color: #e4e8ee;--rnf-notification-cell-padding: var(--rnf-spacing-3);--rnf-notification-cell-active-bg-color: #f1f6fc;--rnf-notification-cell-unread-dot-size: 6px;--rnf-notification-cell-unread-dot-bg-color: #80c7f5;--rnf-notification-cell-unread-dot-border-color: #3192e3;--rnf-notification-cell-content-color: var(--rnf-color-gray-900);--rnf-notification-cell-content-font-size: var(--rnf-font-size-sm);--rnf-notification-cell-content-line-height: var(--rnf-font-size-lg);--rnf-archive-notification-btn-bg-color: var(--rnf-color-gray-400);--rnf-archive-notification-btn-bg-color-active: var(--rnf-color-gray-500)}.rnf-avatar{background-color:var(--rnf-avatar-bg-color);border-radius:var(--rnf-avatar-size);width:var(--rnf-avatar-size);height:var(--rnf-avatar-size);flex-shrink:0;display:flex;align-items:center;justify-content:center;overflow:hidden}.rnf-avatar__initials{font-size:var(--rnf-avatar-initials-font-size);line-height:var(--rnf-avatar-initials-line-height);color:var(--rnf-avatar-initials-color)}.rnf-avatar__image{object-fit:cover;width:var(--rnf-avatar-size);height:var(--rnf-avatar-size)}.rnf-notification-cell{background-color:transparent;position:relative;border-bottom:1px solid var(--rnf-notification-cell-border-bottom-color)}.rnf-notification-cell:last-child{border-bottom-color:transparent}.rnf-notification-cell:hover,.rnf-notification-cell:focus,.rnf-notification-cell:active{background-color:var(--rnf-notification-cell-active-bg-color);outline:none}.rnf-notification-cell__inner{border:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0;width:100%;text-decoration:none;display:flex;padding:var(--rnf-notification-cell-padding);cursor:pointer;text-align:left;justify-content:flex-start}.rnf-notification-cell__unread-dot{position:absolute;top:var(--rnf-notification-cell-unread-dot-size);left:var(--rnf-notification-cell-unread-dot-size);width:var(--rnf-notification-cell-unread-dot-size);height:var(--rnf-notification-cell-unread-dot-size);border-radius:var(--rnf-notification-cell-unread-dot-size);background-color:var(--rnf-notification-cell-unread-dot-bg-color);border:1px solid var(--rnf-notification-cell-unread-dot-border-color)}.rnf-notification-cell__content-outer{margin-left:var(--rnf-spacing-3)}.rnf-notification-cell__content{color:var(--rnf-notification-cell-content-color);display:block;font-weight:var(--rnf-font-weight-normal);font-size:var(--rnf-notification-cell-content-font-size);line-height:var(--rnf-notification-cell-content-line-height);margin-bottom:var(--rnf-spacing-1);word-break:normal;word-wrap:break-word}.rnf-notification-cell__content h1,.rnf-notification-cell__content h2,.rnf-notification-cell__content h3,.rnf-notification-cell__content h4{font-weight:var(--rnf-font-weight-semibold);margin-bottom:.5em}.rnf-notification-cell__content h1{font-size:var(--rnf-font-size-2xl)}.rnf-notification-cell__content h2{font-size:var(--rnf-font-size-xl)}.rnf-notification-cell__content h3{font-size:var(--rnf-font-size-lg)}.rnf-notification-cell__content h4{font-size:var(--rnf-font-size-md)}.rnf-notification-cell__content p{margin:0 0 .75em}.rnf-notification-cell__content p:last-child{margin-bottom:0}.rnf-notification-cell__content blockquote{border-left:3px solid var(--rnf-color-gray-300);padding-left:var(--rnf-spacing-3);line-height:var(--rnf-font-size-xl);margin:0}.rnf-notification-cell__content strong{font-weight:var(--rnf-font-weight-semibold)}.rnf-notification-cell__timestamp{display:block;color:var(--rnf-color-gray-300);font-size:var(--rnf-font-size-sm);font-weight:var(--rnf-font-weight-normal);line-height:var(--rnf-font-size-lg)}.rnf-notification-cell__child-content{margin:.75em 0 .5em}.rnf-archive-notification-btn{background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-user-select:none;user-select:none;border:none;opacity:0;width:24px;height:24px;cursor:pointer;margin-left:auto;color:var(--rnf-archive-notification-btn-bg-color);padding:var(--rnf-spacing-1) var(--rnf-spacing-2);transition:color .1s ease-in-out,opacity .2s ease-in-out}.rnf-notification-cell:focus .rnf-archive-notification-btn,.rnf-notification-cell:hover .rnf-archive-notification-btn,.rnf-notification-cell:active .rnf-archive-notification-btn{opacity:1}.rnf-archive-notification-btn:focus,.rnf-archive-notification-btn:hover,.rnf-archive-notification-btn:active{outline:none;opacity:1;color:var(--rnf-archive-notification-btn-bg-color-active)}.rnf-tooltip{background-color:var(--rnf-color-gray-700);border-radius:4px;box-shadow:0 2px 4px #0000002e;color:#fff;display:flex;flex-direction:column;padding:var(--rnf-spacing-1) var(--rnf-spacing-2);font-size:var(--rnf-font-size-xs);line-height:var(--rnf-font-size-s);font-weight:var(--rnf-font-weight-medium);transition:opacity .3s;z-index:9999}.rnf-notification-cell--dark{--rnf-notification-cell-border-bottom-color: rgba(105, 115, 134, .65);--rnf-notification-cell-active-bg-color: #393b40;--rnf-notification-cell-content-color: var(--rnf-color-white-a-75)}.rnf-notification-cell--dark:last-child{border-bottom-color:transparent}.rnf-notification-cell--dark .rnf-notification-cell__timestamp{color:var(--rnf-color-gray-500)}.rnf-archive-notification-btn--dark{--rnf-archive-notification-btn-bg-color: var(--rnf-color-gray-500);--rnf-archive-notification-btn-bg-color-active: var(--rnf-color-gray-400)}.rnf-tooltip--dark{background-color:#565a61}:root{--rnf-notification-feed-header-height: 45px}.rnf-notification-feed{background-color:var(--rnf-color-white);height:100%;display:flex;flex-direction:column}.rnf-dropdown{font-size:var(--rnf-font-size-md);font-weight:var(--rnf-font-weight-medium);color:var(--rnf-color-gray-400);position:relative}.rnf-dropdown select{padding-right:var(--rnf-spacing-3);color:currentColor;border:none;background:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;font-size:var(--rnf-font-size-sm);position:relative;text-align:right;z-index:2}.rnf-dropdown svg{position:absolute;top:50%;margin-top:-2px;right:0;z-index:1}.rnf-mark-all-as-read{border:none;background:transparent;margin-left:auto;display:flex;align-items:center;padding:0;font-size:var(--rnf-font-size-sm);color:var(--rnf-color-gray-400);cursor:pointer}.rnf-mark-all-as-read:disabled{color:var(--rnf-color-gray-200);cursor:not-allowed}.rnf-mark-all-as-read svg{margin-top:1px;margin-left:var(--rnf-spacing-1)}.rnf-notification-feed__header{padding:var(--rnf-spacing-3) var(--rnf-spacing-4);height:var(--rnf-notification-feed-header-height);display:flex;align-items:center}.rnf-notification-feed__selector{display:flex;align-items:center}.rnf-notification-feed__type{font-size:var(--rnf-font-size-sm);font-weight:var(--rnf-font-weight-medium);color:var(--rnf-color-gray-900);margin-right:var(--rnf-spacing-2)}.rnf-notification-feed__container{overflow-y:auto;flex:1}.rnf-notification-feed__spinner-container{padding:var(--rnf-spacing-3) var(--rnf-spacing-4)}.rnf-notification-feed__spinner-container svg{margin:0 auto;display:block}.rnf-notification-feed__knock-branding{text-align:center}.rnf-notification-feed__knock-branding a{display:block;font-size:var(--rnf-font-size-sm);color:var(--rnf-color-gray-500);padding:6px;border-top:1px solid var(--rnf-color-gray-100)}.rnf-notification-feed__knock-branding a:hover{background-color:#f1f6fc}.rnf-notification-feed--dark{background-color:#2e2f34}.rnf-notification-feed--dark .rnf-notification-feed__type{color:var(--rnf-color-white-a-75)}.rnf-dropdown--dark{color:var(--rnf-color-gray-400)}.rnf-mark-all-as-read--dark:disabled{color:var(--rnf-color-gray-500)}.rnf-notification-feed--dark .rnf-notification-feed__knock-branding a{color:var(--rnf-color-gray-400);border-top-color:#697386a6}.rnf-notification-feed--dark .rnf-notification-feed__knock-branding a:hover{background-color:#393b40}:root{--rnf-notification-icon-button-size: 32px;--rnf-notification-icon-button-bg-color: transparent}.rnf-notification-icon-button{background-color:var(--rnf-notification-icon-button-bg-color);border:none;position:relative;display:block;margin:0;padding:0;cursor:pointer;width:var(--rnf-notification-icon-button-size);height:var(--rnf-notification-icon-button-size);color:inherit}.rnf-notification-icon-button svg{display:block;margin:0 auto}.rnf-notification-icon-button--dark{color:#fff}:root{--rnf-notification-feed-popover-max-w: 400px;--rnf-notification-feed-popover-min-w: 280px;--rnf-notification-feed-popover-height: 400px;--rnf-notification-feed-popover-shadow: drop-shadow( 0px 5px 15px rgba(0, 0, 0, .2) );--rnf-notification-feed-popover-shadow-color: rgba(0, 0, 0, .2);--rnf-notification-feed-popover-bg-color: #fff;--rnf-notification-feed-popover-z-index: 999;--rnf-notification-feed-popover-arrow-size: 10px;--rnf-notification-feed-popover-border-radius: 4px}.rnf-notification-feed-popover{width:100%;max-width:var(--rnf-notification-feed-popover-max-w);min-width:var(--rnf-notification-feed-popover-min-w);height:var(--rnf-notification-feed-popover-height);z-index:var(--rnf-notification-feed-popover-z-index)}.rnf-notification-feed-popover__inner{overflow:hidden;background-color:var(--rnf-notification-feed-popover-bg-color);border-radius:var(--rnf-notification-feed-popover-border-radius);filter:var(--rnf-notification-feed-popover-shadow);height:100%}.rnf-notification-feed-popover__arrow{position:absolute;width:var(--rnf-notification-feed-popover-arrow-size);height:var(--rnf-notification-feed-popover-arrow-size)}.rnf-notification-feed-popover__arrow:after{content:" ";display:block;background-color:var(--rnf-notification-feed-popover-bg-color);box-shadow:-1px -1px 1px var(--rnf-notification-feed-popover-shadow-color);position:absolute;top:-5px;left:0;transform:rotate(45deg);width:var(--rnf-notification-feed-popover-arrow-size);height:var(--rnf-notification-feed-popover-arrow-size)}.rnf-notification-feed-popover--dark{--rnf-notification-feed-popover-shadow-color: rgba(0, 0, 0, .2)}
@@ -0,0 +1,3 @@
1
+ declare function App(): import("react/jsx-runtime").JSX.Element;
2
+ export default App;
3
+ //# sourceMappingURL=App.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/App.tsx"],"names":[],"mappings":"AAGA,iBAAS,GAAG,4CA4BX;AAED,eAAe,GAAG,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./modules/core";
2
+ export * from "./modules/feed";
3
+ export * from "@knocklabs/react-core";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AACrB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.tsx"],"names":[],"mappings":"AAGA,OAAO,aAAa,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React, { PropsWithChildren } from "react";
2
+ export type ButtonProps = {
3
+ variant: "primary" | "secondary";
4
+ loadingText?: string;
5
+ isLoading?: boolean;
6
+ isDisabled?: boolean;
7
+ isFullWidth?: boolean;
8
+ onClick: (e: React.MouseEvent) => void;
9
+ };
10
+ export declare const Button: React.FC<PropsWithChildren<ButtonProps>>;
11
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/core/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAIjD,OAAO,cAAc,CAAC;AAEtB,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,SAAS,GAAG,WAAW,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAqC3D,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React, { PropsWithChildren } from "react";
2
+ export declare const ButtonGroup: React.FC<PropsWithChildren>;
3
+ //# sourceMappingURL=ButtonGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/core/components/Button/ButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,cAAc,CAAC;AAEtB,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAEnD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ type ButtonSpinnerProps = {
3
+ hasLabel: boolean;
4
+ };
5
+ export declare const ButtonSpinner: React.FC<ButtonSpinnerProps>;
6
+ export {};
7
+ //# sourceMappingURL=ButtonSpinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonSpinner.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/core/components/Button/ButtonSpinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,cAAc,CAAC;AAEtB,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAQtD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./Button";
2
+ export * from "./ButtonGroup";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/core/components/Button/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC"}
@@ -0,0 +1,6 @@
1
+ declare function BellIcon({ width, height }: {
2
+ width?: number | undefined;
3
+ height?: number | undefined;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export { BellIcon };
6
+ //# sourceMappingURL=Bell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bell.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/core/components/Icons/Bell.tsx"],"names":[],"mappings":"AAAA,iBAAS,QAAQ,CAAC,EAAE,KAAU,EAAE,MAAW,EAAE;;;CAAA,2CAmB5C;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const CheckmarkCircle: () => import("react/jsx-runtime").JSX.Element;
2
+ export { CheckmarkCircle };
3
+ //# sourceMappingURL=CheckmarkCircle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckmarkCircle.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/core/components/Icons/CheckmarkCircle.tsx"],"names":[],"mappings":"AAAA,QAAA,MAAM,eAAe,+CAsBpB,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const ChevronDown: () => import("react/jsx-runtime").JSX.Element;
2
+ export { ChevronDown };
3
+ //# sourceMappingURL=ChevronDown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChevronDown.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/core/components/Icons/ChevronDown.tsx"],"names":[],"mappings":"AAAA,QAAA,MAAM,WAAW,+CAgBhB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const CloseCircle: () => import("react/jsx-runtime").JSX.Element;
2
+ export { CloseCircle };
3
+ //# sourceMappingURL=CloseCircle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CloseCircle.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/core/components/Icons/CloseCircle.tsx"],"names":[],"mappings":"AAAA,QAAA,MAAM,WAAW,+CAahB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from "./Bell";
2
+ export * from "./CheckmarkCircle";
3
+ export * from "./ChevronDown";
4
+ export * from "./CloseCircle";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/core/components/Icons/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ type Speed = "fast" | "slow" | "medium";
3
+ export interface SpinnerProps {
4
+ color?: string;
5
+ speed?: Speed;
6
+ gap?: number;
7
+ thickness?: number;
8
+ size?: string;
9
+ }
10
+ export declare const Spinner: React.FC<SpinnerProps>;
11
+ export {};
12
+ //# sourceMappingURL=Spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/core/components/Spinner/Spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAQxC,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAgD1C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./Spinner";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/core/components/Spinner/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as useOnBottomScroll } from "./useOnBottomScroll";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/core/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ type Options = {
3
+ closeOnClickOutside: boolean;
4
+ };
5
+ export default function useComponentVisible(isVisible: boolean, onClose: (event: Event) => void, options: Options): {
6
+ ref: import("react").RefObject<HTMLDivElement>;
7
+ };
8
+ export {};
9
+ //# sourceMappingURL=useComponentVisible.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useComponentVisible.d.ts","sourceRoot":"","sources":["../../../../../src/modules/core/hooks/useComponentVisible.ts"],"names":[],"mappings":";AAOA,KAAK,OAAO,GAAG;IACb,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,mBAAmB,CACzC,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,EAC/B,OAAO,EAAE,OAAO;;EAiCjB"}
@@ -0,0 +1,9 @@
1
+ import { RefObject } from "react";
2
+ type OnBottomScrollOptions = {
3
+ ref: RefObject<HTMLDivElement | undefined>;
4
+ callback: () => void;
5
+ offset?: number;
6
+ };
7
+ declare function useOnBottomScroll(options: OnBottomScrollOptions): void;
8
+ export default useOnBottomScroll;
9
+ //# sourceMappingURL=useOnBottomScroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOnBottomScroll.d.ts","sourceRoot":"","sources":["../../../../../src/modules/core/hooks/useOnBottomScroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmC,MAAM,OAAO,CAAC;AAGnE,KAAK,qBAAqB,GAAG;IAC3B,GAAG,EAAE,SAAS,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAIF,iBAAS,iBAAiB,CAAC,OAAO,EAAE,qBAAqB,QAgCxD;AAED,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from "./components/Button";
2
+ export * from "./components/Icons";
3
+ export * from "./components/Spinner";
4
+ export * from "./hooks";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ export declare const EmptyFeed: React.FC;
3
+ //# sourceMappingURL=EmptyFeed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyFeed.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/feed/components/EmptyFeed/EmptyFeed.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,cAAc,CAAC;AAEtB,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAY7B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./EmptyFeed";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/feed/components/EmptyFeed/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { FeedItem } from "@knocklabs/client";
2
+ import React from "react";
3
+ export interface ArchiveButtonProps {
4
+ item: FeedItem;
5
+ }
6
+ declare const ArchiveButton: React.FC<ArchiveButtonProps>;
7
+ export { ArchiveButton };
8
+ //# sourceMappingURL=ArchiveButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArchiveButton.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/feed/components/NotificationCell/ArchiveButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAkC,MAAM,OAAO,CAAC;AAKvD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAuC/C,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ export interface AvatarProps {
3
+ name: string;
4
+ src?: string | null;
5
+ }
6
+ export declare const Avatar: React.FC<AvatarProps>;
7
+ //# sourceMappingURL=Avatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/feed/components/NotificationCell/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAmBxC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React, { ReactNode } from "react";
2
+ import { FeedItem } from "@knocklabs/client";
3
+ export interface NotificationCellProps {
4
+ item: FeedItem;
5
+ onItemClick?: (item: FeedItem) => void;
6
+ avatar?: ReactNode;
7
+ children?: ReactNode;
8
+ archiveButton?: ReactNode;
9
+ }
10
+ export declare const NotificationCell: React.ForwardRefExoticComponent<NotificationCellProps & React.RefAttributes<HTMLDivElement>>;
11
+ //# sourceMappingURL=NotificationCell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationCell.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/feed/components/NotificationCell/NotificationCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAClD,OAAO,EAAgB,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAU3D,OAAO,cAAc,CAAC;AAEtB,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,aAAa,CAAC,EAAE,SAAS,CAAC;CAC3B;AAMD,eAAO,MAAM,gBAAgB,8FAuF3B,CAAC"}