@stack-spot/portal-components 1.2.0 → 1.3.0-rc

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 (77) hide show
  1. package/dist/components/AsyncContent.d.ts +39 -0
  2. package/dist/components/AsyncContent.d.ts.map +1 -0
  3. package/dist/components/AsyncContent.js +27 -0
  4. package/dist/components/AsyncContent.js.map +1 -0
  5. package/dist/components/InfiniteScroll.d.ts +3 -0
  6. package/dist/components/InfiniteScroll.d.ts.map +1 -0
  7. package/dist/components/InfiniteScroll.js +5 -0
  8. package/dist/components/InfiniteScroll.js.map +1 -0
  9. package/dist/components/LazyMarkdown/BlockquoteMd.d.ts +4 -0
  10. package/dist/components/LazyMarkdown/BlockquoteMd.d.ts.map +1 -0
  11. package/dist/components/LazyMarkdown/BlockquoteMd.js +64 -0
  12. package/dist/components/LazyMarkdown/BlockquoteMd.js.map +1 -0
  13. package/dist/components/LazyMarkdown/CodeViewer.d.ts +19 -0
  14. package/dist/components/LazyMarkdown/CodeViewer.d.ts.map +1 -0
  15. package/dist/components/LazyMarkdown/CodeViewer.js +116 -0
  16. package/dist/components/LazyMarkdown/CodeViewer.js.map +1 -0
  17. package/dist/components/LazyMarkdown/Markdown.d.ts +6 -0
  18. package/dist/components/LazyMarkdown/Markdown.d.ts.map +1 -0
  19. package/dist/components/LazyMarkdown/Markdown.js +87 -0
  20. package/dist/components/LazyMarkdown/Markdown.js.map +1 -0
  21. package/dist/components/LazyMarkdown/MarkdownButton.d.ts +8 -0
  22. package/dist/components/LazyMarkdown/MarkdownButton.d.ts.map +1 -0
  23. package/dist/components/LazyMarkdown/MarkdownButton.js +4 -0
  24. package/dist/components/LazyMarkdown/MarkdownButton.js.map +1 -0
  25. package/dist/components/LazyMarkdown/Video.d.ts +4 -0
  26. package/dist/components/LazyMarkdown/Video.d.ts.map +1 -0
  27. package/dist/components/LazyMarkdown/Video.js +3 -0
  28. package/dist/components/LazyMarkdown/Video.js.map +1 -0
  29. package/dist/components/LazyMarkdown/index.d.ts +8 -0
  30. package/dist/components/LazyMarkdown/index.d.ts.map +1 -0
  31. package/dist/components/LazyMarkdown/index.js +8 -0
  32. package/dist/components/LazyMarkdown/index.js.map +1 -0
  33. package/dist/components/Notifications/NotificationComponent.d.ts +24 -0
  34. package/dist/components/Notifications/NotificationComponent.d.ts.map +1 -0
  35. package/dist/components/Notifications/NotificationComponent.js +114 -0
  36. package/dist/components/Notifications/NotificationComponent.js.map +1 -0
  37. package/dist/components/Notifications/NotificationItem.d.ts +11 -0
  38. package/dist/components/Notifications/NotificationItem.d.ts.map +1 -0
  39. package/dist/components/Notifications/NotificationItem.js +59 -0
  40. package/dist/components/Notifications/NotificationItem.js.map +1 -0
  41. package/dist/components/Notifications/index.d.ts +4 -0
  42. package/dist/components/Notifications/index.d.ts.map +1 -0
  43. package/dist/components/Notifications/index.js +4 -0
  44. package/dist/components/Notifications/index.js.map +1 -0
  45. package/dist/components/Notifications/types.d.ts +38 -0
  46. package/dist/components/Notifications/types.d.ts.map +1 -0
  47. package/dist/components/Notifications/types.js +20 -0
  48. package/dist/components/Notifications/types.js.map +1 -0
  49. package/dist/components/ScrollView.d.ts +27 -0
  50. package/dist/components/ScrollView.d.ts.map +1 -0
  51. package/dist/components/ScrollView.js +25 -0
  52. package/dist/components/ScrollView.js.map +1 -0
  53. package/dist/components/StatusCircle.d.ts +14 -0
  54. package/dist/components/StatusCircle.d.ts.map +1 -0
  55. package/dist/components/StatusCircle.js +26 -0
  56. package/dist/components/StatusCircle.js.map +1 -0
  57. package/dist/hooks/date.d.ts +22 -0
  58. package/dist/hooks/date.d.ts.map +1 -0
  59. package/dist/hooks/date.js +40 -0
  60. package/dist/hooks/date.js.map +1 -0
  61. package/package.json +16 -5
  62. package/src/components/AsyncContent.tsx +70 -0
  63. package/src/components/InfiniteScroll.tsx +13 -0
  64. package/src/components/LazyMarkdown/BlockquoteMd.tsx +94 -0
  65. package/src/components/LazyMarkdown/CodeViewer.tsx +154 -0
  66. package/src/components/LazyMarkdown/Markdown.tsx +107 -0
  67. package/src/components/LazyMarkdown/MarkdownButton.tsx +13 -0
  68. package/src/components/LazyMarkdown/Video.tsx +6 -0
  69. package/src/components/LazyMarkdown/index.tsx +18 -0
  70. package/src/components/Notifications/NotificationComponent.tsx +264 -0
  71. package/src/components/Notifications/NotificationItem.tsx +136 -0
  72. package/src/components/Notifications/index.tsx +3 -0
  73. package/src/components/Notifications/types.ts +46 -0
  74. package/src/components/ScrollView.tsx +51 -0
  75. package/src/components/StatusCircle.tsx +44 -0
  76. package/src/hooks/date.ts +43 -0
  77. package/src/index.ts +0 -1
@@ -0,0 +1,39 @@
1
+ import { MutableRefObject } from 'react';
2
+ export interface ErrorProps {
3
+ /**
4
+ * The error component to be rendered in case of error. It should receive error props
5
+ */
6
+ errorComponent: React.FC<{
7
+ error: any;
8
+ }>;
9
+ /**
10
+ * The function to report the error.
11
+ */
12
+ reportError: (error: any) => void;
13
+ }
14
+ interface Props {
15
+ /**
16
+ * Whether or not to show the loading feedback.
17
+ */
18
+ loading: boolean;
19
+ /**
20
+ * A javascript error. Used to show error feedbacks.
21
+ */
22
+ error?: any;
23
+ /**
24
+ * If provided, this element will receive focus as soon as the content is loaded and has no errors.
25
+ * Can be either a React Ref Object or a query selector.
26
+ */
27
+ autofocus?: string | MutableRefObject<HTMLElement>;
28
+ /**
29
+ * The content to show if it's not loading or has errors.
30
+ */
31
+ children: React.ReactNode;
32
+ /**
33
+ * The error details component.
34
+ */
35
+ errorDetails: ErrorProps;
36
+ }
37
+ export declare const AsyncContent: ({ loading, error, autofocus, children, errorDetails }: Props) => string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
38
+ export {};
39
+ //# sourceMappingURL=AsyncContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AsyncContent.d.ts","sourceRoot":"","sources":["../../src/components/AsyncContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAA8B,MAAM,OAAO,CAAA;AAEpE,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,cAAc,EAAG,KAAK,CAAC,EAAE,CAAC;QAAE,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC,CAAC;IAC1C;;OAEG;IACH,WAAW,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,UAAU,KAAK;IACb;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;IACnD;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;MAEE;IACF,YAAY,EAAE,UAAU,CAAC;CAC1B;AAED,eAAO,MAAM,YAAY,0DAA2D,KAAK,iIA8BxF,CAAA"}
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Flex } from '@citric/core';
3
+ import { LoadingCircular } from '@citric/ui';
4
+ import { useEffect, useLayoutEffect } from 'react';
5
+ export const AsyncContent = ({ loading, error, autofocus, children, errorDetails }) => {
6
+ const ErrorComponent = errorDetails.errorComponent;
7
+ useEffect(() => {
8
+ if (error) {
9
+ errorDetails.reportError(error);
10
+ // eslint-disable-next-line no-console
11
+ console.error(error);
12
+ }
13
+ }, [error]);
14
+ useLayoutEffect(() => {
15
+ if (!loading && !error) {
16
+ typeof autofocus === 'string' ? document.querySelector(autofocus)?.focus?.() : autofocus?.current?.focus();
17
+ }
18
+ }, [loading, error]);
19
+ if (loading) {
20
+ return (_jsx(Flex, { alignItems: "center", justifyContent: "center", flex: 1, style: { padding: '80px' }, "data-test-hint": "loading", children: _jsx(LoadingCircular, {}) }));
21
+ }
22
+ if (error) {
23
+ return _jsx(ErrorComponent, { error: error });
24
+ }
25
+ return children;
26
+ };
27
+ //# sourceMappingUR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CAAA;IACH,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,GAAI,CAAA;IACzC,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { Props as ReactInfiniteScrollProps } from 'react-infinite-scroll-component';
2
+ export declare const InfiniteScroll: ({ style, children, scrollableTarget, ...props }: Omit<ReactInfiniteScrollProps, 'loader'>) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=InfiniteScroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfiniteScroll.d.ts","sourceRoot":"","sources":["../../src/components/InfiniteScroll.tsx"],"names":[],"mappings":"AACA,OAA4B,EAAE,KAAK,IAAI,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAExG,eAAO,MAAM,cAAc,oDAAqD,KAAK,wBAAwB,EAAE,QAAQ,CAAC,4CASvH,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { LoadingCircular } from '@citric/ui';
3
+ import ReactInfiniteScroll from 'react-infinite-scroll-component';
4
+ export const InfiniteScroll = ({ style, children, scrollableTarget, ...props }) => (_jsx(ReactInfiniteScroll, { loader: _jsx(LoadingCircular, {}), scrollableTarget: scrollableTarget || 'page', style: { overflow: 'hidden', ...style }, ...props, children: children }));
5
+ //# sourceMappingURL=InfiniteScroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InfiniteScroll.js","sourceRoot":"","sources":["../../src/components/InfiniteScroll.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,mBAA0D,MAAM,iCAAiC,CAAA;AAExG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,KAAK,EAA4C,EAAE,EAAE,CAAC,CAC3H,KAAC,mBAAmB,IAClB,MAAM,EAAE,KAAC,eAAe,KAAG,EAC3B,gBAAgB,EAAE,gBAAgB,IAAI,MAAM,EAC5C,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,KACnC,KAAK,YAER,QAAQ,GACW,CACvB,CAAA"}
@@ -0,0 +1,4 @@
1
+ export declare const BlockquoteMd: ({ props }: {
2
+ props: any;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=BlockquoteMd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockquoteMd.d.ts","sourceRoot":"","sources":["../../../src/components/LazyMarkdown/BlockquoteMd.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY,cAAe;IAAE,KAAK,EAAE,GAAG,CAAA;CAAE,4CAoCrD,CAAA"}
@@ -0,0 +1,64 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Blockquote, Box, Flex, IconBox, Text } from '@citric/core';
3
+ import * as icons from '@citric/icons';
4
+ import { useTranslate } from '@stack-spot/portal-translate';
5
+ import { createElement } from 'react';
6
+ export const BlockquoteMd = ({ props }) => {
7
+ const t = useTranslate(dictionary);
8
+ const arrayNode = props.node;
9
+ const blockItem = arrayNode?.children[1]?.children[0]?.value;
10
+ const blockStyle = blockquoteAlertStyle(blockItem);
11
+ if (blockStyle) {
12
+ const childrenBlock = arrayNode?.children[3]?.children[1].children[0].value;
13
+ return (_jsx(Flex, { sx: { borderRadius: 'sm', bg: 'light.500', my: 3 }, children: _jsx(Blockquote, { colorScheme: blockStyle.color, children: _jsxs(Box, { children: [_jsxs(Flex, { children: [_jsx(IconBox, { appearance: "square", colorIcon: `${blockStyle.color}.400`, sx: { mr: 4 }, children: createElement(icons[blockStyle.icon]) }), _jsx(Text, { sx: { color: `${blockStyle.color}.400` }, weight: "medium", children: t[blockItem] })] }), _jsx(Box, { my: 3, children: _jsx(Text, { children: childrenBlock }) })] }) }) }));
14
+ }
15
+ return (_jsx(Flex, { sx: { borderRadius: 'sm', bg: 'light.500', my: 3 }, children: _jsx(Blockquote, { children: _jsx(Text, { ...props }) }) }));
16
+ };
17
+ function blockquoteAlertStyle(blockRule) {
18
+ const style = {
19
+ '[!NOTE]': {
20
+ color: 'inverse',
21
+ icon: 'Document',
22
+ },
23
+ '[!INFO]': {
24
+ color: 'secondary',
25
+ icon: 'InfoCircle',
26
+ },
27
+ '[!IMPORTANT]': {
28
+ color: 'tertiary',
29
+ icon: 'MobileComments',
30
+ },
31
+ '[!TIP]': {
32
+ color: 'success',
33
+ icon: 'Star',
34
+ },
35
+ '[!WARNING]': {
36
+ color: 'warning',
37
+ icon: 'ExclamationTriangle',
38
+ },
39
+ '[!DANGER]': {
40
+ color: 'danger',
41
+ icon: 'Bug',
42
+ },
43
+ };
44
+ return style[blockRule];
45
+ }
46
+ const dictionary = {
47
+ en: {
48
+ '[!NOTE]': 'Note',
49
+ '[!INFO]': 'Info',
50
+ '[!IMPORTANT]': 'Important',
51
+ '[!TIP]': 'Tip',
52
+ '[!WARNING]': 'Warning',
53
+ '[!DANGER]': 'Danger',
54
+ },
55
+ pt: {
56
+ '[!NOTE]': 'Nota',
57
+ '[!INFO]': 'Informação',
58
+ '[!IMPORTANT]': 'Importante',
59
+ '[!TIP]': 'Dica',
60
+ '[!WARNING]': 'Atenção',
61
+ '[!DANGER]': 'Risco',
62
+ },
63
+ };
64
+ //# sourceMappingURL=BlockquoteMd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockquoteMd.js","sourceRoot":"","sources":["../../../src/components/LazyMarkdown/BlockquoteMd.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnE,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AACtC,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA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: string;
4
+ onClickRefresh?: () => void;
5
+ height?: string;
6
+ scrollable?: boolean;
7
+ copyButton?: boolean;
8
+ }
9
+ export declare const CodeViewer: ({ language, data, onClickRefresh, scrollable, copyButton }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const codeViewerLocale: {
11
+ en: {
12
+ noData: string;
13
+ };
14
+ pt: {
15
+ noData: string;
16
+ };
17
+ };
18
+ export {};
19
+ //# sourceMappingURL=CodeViewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeViewer.d.ts","sourceRoot":"","sources":["../../../src/components/LazyMarkdown/CodeViewer.tsx"],"names":[],"mappings":"AAyGA,UAAU,KAAK;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AACD,eAAO,MAAM,UAAU,+DAAuE,KAAK,4CA+BlG,CAAA;AAED,eAAO,MAAM,gBAAgB;;;;;;;CAO5B,CAAA"}
@@ -0,0 +1,116 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Box, Flex, Text } from '@citric/core';
3
+ import { getColor, getRadius } from '@citric/core/dist/utils/theme.js';
4
+ import { Copy, Refresh } from '@citric/icons';
5
+ import { IconButton } from '@citric/ui';
6
+ import { useTranslate } from '@stack-spot/portal-translate';
7
+ import SyntaxHighlighter from 'react-syntax-highlighter';
8
+ import styled from 'styled-components';
9
+ const style = {
10
+ scrollable: {
11
+ minHeight: '64px',
12
+ maxHeight: '232px',
13
+ overflow: 'auto',
14
+ '&::-webkit-scrollbar': {
15
+ width: '4px',
16
+ height: '4px',
17
+ },
18
+ '&::-webkit-scrollbar-track': {
19
+ background: 'light.400',
20
+ borderRadius: '2px',
21
+ },
22
+ '&::-webkit-scrollbar-thumb': {
23
+ background: 'light.700',
24
+ borderRadius: '2px',
25
+ },
26
+ },
27
+ };
28
+ const Wrapper = styled(Box) `
29
+ background-color: ${({ theme }) => getColor(theme, 'gray.900')};
30
+ border-radius: ${({ theme }) => getRadius(theme, 'xs')};
31
+ position: relative;
32
+ padding: 8px;
33
+ overflow: hidden;
34
+
35
+ > .scrollable-container {
36
+ min-height: 64px;
37
+ max-height: 232px;
38
+ overflow: auto;
39
+ &::-webkit-scrollbar {
40
+ width: 4px;
41
+ height: 4px;
42
+ }
43
+ &::-webkit-scrollbar-track {
44
+ background: ${({ theme }) => getColor(theme, 'light.400')};
45
+ border-radius: 2px;
46
+ }
47
+ &::-webkit-scrollbar-thumb,
48
+ &::-webkit-scrollbar-thumb:hover {
49
+ background: ${({ theme }) => getColor(theme, 'light.700')};
50
+ border-radius: 2px;
51
+ }
52
+ }
53
+
54
+ pre {
55
+ background-color: transparent;
56
+ font-family: 'Roboto Mono';
57
+ font-size: 14.4px;
58
+ padding: 0;
59
+ margin-top: 0;
60
+ overflow: unset;
61
+ text-shadow: none;
62
+ color: #fff;
63
+ }
64
+
65
+ .hljs-string {
66
+ color: ${({ theme }) => getColor(theme, 'teal.300')};
67
+ }
68
+ .hljs-tag {
69
+ color: ${({ theme }) => getColor(theme, 'teal')};
70
+ }
71
+ .hljs-attr {
72
+ color: #fff;
73
+ }
74
+ .hljs-number {
75
+ color: #fff;
76
+ }
77
+ .hljs-property {
78
+ color: #fff;
79
+ }
80
+ .hljs-keyword {
81
+ color: #75dcff;
82
+ }
83
+ .comment {
84
+ color: #8e8e93;
85
+ }
86
+ .hljs-expression {
87
+ color: #f57f17;
88
+ }
89
+
90
+ .button-group {
91
+ position: absolute;
92
+ top: 8px;
93
+ right: 24px;
94
+ display: flex;
95
+
96
+ button {
97
+ margin-left: 6px;
98
+ &:focus {
99
+ background-color: ${({ theme }) => getColor(theme, 'light.300')};
100
+ }
101
+ }
102
+ }
103
+ `;
104
+ export const CodeViewer = ({ language, data, onClickRefresh, scrollable = true, copyButton }) => {
105
+ const t = useTranslate(codeViewerLocale);
106
+ return (_jsx(Wrapper, { children: data ? (_jsxs(_Fragment, { children: [_jsx(Flex, { style: scrollable ? style.scrollable : undefined, children: _jsx(SyntaxHighlighter, { language: language, showLineNumbers: true, useInlineStyles: false, children: String(data).replace(/\n$/, '') }) }), _jsxs("div", { className: "button-group", children: [onClickRefresh && (_jsx(IconButton, { onClick: onClickRefresh, children: _jsx(Refresh, {}) })), copyButton ? (_jsx(IconButton, { onClick: () => navigator.clipboard.writeText(data), children: _jsx(Copy, {}) })) : null] })] })) : (_jsx(Text, { appearance: "body2", children: t.noData })) }));
107
+ };
108
+ export const codeViewerLocale = {
109
+ en: {
110
+ noData: 'No data available.',
111
+ },
112
+ pt: {
113
+ noData: 'Sem dados disponíveis.',
114
+ },
115
+ };
116
+ //# sourceMappingURL=CodeViewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeViewer.js","sourceRoot":"","sources":["../../../src/components/LazyMarkdown/CodeViewer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,iBAAiB,MAAM,0BAA0B,CAAA;AACxD,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,KAAK,GAAG;IACZ,UAAU,EAAE;QACV,SAAS,EAAE,MAAM;QACjB,SAAS,EAAE,OAAO;QAClB,QAAQ,EAAE,MAAM;QAChB,sBAAsB,EAAE;YACtB,KAAK,EAAE,KAAK;YACZ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E,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,YACpD,KAAC,iBAAiB,IAAC,QAAQ,EAAE,QAAQ,EAAE,eAAe,QAAC,eAAe,EAAE,KAAK,YAC1E,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,GACd,GACf,EACP,eAAK,SAAS,EAAC,cAAc,aAC1B,cAAc,IAAI,CACjB,KAAC,UAAU,IAAC,OAAO,EAAE,cAAc,YACjC,KAAC,OAAO,KAAG,GACA,CACd,EAEA,UAAU,CAAC,CAAC,CAAC,CACZ,KAAC,UAAU,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,YAC5D,KAAC,IAAI,KAAG,GACG,CACd,CAAC,CAAC,CAAC,IAAI,IACJ,IACL,CACJ,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,UAAU,EAAC,OAAO,YAAE,CAAC,CAAC,MAAM,GAAQ,CAC3C,GACO,CACX,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,EAAE,EAAE;QACF,MAAM,EAAE,oBAAoB;KAC7B;IACD,EAAE,EAAE;QACF,MAAM,EAAE,wBAAwB;KACjC;CACF,CAAA"}
@@ -0,0 +1,6 @@
1
+ interface MarkdownProps {
2
+ children: string;
3
+ }
4
+ declare const Markdown: ({ children }: MarkdownProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default Markdown;
6
+ //# sourceMappingURL=Markdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../src/components/LazyMarkdown/Markdown.tsx"],"names":[],"mappings":"AAUA,UAAU,aAAa;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAuFD,QAAA,MAAM,QAAQ,iBAAkB,aAAa,4CAI5C,CAAA;AAGD,eAAe,QAAQ,CAAA"}
@@ -0,0 +1,87 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Box, Image, Link, Text } from '@citric/core';
3
+ import { Table, Tbody, Td, Th, Thead, Tr } from '@citric/ui';
4
+ import ReactMarkdown from 'react-markdown';
5
+ import rehypeRaw from 'rehype-raw';
6
+ import remarkGfm from 'remark-gfm';
7
+ import { BlockquoteMd } from './BlockquoteMd.js';
8
+ import { CodeViewer } from './CodeViewer.js';
9
+ import { Video } from './Video.js';
10
+ const styles = {
11
+ title: {
12
+ mb: 3,
13
+ },
14
+ boxContainer: {
15
+ position: 'relative',
16
+ bg: 'light.300',
17
+ borderRadius: 'sm',
18
+ mb: 10,
19
+ },
20
+ table: {
21
+ borderRadius: 'xs',
22
+ },
23
+ customScroll: {
24
+ height: '232px',
25
+ overflow: 'auto',
26
+ '&::-webkit-scrollbar': {
27
+ width: '2px',
28
+ },
29
+ '&::-webkit-scrollbar-track': {
30
+ background: 'light.400',
31
+ },
32
+ '&::-webkit-scrollbar-thumb': {
33
+ background: 'primary.500',
34
+ },
35
+ '&::-webkit-scrollbar-thumb:hover': {
36
+ background: 'primary.500',
37
+ },
38
+ },
39
+ refreshButton: {
40
+ position: 'absolute',
41
+ top: '8px',
42
+ right: '48px',
43
+ },
44
+ copyButton: {
45
+ position: 'absolute',
46
+ top: '8px',
47
+ right: '16px',
48
+ },
49
+ code: {
50
+ bg: 'blue.900',
51
+ color: 'blue.100',
52
+ px: 1,
53
+ py: 1,
54
+ borderRadius: 'xs',
55
+ },
56
+ };
57
+ const component = () => ({
58
+ p: (props) => _jsx(Text, { appearance: "body2", ...props }),
59
+ strong: (props) => _jsx(Text, { weight: "bold", colorScheme: "light.700", as: "strong", ...props }),
60
+ h1: (props) => _jsx(Text, { as: "h1", appearance: "h2", gutterBottom: true, ...props, sx: styles.title }),
61
+ h2: (props) => _jsx(Text, { as: "h2", appearance: "h3", gutterBottom: true, ...props, sx: styles.title }),
62
+ h3: (props) => _jsx(Text, { as: "h3", appearance: "h4", gutterBottom: true, ...props, sx: styles.title }),
63
+ h4: (props) => _jsx(Text, { as: "h4", appearance: "h5", gutterBottom: true, ...props, sx: styles.title }),
64
+ a: (props) => _jsx(Link, { colorScheme: "primary", ...props, target: "_blank" }),
65
+ table: (props) => _jsx(Table, { appearance: "striped", ...props, sx: styles.table }),
66
+ thead: (props) => _jsx(Thead, { ...props }),
67
+ tbody: (props) => _jsx(Tbody, { ...props }),
68
+ tr: (props) => _jsx(Tr, { ...props }),
69
+ td: (props) => _jsx(Td, { ...props }),
70
+ th: (props) => _jsx(Th, { ...props }),
71
+ li: (props) => _jsx(Text, { as: "li", appearance: "body2", colorScheme: "light.700", ...props }),
72
+ br: (props) => _jsx(Box, { my: 5, ...props }),
73
+ blockquote: (props) => _jsx(BlockquoteMd, { props }),
74
+ video: (props) => _jsx(Video, { ...props }),
75
+ img: (props) => _jsx(Image, { ...props }),
76
+ pre(props) {
77
+ const propComp = props.children.props;
78
+ const match = /language-(\w+)/.exec(propComp.className || '');
79
+ const inferredLanguage = match && match.length > 1 ? match[1] : undefined;
80
+ return (_jsx(Box, { sx: { ...styles.boxContainer }, children: _jsx(CodeViewer, { language: inferredLanguage, ...propComp, data: propComp.children }) }));
81
+ },
82
+ code: ({ ...props }) => _jsx(Text, { as: "code", sx: styles.code, ...props, children: props.children }),
83
+ });
84
+ const Markdown = ({ children }) => (_jsx(ReactMarkdown, { rehypePlugins: [rehypeRaw], remarkPlugins: [remarkGfm], components: component(), children: children }));
85
+ // eslint-disable-next-line import/no-default-export
86
+ export default Markdown;
87
+ //# sourceMappingURL=Markdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Markdown.js","sourceRoot":"","sources":["../../../src/components/LazyMarkdown/Markdown.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAErD,OAAO,EAAE,KAAK,EAAE,KAAK,E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E,EAAE,EAAE,GAAG,MAAM,CAAC,YAAY,EAAE,YACjC,KAAC,UAAU,IAAC,QAAQ,EAAE,gBAAgB,KAAM,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,QAAQ,GAAI,GAC7E,CACP,CAAA;IACH,CAAC;IACD,IAAI,EAAE,CAAC,EAAE,GAAG,KAAK,EAAO,EAAE,EAAE,CAC1B,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,EAAE,EAAE,MAAM,CAAC,IAAI,KAAM,KAAK,YACvC,KAAK,CAAC,QAAQ,GACV;CACV,CAAC,CAAA;AAEF,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,EAAiB,EAAE,EAAE,CAAC,CAChD,KAAC,aAAa,IAAC,aAAa,EAAE,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,YAC3F,QAAQ,GACK,CACjB,CAAA;AAED,oDAAoD;AACpD,eAAe,QAAQ,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ interface MarkdownButtonProps {
3
+ onClick?: () => void;
4
+ children: ReactNode;
5
+ }
6
+ export declare const MarkdownButton: ({ ...props }: MarkdownButtonProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=MarkdownButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarkdownButton.d.ts","sourceRoot":"","sources":["../../../src/components/LazyMarkdown/MarkdownButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,UAAU,mBAAmB;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,iBAAkB,mBAAmB,4CAI/D,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { IconButton } from '@citric/ui';
3
+ export const MarkdownButton = ({ ...props }) => (_jsx(IconButton, { sx: { position: 'absolute', top: '16px', right: '16px' }, onClick: props.onClick, children: props.children }));
4
+ //# sourceMappingURL=MarkdownButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarkdownButton.js","sourceRoot":"","sources":["../../../src/components/LazyMarkdown/MarkdownButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAQvC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,GAAG,KAAK,EAAuB,EAAE,EAAE,CAAC,CACnE,KAAC,UAAU,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,YACzF,KAAK,CAAC,QAAQ,GACJ,CACd,CAAA"}
@@ -0,0 +1,4 @@
1
+ export declare const Video: ({ children }: {
2
+ children: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=Video.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Video.d.ts","sourceRoot":"","sources":["../../../src/components/LazyMarkdown/Video.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,iBAAkB;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,4CAKvD,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export const Video = ({ children }) => (_jsx("iframe", { src: children, allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" }));
3
+ //# sourceMappingURL=Video.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Video.js","sourceRoot":"","sources":["../../../src/components/LazyMarkdown/Video.tsx"],"names":[],"mappings":";AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAE,QAAQ,EAAwB,EAAE,EAAE,CAAC,CAC3D,iBACE,GAAG,EAAE,QAAQ,EACb,KAAK,EAAC,qGAAqG,GAC3G,CACH,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { MarkdownButton } from './MarkdownButton.js';
2
+ interface Props {
3
+ children: string;
4
+ language?: string;
5
+ }
6
+ declare const LazyMarkdown: ({ children }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export { LazyMarkdown, MarkdownButton };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LazyMarkdown/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAIjD,UAAU,KAAK;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,YAAY,iBAAkB,KAAK,4CAIxC,CAAA;AAED,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Skeleton } from '@citric/ui';
3
+ import { Suspense, lazy } from 'react';
4
+ import { MarkdownButton } from './MarkdownButton.js';
5
+ const Markdown = lazy(() => import('./Markdown.js'));
6
+ const LazyMarkdown = ({ children }) => (_jsx(Suspense, { fallback: _jsx(Skeleton, {}), children: _jsx(Markdown, { children: children }) }));
7
+ export { LazyMarkdown, MarkdownButton };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LazyMarkdown/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAA;AAOjD,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAS,EAAE,EAAE,CAAC,CAC5C,KAAC,QAAQ,IAAC,QAAQ,EAAE,KAAC,QAAQ,KAAG,YAC9B,KAAC,QAAQ,cAAE,QAAQ,GAAY,GACtB,CACZ,CAAA;AAED,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,24 @@
1
+ import { ReactElement } from 'react';
2
+ import { ErrorProps } from '../AsyncContent.js';
3
+ import { NotificationTypeFilters, StackspotNotification } from './types.js';
4
+ interface Props {
5
+ hasUnreadNotification?: boolean;
6
+ }
7
+ interface Props {
8
+ onMarkAsRead: (notificationId: string) => void;
9
+ notifications?: StackspotNotification[];
10
+ isLoading: boolean;
11
+ error?: any;
12
+ onClickViewNotifications: () => void;
13
+ onClickViewAll: () => void;
14
+ errorDetails: ErrorProps;
15
+ fetchNextPage: () => void;
16
+ hasNextPage: boolean;
17
+ type?: NotificationTypeFilters;
18
+ onUpdateType: (updatedType?: NotificationTypeFilters) => void;
19
+ placeholderComponent: ReactElement;
20
+ isSummary: boolean;
21
+ }
22
+ export declare const NotificationComponent: ({ hasUnreadNotification, onMarkAsRead, notifications, isLoading, error, type, onUpdateType, onClickViewNotifications, onClickViewAll, errorDetails, fetchNextPage, hasNextPage, placeholderComponent, isSummary, }: Props) => import("react/jsx-runtime").JSX.Element;
23
+ export {};
24
+ //# sourceMappingURL=NotificationComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationComponent.d.ts","sourceRoot":"","sources":["../../../src/components/Notifications/NotificationComponent.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAY,MAAM,OAAO,CAAA;AAE9C,OAAO,EAAgB,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAK1D,OAAO,EAAoB,uBAAuB,EAAE,qBAAqB,EAAc,MAAM,SAAS,CAAA;AAEtG,UAAU,KAAK;IACb,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAkHD,UAAU,KAAK;IACb,YAAY,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,aAAa,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACxC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,wBAAwB,EAAE,MAAM,IAAI,CAAC;IACrC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,YAAY,EAAE,UAAU,CAAC;IACzB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,uBAAuB,CAAC;IAC/B,YAAY,EAAE,CAAC,WAAW,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAC9D,oBAAoB,EAAE,YAAY,CAAC;IACnC,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,qBAAqB,uNAK/B,KAAK,4CAkFP,CAAA"}