@rustic-ai/ui-components 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/calendar/fCCalendar.d.ts +8 -2
- package/dist/components/calendar/fCCalendar.d.ts.map +1 -1
- package/dist/components/calendar/index.css +21 -0
- package/dist/components/calendar/index.d.ts +5 -0
- package/dist/components/calendar/index.d.ts.map +1 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/codeSnippet/index.css +14 -0
- package/dist/components/codeSnippet/index.d.ts +5 -0
- package/dist/components/codeSnippet/index.d.ts.map +1 -0
- package/dist/components/codeSnippet/index.js +1 -0
- package/dist/components/elementRenderer/elementRenderer.d.ts +2 -2
- package/dist/components/elementRenderer/elementRenderer.d.ts.map +1 -1
- package/dist/components/elementRenderer/index.d.ts +3 -0
- package/dist/components/elementRenderer/index.d.ts.map +1 -0
- package/dist/components/elementRenderer/index.js +1 -0
- package/dist/components/image/index.css +43 -0
- package/dist/components/image/index.d.ts +5 -0
- package/dist/components/image/index.d.ts.map +1 -0
- package/dist/components/image/index.js +1 -0
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/input/baseInput/baseInput.d.ts.map +1 -1
- package/dist/components/input/emoji/index.css +16 -0
- package/dist/components/input/emoji/index.d.ts +4 -0
- package/dist/components/input/emoji/index.d.ts.map +1 -0
- package/dist/components/input/emoji/index.js +1 -0
- package/dist/components/input/multimodal/multimodalInput/index.css +227 -0
- package/dist/components/input/multimodal/multimodalInput/index.d.ts +5 -0
- package/dist/components/input/multimodal/multimodalInput/index.d.ts.map +1 -0
- package/dist/components/input/multimodal/multimodalInput/index.js +1 -0
- package/dist/components/input/multimodal/multimodalInput/multimodalInput.d.ts +8 -1
- package/dist/components/input/multimodal/multimodalInput/multimodalInput.d.ts.map +1 -1
- package/dist/components/input/multimodal/uploader/index.css +145 -0
- package/dist/components/input/multimodal/uploader/index.d.ts +5 -0
- package/dist/components/input/multimodal/uploader/index.d.ts.map +1 -0
- package/dist/components/input/multimodal/uploader/index.js +1 -0
- package/dist/components/input/textInput/index.css +57 -0
- package/dist/components/input/textInput/index.d.ts +4 -0
- package/dist/components/input/textInput/index.d.ts.map +1 -0
- package/dist/components/input/textInput/index.js +1 -0
- package/dist/components/input/textInput/textInput.d.ts +0 -3
- package/dist/components/input/textInput/textInput.d.ts.map +1 -1
- package/dist/components/map/index.css +13 -0
- package/dist/components/map/index.d.ts +5 -0
- package/dist/components/map/index.d.ts.map +1 -0
- package/dist/components/map/index.js +1 -0
- package/dist/components/map/openLayersMap.d.ts +6 -1
- package/dist/components/map/openLayersMap.d.ts.map +1 -1
- package/dist/components/markdown/index.d.ts +6 -0
- package/dist/components/markdown/index.d.ts.map +1 -0
- package/dist/components/markdown/index.js +1 -0
- package/dist/components/markdown/markedMarkdown.d.ts +7 -1
- package/dist/components/markdown/markedMarkdown.d.ts.map +1 -1
- package/dist/components/media/audio/index.css +182 -0
- package/dist/components/media/audio/index.d.ts +5 -0
- package/dist/components/media/audio/index.d.ts.map +1 -0
- package/dist/components/media/audio/index.js +1 -0
- package/dist/components/media/video/index.css +225 -0
- package/dist/components/media/video/index.d.ts +5 -0
- package/dist/components/media/video/index.d.ts.map +1 -0
- package/dist/components/media/video/index.js +1 -0
- package/dist/components/menu/index.css +26 -0
- package/dist/components/menu/index.d.ts +4 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/messageCanvas/actions/action.d.ts +12 -0
- package/dist/components/messageCanvas/actions/action.d.ts.map +1 -0
- package/dist/components/messageCanvas/actions/copy/copyText.d.ts +2 -2
- package/dist/components/messageCanvas/actions/copy/copyText.d.ts.map +1 -1
- package/dist/components/messageCanvas/actions/copy/index.css +8 -0
- package/dist/components/messageCanvas/actions/copy/index.d.ts +3 -0
- package/dist/components/messageCanvas/actions/copy/index.d.ts.map +1 -0
- package/dist/components/messageCanvas/actions/copy/index.js +1 -0
- package/dist/components/messageCanvas/actions/index.css +4 -0
- package/dist/components/messageCanvas/actions/index.d.ts +4 -11
- package/dist/components/messageCanvas/actions/index.d.ts.map +1 -1
- package/dist/components/messageCanvas/actions/index.js +1 -0
- package/dist/components/messageCanvas/actions/textToSpeech/index.css +8 -0
- package/dist/components/messageCanvas/actions/textToSpeech/index.d.ts +3 -0
- package/dist/components/messageCanvas/actions/textToSpeech/index.d.ts.map +1 -0
- package/dist/components/messageCanvas/actions/textToSpeech/index.js +1 -0
- package/dist/components/messageCanvas/actions/textToSpeech/textToSpeech.d.ts +2 -2
- package/dist/components/messageCanvas/actions/textToSpeech/textToSpeech.d.ts.map +1 -1
- package/dist/components/messageCanvas/index.css +39 -0
- package/dist/components/messageCanvas/index.d.ts +4 -0
- package/dist/components/messageCanvas/index.d.ts.map +1 -0
- package/dist/components/messageCanvas/index.js +1 -0
- package/dist/components/messageCanvas/messageCanvas.d.ts +5 -5
- package/dist/components/messageCanvas/messageCanvas.d.ts.map +1 -1
- package/dist/components/messageSpace/index.css +63 -0
- package/dist/components/messageSpace/index.d.ts +4 -0
- package/dist/components/messageSpace/index.d.ts.map +1 -0
- package/dist/components/messageSpace/index.js +1 -0
- package/dist/components/messageSpace/messageSpace.d.ts +6 -3
- package/dist/components/messageSpace/messageSpace.d.ts.map +1 -1
- package/dist/components/mockWebSocket.d.ts +5 -0
- package/dist/components/mockWebSocket.d.ts.map +1 -0
- package/dist/components/multipart/index.css +134 -0
- package/dist/components/multipart/index.d.ts +5 -0
- package/dist/components/multipart/index.d.ts.map +1 -0
- package/dist/components/multipart/index.js +1 -0
- package/dist/components/multipart/multipart.d.ts +2 -2
- package/dist/components/multipart/multipart.d.ts.map +1 -1
- package/dist/components/participantsContainer/index.css +42 -0
- package/dist/components/participantsContainer/index.d.ts +5 -0
- package/dist/components/participantsContainer/index.d.ts.map +1 -0
- package/dist/components/participantsContainer/index.js +1 -0
- package/dist/components/participantsContainer/participantsContainer.d.ts +14 -1
- package/dist/components/participantsContainer/participantsContainer.d.ts.map +1 -1
- package/dist/components/pdfViewer/index.css +60 -0
- package/dist/components/pdfViewer/index.d.ts +5 -0
- package/dist/components/pdfViewer/index.d.ts.map +1 -0
- package/dist/components/pdfViewer/index.js +1 -0
- package/dist/components/pdfViewer/pdfViewer.d.ts +4 -0
- package/dist/components/pdfViewer/pdfViewer.d.ts.map +1 -1
- package/dist/components/promptBuilder/index.css +96 -0
- package/dist/components/promptBuilder/index.d.ts +5 -0
- package/dist/components/promptBuilder/index.d.ts.map +1 -0
- package/dist/components/promptBuilder/index.js +1 -0
- package/dist/components/promptBuilder/promptBuilder.d.ts +24 -0
- package/dist/components/promptBuilder/promptBuilder.d.ts.map +1 -0
- package/dist/components/question/index.css +14 -0
- package/dist/components/question/index.d.ts +5 -0
- package/dist/components/question/index.d.ts.map +1 -0
- package/dist/components/question/index.js +1 -0
- package/dist/components/question/question.d.ts +7 -1
- package/dist/components/question/question.d.ts.map +1 -1
- package/dist/components/table/index.css +43 -0
- package/dist/components/table/index.d.ts +5 -0
- package/dist/components/table/index.d.ts.map +1 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/text/index.css +5 -0
- package/dist/components/text/index.d.ts +7 -0
- package/dist/components/text/index.d.ts.map +1 -0
- package/dist/components/text/index.js +1 -0
- package/dist/components/text/text.d.ts +7 -1
- package/dist/components/text/text.d.ts.map +1 -1
- package/dist/components/timestamp/index.d.ts +3 -0
- package/dist/components/timestamp/index.d.ts.map +1 -0
- package/dist/components/timestamp/index.js +1 -0
- package/dist/components/types.d.ts +20 -50
- package/dist/components/types.d.ts.map +1 -1
- package/dist/components/video/index.css +34 -0
- package/dist/components/video/index.d.ts +3 -0
- package/dist/components/video/index.d.ts.map +1 -0
- package/dist/components/video/index.js +1 -0
- package/dist/components/video/youtubeVideo.d.ts +8 -1
- package/dist/components/video/youtubeVideo.d.ts.map +1 -1
- package/dist/components/visualization/chart/index.css +44 -0
- package/dist/components/visualization/chart/index.d.ts +4 -0
- package/dist/components/visualization/chart/index.d.ts.map +1 -0
- package/dist/components/visualization/chart/index.js +1 -0
- package/dist/components/visualization/chart/rechartsTimeSeries.d.ts +8 -1
- package/dist/components/visualization/chart/rechartsTimeSeries.d.ts.map +1 -1
- package/dist/components/visualization/mermaidViz/index.css +21 -0
- package/dist/components/visualization/mermaidViz/index.d.ts +5 -0
- package/dist/components/visualization/mermaidViz/index.d.ts.map +1 -0
- package/dist/components/visualization/mermaidViz/index.js +1 -0
- package/dist/components/visualization/mermaidViz/mermaidViz.d.ts +9 -2
- package/dist/components/visualization/mermaidViz/mermaidViz.d.ts.map +1 -1
- package/dist/components/visualization/mermaidViz/mermaidViz.types.d.ts +10 -0
- package/dist/components/visualization/mermaidViz/mermaidViz.types.d.ts.map +1 -0
- package/dist/components/visualization/perspectiveViz/index.css +16 -0
- package/dist/components/visualization/perspectiveViz/index.d.ts +5 -0
- package/dist/components/visualization/perspectiveViz/index.d.ts.map +1 -0
- package/dist/components/visualization/perspectiveViz/index.js +1 -0
- package/dist/components/visualization/perspectiveViz/perspectiveViz.d.ts +7 -4
- package/dist/components/visualization/perspectiveViz/perspectiveViz.d.ts.map +1 -1
- package/dist/components/visualization/vegaLiteViz/index.css +45 -0
- package/dist/components/visualization/vegaLiteViz/index.d.ts +5 -0
- package/dist/components/visualization/vegaLiteViz/index.d.ts.map +1 -0
- package/dist/components/visualization/vegaLiteViz/index.js +1 -0
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.d.ts +9 -2
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.d.ts.map +1 -1
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.types.d.ts +20 -0
- package/dist/components/visualization/vegaLiteViz/vegaLiteViz.types.d.ts.map +1 -0
- package/dist/components/weather/index.css +77 -0
- package/dist/components/weather/index.d.ts +5 -0
- package/dist/components/weather/index.d.ts.map +1 -0
- package/dist/components/weather/index.js +1 -0
- package/dist/index.css +62 -0
- package/dist/index.js +1 -2
- package/dist/rusticTheme.d.ts +29 -0
- package/dist/rusticTheme.d.ts.map +1 -1
- package/dist/rusticTheme.js +1 -0
- package/package.json +123 -22
- package/dist/index.js.LICENSE.txt +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.rustic-table {
|
|
2
|
+
max-width: calc(100vw - 100px);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.rustic-table .rustic-table-container {
|
|
6
|
+
max-height: 40vh;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.rustic-table .rustic-table-pagination .rustic-table-toolbar {
|
|
10
|
+
padding: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.rustic-table .rustic-table-pagination .rustic-table-input {
|
|
14
|
+
margin-left: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.rustic-table .rustic-table-header span,
|
|
18
|
+
.rustic-table .rustic-table-header svg {
|
|
19
|
+
font-size: 16px;
|
|
20
|
+
margin-left: 8px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@media (max-width: 900px) {
|
|
24
|
+
.rustic-table .rustic-table-pagination .rustic-table-spacer {
|
|
25
|
+
position: absolute;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.rustic-table .rustic-table-pagination .rustic-table-displayed-rows {
|
|
29
|
+
flex: 1;
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: flex-end;
|
|
32
|
+
white-space: nowrap;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.rustic-table .rustic-table-pagination .rustic-table-actions {
|
|
36
|
+
margin-left: 8px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
span.rustic-icon-large {
|
|
41
|
+
font-size: 32px;
|
|
42
|
+
}
|
|
43
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,OAAO,KAAK,MAAM,SAAS,CAAA;AAE3B,cAAc,UAAU,CAAA;AACxB,eAAe,KAAK,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a():"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?exports["@rustic-ai/ui-components"]=a():e["@rustic-ai/ui-components"]=a()}(global,(()=>(()=>{"use strict";var e={n:a=>{var t=a&&a.__esModule?()=>a.default:()=>a;return e.d(t,{a:t}),t},d:(a,t)=>{for(var r in t)e.o(t,r)&&!e.o(a,r)&&Object.defineProperty(a,r,{enumerable:!0,get:t[r]})},o:(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},a={};e.r(a),e.d(a,{default:()=>D});const t=require("react/jsx-runtime"),r=require("@mui/material"),n=require("@mui/material/Stack");var i=e.n(n);const c=require("@mui/material/Table");var s=e.n(c);const l=require("@mui/material/TableBody");var o=e.n(l);const u=require("@mui/material/TableCell");var d=e.n(u);const m=require("@mui/material/TableContainer");var b=e.n(m);const p=require("@mui/material/TableHead");var f=e.n(p);const y=require("@mui/material/TablePagination");var g=e.n(y);const h=require("@mui/material/TableRow");var j=e.n(h);const v=require("@mui/material/TableSortLabel");var x=e.n(v);const T=require("@mui/material/Tooltip");var q=e.n(T);const O=require("@mui/material/Typography");var P=e.n(O);const S=require("react");var w,N;function k(e){return e.name.replaceAll("_","-"),(0,t.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),children:e.name})}function A(){return(0,t.jsx)(k,{name:"expand_all"})}require("pluralize"),function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(w||(w={})),function(e){e.Ascending="asc",e.Descending="desc"}(N||(N={}));const D=function(e){if(0===e.data.length)return(0,t.jsx)(P(),{variant:"body2",children:"No data available"});var a,n,c,l=e.data.length>10,u=(0,S.useState)({}),m=u[0],p=u[1],y=(0,S.useState)(l?10:-1),h=y[0],v=y[1],T=(0,S.useState)(0),O=T[0],w=T[1],k=(0,r.useTheme)(),D=Array.from(new Set(e.data.flatMap((function(e){return Object.keys(e)})))),K=e.headers||D.map((function(e){return{dataKey:e}})),_=(a=e.data,n=Object.keys(m)[0],c=m[n],n&&c?a.slice().sort((function(e,a){var t=Object.keys(m)[0],r=m[t];return e[t]<a[t]?r===N.Descending?1:-1:e[t]>a[t]?r===N.Descending?-1:1:0})):a),C=_.slice(O*h,O*h+h),M=h>0?C:_;function R(e){if(!m[e])return A}return(0,t.jsxs)(i(),{className:"rustic-table",spacing:1,children:[e.title&&(0,t.jsx)(P(),{variant:"h6",className:"rustic-table-title",children:e.title}),e.description&&(0,t.jsx)(P(),{variant:"body1",children:e.description}),(0,t.jsx)(b(),{className:"rustic-table-container",children:(0,t.jsxs)(s(),{"aria-label":e.title||"a table of data",size:"small",stickyHeader:!0,children:[K.length>0&&(0,t.jsx)(f(),{children:(0,t.jsx)(j(),{children:K.map((function(e,a){return(0,t.jsx)(d(),{sortDirection:m[e.dataKey]||!1,children:(0,t.jsx)(q(),{title:(n=e.dataKey,i=m[n],i?Object.keys(N)[Object.values(N).indexOf(i)]:"Sort"),children:(0,t.jsx)(x(),{active:!0,direction:m[e.dataKey],onClick:function(){return function(e){p((function(a){var t,r,n={};switch(a[e]){case N.Ascending:(t={})[e]=N.Descending,n=t;break;case N.Descending:n={};break;default:(r={})[e]=N.Ascending,n=r}return n}))}(e.dataKey)},className:"rustic-table-header",IconComponent:R(e.dataKey),children:e.label||(r=e.dataKey,r.charAt(0).toUpperCase()+r.slice(1))})})},"header-".concat(a));var r,n,i}))})}),(0,t.jsx)(o(),{children:M.map((function(e,a){return(0,t.jsx)(j(),{children:K.map((function(r,n){return(0,t.jsx)(d(),{children:e[r.dataKey]},"cell-".concat(a,"-").concat(n))}))},"row-".concat(a))}))})]})}),l&&(0,t.jsx)(g(),{className:"rustic-table-pagination",component:"div",count:e.data.length,rowsPerPage:h,labelRowsPerPage:"Rows:",page:O,onPageChange:function(e,a){return w(a)},onRowsPerPageChange:function(e){v(+e.target.value),w(0)},sx:{"& .MuiTablePagination-selectLabel":{color:k.palette.text.disabled}},classes:{toolbar:"rustic-table-toolbar",input:"rustic-table-input",spacer:"rustic-table-spacer",displayedRows:"rustic-table-displayed-rows",actions:"rustic-table-actions"}})]})};return a})()));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/text/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAA;AAEnB,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{StreamingText:()=>c,Text:()=>f,default:()=>l});const r=require("react/jsx-runtime"),a=require("@mui/material/Alert");var o=e.n(a);const n=require("@mui/material/Typography");var i=e.n(n);const u=require("dompurify");var s=e.n(u);const d=require("react"),c=function(e){var t=(0,d.useState)(s().sanitize(e.text)),a=t[0],n=t[1],u=(0,d.useState)(""),c=u[0],f=u[1];return(0,d.useEffect)((function(){if(e.updatedData&&e.updatedData.length>0){for(var t=e.text,r=0,a=e.updatedData;r<a.length;r++){var o=a[r];"string"!=typeof o.text&&(t+=" [MISSING TEXT]",f("Some of the incoming text was not correctly formatted. Some data may be missing.")),t+=o.text}n(s().sanitize(t))}}),[e.text,e.updatedData]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i(),{variant:"body2",children:a}),c&&(0,r.jsx)(o(),{severity:"error",children:c})]})},f=function(e){return(0,r.jsx)(i(),{variant:"body2",className:"rustic-text",children:s().sanitize(e.text)})},l=f;return t})()));
|
|
@@ -5,7 +5,13 @@ import type { TextData } from '../types';
|
|
|
5
5
|
*
|
|
6
6
|
* On the other hand, the `StreamingText` component is designed to handle streams of text data, allowing for dynamic updates to the displayed text content. It supports real-time updates of text content through the `updatedData` attribute, enabling the continuous appending of new text data to the existing content.
|
|
7
7
|
*
|
|
8
|
-
* Tip: Use `Text` when displaying static content, and use `StreamingText` when its being updated dynamically and new content should be appended to existing content.
|
|
8
|
+
* Tip: Use `Text` when displaying static content, and use `StreamingText` when its being updated dynamically and new content should be appended to existing content.
|
|
9
|
+
*
|
|
10
|
+
* Note: `dompurify` is not bundled, so please install the following package using npm:
|
|
11
|
+
*
|
|
12
|
+
* ```typescript
|
|
13
|
+
* npm i dompurify
|
|
14
|
+
* ``` */
|
|
9
15
|
declare const Text: (props: TextData) => import("react/jsx-runtime").JSX.Element;
|
|
10
16
|
export default Text;
|
|
11
17
|
//# sourceMappingURL=text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/components/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAA;AAMnB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/components/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAA;AAMnB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC;;;;;;;;;;;SAWS;AACT,QAAA,MAAM,IAAI,UAAW,QAAQ,4CAM5B,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/timestamp/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAA;AAEnC,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>l});const r=require("react/jsx-runtime"),o=require("@mui/material/Typography");var n=e.n(o);require("react");const a=require("pluralize");var i,u=e.n(a);function c(e){var t=new Date,r=new Date(e);return Math.floor((t.getTime()-r.getTime())/1e3)}!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(i||(i={}));const l=function(e){return(0,r.jsx)(n(),{variant:"caption",color:"text.secondary",className:"rustic-timestamp",children:(t=e.timestamp,c(t)<86400?function(e){var t=c(e);if(t<60)return"".concat(u()("second",t,!0)," ago");if(t<3600){var r=Math.floor(t/60);return"".concat(u()("minute",r,!0)," ago")}var o=Math.floor(t/3600);return"".concat(u()("hour",o,!0)," ago")}(t):(o=new Date(t),a=navigator.language,i={month:"short",day:"numeric"},l=new Date,m=(f=o.getFullYear()!==l.getFullYear())?" at ":", ",f&&(i.year="numeric"),o.toLocaleDateString(a,i)+m+o.toLocaleTimeString(a,{hour:"numeric",minute:"2-digit",hour12:!0})))});var t,o,a,i,l,f,m};return t})()));
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
3
|
-
import type { Renderers } from 'vega';
|
|
4
|
-
import type { EmbedOptions, VisualizationSpec } from 'vega-embed';
|
|
2
|
+
import type { MessageSpaceProps } from './messageSpace/messageSpace';
|
|
5
3
|
export type MessageData = {
|
|
6
4
|
[key: string]: any;
|
|
7
5
|
};
|
|
@@ -25,10 +23,6 @@ export interface Message {
|
|
|
25
23
|
taggedParticipants?: string[];
|
|
26
24
|
topic?: string;
|
|
27
25
|
}
|
|
28
|
-
export interface ThreadableMessage extends Message {
|
|
29
|
-
lastThreadMessage?: Message;
|
|
30
|
-
threadMessagesData?: MessageData[];
|
|
31
|
-
}
|
|
32
26
|
export interface ComponentMap {
|
|
33
27
|
[key: string]: React.ComponentType<any>;
|
|
34
28
|
}
|
|
@@ -36,20 +30,7 @@ export interface WebSocketClient {
|
|
|
36
30
|
send: (message: Message) => void;
|
|
37
31
|
close: () => void;
|
|
38
32
|
reconnect: () => void;
|
|
39
|
-
|
|
40
|
-
export declare enum ParticipantRole {
|
|
41
|
-
Owner = "owner",
|
|
42
|
-
Member = "member"
|
|
43
|
-
}
|
|
44
|
-
export declare enum ParticipantType {
|
|
45
|
-
Human = "human",
|
|
46
|
-
Agent = "agent"
|
|
47
|
-
}
|
|
48
|
-
export interface Participant {
|
|
49
|
-
id: string;
|
|
50
|
-
displayName: string;
|
|
51
|
-
participantRole: ParticipantRole;
|
|
52
|
-
participantType: ParticipantType;
|
|
33
|
+
onReceive?: (handler: (message: Message) => void) => void;
|
|
53
34
|
}
|
|
54
35
|
export interface DataFormat {
|
|
55
36
|
/** Optional title. */
|
|
@@ -61,6 +42,10 @@ export interface Updates<T extends DataFormat> {
|
|
|
61
42
|
/** @ignore */
|
|
62
43
|
updatedData?: T[];
|
|
63
44
|
}
|
|
45
|
+
export interface VisualizationFormat extends DataFormat {
|
|
46
|
+
/** Alternative text for the visualization components used for assistive technology. */
|
|
47
|
+
alt?: string;
|
|
48
|
+
}
|
|
64
49
|
export interface TextFormat extends DataFormat {
|
|
65
50
|
text: string;
|
|
66
51
|
}
|
|
@@ -91,7 +76,7 @@ export interface CalendarFormat extends DataFormat {
|
|
|
91
76
|
events: CalendarEvent[];
|
|
92
77
|
}
|
|
93
78
|
export type CalendarData = CalendarFormat & Updates<CalendarFormat>;
|
|
94
|
-
export interface LocationFormat extends
|
|
79
|
+
export interface LocationFormat extends VisualizationFormat {
|
|
95
80
|
/** Longitude in decimal degrees. */
|
|
96
81
|
longitude: number;
|
|
97
82
|
/** Latitude in decimal degrees. */
|
|
@@ -101,15 +86,13 @@ export interface LocationFormat extends DataFormat {
|
|
|
101
86
|
/** Optional description for the location. */
|
|
102
87
|
description?: string;
|
|
103
88
|
}
|
|
104
|
-
export interface ImageFormat extends
|
|
89
|
+
export interface ImageFormat extends VisualizationFormat {
|
|
105
90
|
/** Base64 encoded image or path to an image file. */
|
|
106
91
|
src: string;
|
|
107
92
|
/** Width rendered in pixels. If neither width nor height are provided, the image will be set to be contained in the parent container. */
|
|
108
93
|
width?: number;
|
|
109
94
|
/** Height rendered in pixels. */
|
|
110
95
|
height?: number;
|
|
111
|
-
/** Alternative text for the image used for assistive technology. */
|
|
112
|
-
alt?: string;
|
|
113
96
|
}
|
|
114
97
|
export interface TableHeader {
|
|
115
98
|
/** Field in table data for this header. */
|
|
@@ -136,7 +119,7 @@ export type TableConfig = {
|
|
|
136
119
|
sort?: TableSort[];
|
|
137
120
|
filter?: TableFilter[];
|
|
138
121
|
};
|
|
139
|
-
export interface TableFormat extends
|
|
122
|
+
export interface TableFormat extends VisualizationFormat {
|
|
140
123
|
/** Data to be displayed in the table. */
|
|
141
124
|
data: Array<Record<string, string | number>>;
|
|
142
125
|
/** Optional array to set the order of columns and assign labels.
|
|
@@ -146,28 +129,6 @@ export interface TableFormat extends DataFormat {
|
|
|
146
129
|
config?: TableConfig;
|
|
147
130
|
}
|
|
148
131
|
export type TableData = TableFormat & Updates<TableFormat>;
|
|
149
|
-
type VegaLiteOptions = EmbedOptions<string, Renderers> & {
|
|
150
|
-
config?: EmbedOptions['config'] & {
|
|
151
|
-
font?: string;
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
|
-
export interface VegaLiteFormat extends DataFormat {
|
|
155
|
-
/** Follow Vega-lite's [documentation](https://vega.github.io/vega-lite/) to provide a specification object. Schema should be included in the spec. Need to use 'container' for width or height for responsive chart. */
|
|
156
|
-
spec: VisualizationSpec;
|
|
157
|
-
theme: {
|
|
158
|
-
light?: VegaLiteOptions['theme'];
|
|
159
|
-
dark: VegaLiteOptions['theme'];
|
|
160
|
-
};
|
|
161
|
-
options?: VegaLiteOptions;
|
|
162
|
-
}
|
|
163
|
-
export type VegaLiteData = VegaLiteFormat & Updates<VegaLiteFormat>;
|
|
164
|
-
export interface MermaidFormat extends DataFormat {
|
|
165
|
-
/** Diagram definition following [Mermaid's syntax](https://mermaid.js.org/intro/syntax-reference.html#syntax-structure). The use of [these](https://mermaid.js.org/intro/syntax-reference.html#diagram-breaking) words or symbols can break diagrams. */
|
|
166
|
-
diagram: string;
|
|
167
|
-
/** Configuration for altering and customizing Mermaid Diagrams. Refer [Mermaid docs](https://mermaid.js.org/config/schema-docs/config.html) for details. */
|
|
168
|
-
config?: MermaidConfig;
|
|
169
|
-
}
|
|
170
|
-
export type MermaidData = MermaidFormat & Updates<MermaidFormat>;
|
|
171
132
|
export interface MediaFormat extends DataFormat {
|
|
172
133
|
/** URL of the media file to be played. */
|
|
173
134
|
src: string;
|
|
@@ -191,6 +152,9 @@ export interface MultipartFormat extends DataFormat {
|
|
|
191
152
|
files: FileData[];
|
|
192
153
|
/** Text content sent along with the files. */
|
|
193
154
|
text?: string;
|
|
155
|
+
}
|
|
156
|
+
export type MultipartData = MultipartFormat & Updates<MultipartFormat>;
|
|
157
|
+
export interface MultipartProps extends MultipartData {
|
|
194
158
|
/**
|
|
195
159
|
* An object mapping file extensions to their respective viewer components.
|
|
196
160
|
* Each key represents a file type (e.g., 'pdf', 'jpg'), and the corresponding value is a React component
|
|
@@ -203,7 +167,6 @@ export interface MultipartFormat extends DataFormat {
|
|
|
203
167
|
}>;
|
|
204
168
|
};
|
|
205
169
|
}
|
|
206
|
-
export type MultipartData = MultipartFormat & Updates<MultipartFormat>;
|
|
207
170
|
export interface BaseInputProps {
|
|
208
171
|
/** Current user. */
|
|
209
172
|
sender: Sender;
|
|
@@ -297,5 +260,12 @@ export type WeatherData = WeatherFormat & Updates<WeatherFormat>;
|
|
|
297
260
|
export interface WeatherProps extends WeatherData {
|
|
298
261
|
weatherProvider?: string;
|
|
299
262
|
}
|
|
300
|
-
export {
|
|
263
|
+
export interface PromptBuilderProps extends Omit<MessageSpaceProps, 'getActionsComponent' | 'scrollDownLabel' | 'messages'> {
|
|
264
|
+
/** Message id of the message that invokes the PromptBuilder. It is optional and intended to support the use of threads in your application, should you choose to implement them. All interactions within a PromptBuilder session are considered part of a single thread. In this component, the collected user inputs are submitted as messages to the server, with the `threadId` field of those messages set to this message id. This marks the message invoking the PromptBuilder as the parent message of the thread. Refer to the `MessageSpace` documentation to read more about `Message` interface. */
|
|
265
|
+
messageId?: string;
|
|
266
|
+
/** Function called when the user clicks on the "Generate" button. At this point, the conversation within the prompt builder will cease. Provide your custom logic to dictate what happens next and where the generated prompt will be displayed. */
|
|
267
|
+
onSubmit: () => void;
|
|
268
|
+
/** Function called when quitting the prompt builder. A confirmation modal will appear when the user clicks on the "Quit" button. The user will be given an option to quit or continue building the prompt. The function will be called upon confirmation of quitting. */
|
|
269
|
+
onCancel: () => void;
|
|
270
|
+
}
|
|
301
271
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAGpE,MAAM,MAAM,WAAW,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAA;AAEhD,uEAAuE;AACvE,MAAM,WAAW,MAAM;IACrB,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,WAAW,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,YAAY;IAE3B,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;CACxC;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IAChC,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,SAAS,E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E,MAAM,CAAA;QACZ,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,EAAE,MAAM,CAAA;KACpB,CAAA;CACF;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,mCAAmC;IACnC,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAA;IAChB,iDAAiD;IACjD,KAAK,EAAE,QAAQ,GAAG,UAAU,CAAA;CAC7B;AAED,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;AAEhE,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,kBACf,SAAQ,IAAI,CACV,iBAAiB,EACjB,qBAAqB,GAAG,iBAAiB,GAAG,UAAU,CACvD;IACD,+kBAA+kB;IAC/kB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oPAAoP;IACpP,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,yQAAyQ;IACzQ,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
body {
|
|
2
|
+
margin: 0;
|
|
3
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
|
4
|
+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
5
|
+
sans-serif;
|
|
6
|
+
-webkit-font-smoothing: antialiased;
|
|
7
|
+
-moz-osx-font-smoothing: grayscale;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
code {
|
|
11
|
+
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
|
12
|
+
monospace;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.rustic-fit-container {
|
|
16
|
+
object-fit: contain;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.rustic-files {
|
|
22
|
+
display: flex;
|
|
23
|
+
gap: 8px;
|
|
24
|
+
flex-wrap: wrap;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.rustic-cursor-pointer {
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.rustic-align-self-center {
|
|
32
|
+
align-self: center;
|
|
33
|
+
}
|
|
34
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/video/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAEzC,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>l});const r=require("react/jsx-runtime"),o=require("dompurify");var n=e.n(o);require("react"),require("pluralize");var i,a=function(){return a=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)};!function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(i||(i={}));var u=function(){return u=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},u.apply(this,arguments)};function c(e){var t,o,i,c=n().sanitize(e.youtubeVideoId);return(0,r.jsx)("iframe",u({},(i={},(t=e.width)&&(i={width:t}),(o=e.height)&&(i=a(a({},i),{height:o})),t||o||(i={className:"rustic-fit-container"}),i),{src:"https://www.youtube.com/embed/".concat(c),title:e.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen",loading:"lazy"}))}c.defaultProps={title:"Embedded video"};const l=c;return t})()));
|
|
@@ -9,7 +9,14 @@ export interface YoutubeVideoProps {
|
|
|
9
9
|
/** Title of the video used for assistive technology. */
|
|
10
10
|
title?: string;
|
|
11
11
|
}
|
|
12
|
-
/** The `YoutubeVideo` component enables the embedding of YouTube videos, providing a seamless playback experience.
|
|
12
|
+
/** The `YoutubeVideo` component enables the embedding of YouTube videos, providing a seamless playback experience.
|
|
13
|
+
*
|
|
14
|
+
* Note: `dompurify` is not bundled, so please install the following package using npm:
|
|
15
|
+
*
|
|
16
|
+
* ```typescript
|
|
17
|
+
* npm i dompurify
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
13
20
|
declare function YoutubeVideo(props: YoutubeVideoProps): import("react/jsx-runtime").JSX.Element;
|
|
14
21
|
declare namespace YoutubeVideo {
|
|
15
22
|
var defaultProps: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"youtubeVideo.d.ts","sourceRoot":"","sources":["../../../src/components/video/youtubeVideo.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AAOxB,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,cAAc,EAAE,MAAM,CAAA;IACtB,yIAAyI;IACzI,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED
|
|
1
|
+
{"version":3,"file":"youtubeVideo.d.ts","sourceRoot":"","sources":["../../../src/components/video/youtubeVideo.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAA;AAOxB,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,cAAc,EAAE,MAAM,CAAA;IACtB,yIAAyI;IACzI,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;GAOG;AACH,iBAAwB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAa5D;kBAbuB,YAAY;;;;;eAAZ,YAAY"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.rustic-recharts-time-series {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.rustic-recharts-time-series-chart-toggle {
|
|
7
|
+
align-self: end;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.rustic-recharts-time-series-chart-toggle-title {
|
|
11
|
+
padding: 6px 16px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.rustic-recharts-time-series-title {
|
|
15
|
+
text-align: center;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.rustic-recharts-time-series-description {
|
|
19
|
+
padding: 16px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.rustic-recharts-time-series-legend {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-wrap: wrap;
|
|
25
|
+
gap: 8px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.rustic-recharts-time-series-legend-item {
|
|
29
|
+
display: flex;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.recharts-responsive-container {
|
|
33
|
+
font-size: 12px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.recharts-legend-wrapper {
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
span.rustic-icon-large {
|
|
42
|
+
font-size: 32px;
|
|
43
|
+
}
|
|
44
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/chart/index.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAA;AAEjC,OAAO,kBAAkB,MAAM,sBAAsB,CAAA;AAErD,eAAe,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>A});const r=require("react/jsx-runtime"),n=require("@mui/material/FormControl");var i=e.n(n);const a=require("@mui/material/IconButton");var o=e.n(a);const s=require("@mui/material/Menu");var c=e.n(s);const l=require("@mui/material/MenuItem");var u=e.n(l);const m=require("@mui/material/Typography");var h=e.n(m);const d=require("@mui/system/Box");var f=e.n(d);const p=require("@mui/system/useTheme");var y=e.n(p);const x=require("react"),g=require("recharts");var v;function j(e,t){return function(e,t){var r,n=new Date(e),i=navigator.language;return r=t===v.HOUR?{hour:"numeric",minute:"2-digit",hour12:!0}:{month:"short",day:"numeric"},n.toLocaleString(i,r)}(e,t<=1?v.HOUR:v.MONTH_DATE)}function b(e){return e.name.replaceAll("_","-"),(0,r.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),children:e.name})}require("pluralize"),function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(v||(v={}));var C=function(){return C=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},C.apply(this,arguments)},k={line:g.LineChart,bar:g.BarChart,area:g.AreaChart};function O(e){var t={};return e.forEach((function(e){t[e]=!0})),t}function T(e){var t=(0,x.useState)(e.defaultChartType||"line"),n=t[0],a=t[1],s=(0,x.useState)(null),l=s[0],m=s[1],d=(0,x.useState)(e.timeSeries),p=d[0],v=d[1],T=y()(),A=p.length>0?Object.keys(p[0]):[],S=A[0],L=A.slice(1),D=(0,x.useState)(O(L)),N=D[0],q=D[1];(0,x.useEffect)((function(){if(e.updatedData&&e.updatedData.length>0){var t=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}([],e.timeSeries,!0);e.updatedData.forEach((function(e){t=t.concat(e.timeSeries),v(t)}))}}),[e.timeSeries,e.updatedData]);var M=k[n];function _(e){l?m(null):e&&m(e.currentTarget)}function w(t,r){return N[t]?e.chartColors[r%e.chartColors.length]:"grey"}function H(e){return N[e]?"none":"line-through"}if(0===p.length)return(0,r.jsx)(h(),{variant:"body2",children:"No data available"});var F,R,W,E,B=e.timeSeries[e.timeSeries.length-1],P=(F=e.timeSeries[0][S],R=B[S],W=new Date(F),E=new Date(R),Math.round(Math.abs((E.getTime()-W.getTime())/864e5)));return(0,r.jsxs)(f(),{className:"rustic-recharts-time-series",children:[!e.disableChartTypeToggle&&(0,r.jsxs)(i(),{className:"rustic-recharts-time-series-chart-toggle",children:[(0,r.jsx)(o(),{"aria-label":"chart options","aria-expanded":Boolean(l),"aria-haspopup":"true",onClick:_,color:"primary",children:(0,r.jsx)(b,{name:"more_vert"})}),(0,r.jsxs)(c(),{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:l,open:Boolean(l),onClose:function(e){return _(e)},children:[(0,r.jsx)(h(),{className:"rustic-recharts-time-series-chart-toggle-title",children:"Chart Types:"}),Object.keys(k).map((function(e){return(0,r.jsxs)(u(),{value:e,selected:e===n,onClick:function(){return function(e){a(e),_()}(e)},children:[e.charAt(0).toUpperCase()+e.slice(1)," ","Chart"]},e)}))]})]}),(0,r.jsxs)(f(),{children:[e.title&&(0,r.jsx)(h(),{variant:"subtitle2",className:"rustic-recharts-time-series-title",children:e.title}),e.description&&(0,r.jsx)(h(),{variant:"caption",className:"rustic-recharts-time-series-description",children:e.description}),(0,r.jsx)(g.ResponsiveContainer,{aspect:e.aspectRatio,width:e.width,maxHeight:e.maxHeight,minWidth:e.minChartWidth,children:(0,r.jsxs)(M,{data:p,margin:e.chartContainerMargin,children:[(0,r.jsx)(g.XAxis,{dataKey:S,tickFormatter:function(e){return j(e,P)},stroke:T.palette.text.primary}),(0,r.jsx)(g.YAxis,{domain:["auto","auto"],width:e.yAxisLabelWidth,tickFormatter:e.yAxisTickFormatter,stroke:T.palette.text.primary}),(0,r.jsx)(g.Tooltip,{labelFormatter:function(e){return[j(e,P)]},formatter:e.tooltipFormatter,contentStyle:{color:T.palette.common.black}}),(0,r.jsx)(g.Legend,{content:function(){return(0,r.jsx)(f(),{className:"rustic-recharts-time-series-legend",children:L.map((function(e,t){return(0,r.jsxs)(f(),{className:"rustic-recharts-time-series-legend-item",onClick:function(){return function(e){var t,r=N[e]&&!L.find((function(t){return t!==e&&N[t]}));if(function(e){return Object.values(e).every((function(e){return!0===e}))}(N)){for(var n={},i=0,a=L;i<a.length;i++){var o=a[i],s=o===e;n[o]=s}q(n)}else q(r?O(L):C(C({},N),((t={})[e]=!N[e],t)))}(e)},sx:{color:w(e,t)},children:[(0,r.jsx)(b,{name:"crop_16_9"}),(0,r.jsx)(h(),{variant:"body2",display:"inline",sx:{textDecorationLine:H(e)},children:e})]},t)}))})}}),L.map((function(t,i){return N[t]?function(t,i){var a=i%e.chartColors.length,o=N[t]?e.chartColors[a]:"transparent",s={onClick:e.onClick,cursor:"pointer"};switch(n){case"line":return(0,r.jsx)(g.Line,{type:"monotone",isAnimationActive:!1,dataKey:t,name:t,dot:!1,stroke:o,activeDot:e.onClick&&s},t);case"bar":return(0,r.jsx)(g.Bar,{dataKey:t,fill:o,onClick:e.onClick&&s.onClick,cursor:e.onClick&&s.cursor},t);case"area":return(0,r.jsxs)(x.Fragment,{children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("linearGradient",{id:"color".concat(t),x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,r.jsx)("stop",{offset:"5%",stopColor:o,stopOpacity:.8}),(0,r.jsx)("stop",{offset:"95%",stopColor:o,stopOpacity:0})]})}),(0,r.jsx)(g.Area,{isAnimationActive:!1,dataKey:t,type:"monotone",stroke:o,fillOpacity:1,fill:"url(#color".concat(t,")"),activeDot:e.onClick&&s},t)]},t)}}(t,i):null})),e.referenceLineYAxis&&e.referenceLineYAxis.map((function(t,n){return(0,r.jsx)(g.ReferenceLine,{y:t,label:e.referenceLineLabel&&e.referenceLineLabel[n],stroke:e.referenceLineColor&&e.referenceLineColor[n],strokeDasharray:"3 3",ifOverflow:"extendDomain",strokeWidth:e.referenceLineStrokeWidth&&e.referenceLineStrokeWidth[n],isFront:!0},n)}))]})})]})]})}T.defaultProps={minChartWidth:200,maxHeight:600,yAxisLabelWidth:30,aspectRatio:16/9,disableChartTypeToggle:!1};const A=T;return t})()));
|
|
@@ -54,7 +54,14 @@ export interface RechartsTimeSeriesProps {
|
|
|
54
54
|
chartContainerMargin?: Margin;
|
|
55
55
|
}
|
|
56
56
|
export type TimeSeriesType = 'line' | 'bar' | 'area';
|
|
57
|
-
/** The `RechartsTimeSeries` component integrates the [Recharts](https://recharts.org/en-US/api) library to facilitate the visualization of time-based data through various chart types such as line charts, bar charts, and area charts. It supports customizations for reference lines, tooltips, and chart type toggling, providing a flexible and interactive data representation solution.
|
|
57
|
+
/** The `RechartsTimeSeries` component integrates the [Recharts](https://recharts.org/en-US/api) library to facilitate the visualization of time-based data through various chart types such as line charts, bar charts, and area charts. It supports customizations for reference lines, tooltips, and chart type toggling, providing a flexible and interactive data representation solution.
|
|
58
|
+
*
|
|
59
|
+
* Note: `Recharts` is not bundled, so please install the following package using npm:
|
|
60
|
+
*
|
|
61
|
+
* ```typescript
|
|
62
|
+
* npm i recharts
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
58
65
|
declare function RechartsTimeSeries(props: RechartsTimeSeriesProps): import("react/jsx-runtime").JSX.Element;
|
|
59
66
|
declare namespace RechartsTimeSeries {
|
|
60
67
|
var defaultProps: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rechartsTimeSeries.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/chart/rechartsTimeSeries.tsx"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAA;AA6BjC,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,MAAM;IACrB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,uBAAuB;IACtC,2MAA2M;IAC3M,UAAU,EAAE,cAAc,EAAE,CAAA;IAC5B,kKAAkK;IAClK,WAAW,EAAE,MAAM,EAAE,CAAA;IACr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AAuBpD
|
|
1
|
+
{"version":3,"file":"rechartsTimeSeries.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/chart/rechartsTimeSeries.tsx"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,CAAA;AA6BjC,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,MAAM;IACrB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,uBAAuB;IACtC,2MAA2M;IAC3M,UAAU,EAAE,cAAc,EAAE,CAAA;IAC5B,kKAAkK;IAClK,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,uCAAuC;IACvC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,oPAAoP;IACpP,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,8HAA8H;IAC9H,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC7B,qLAAqL;IACrL,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAA;IACnC,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,2EAA2E;IAE3E,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,4CAA4C;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,4CAA4C;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mEAAmE;IACnE,WAAW,CAAC,EAAE;QAAE,UAAU,EAAE,cAAc,EAAE,CAAA;KAAE,EAAE,CAAA;IAChD,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6DAA6D;IAC7D,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,cAAc,CAAA;IACjC,iJAAiJ;IACjJ,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAC9C,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpE,uHAAuH;IACvH,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAA;AAuBpD;;;;;;;GAOG;AACH,iBAAS,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CA4TzD;kBA5TQ,kBAAkB;;;;;;;;;AAuU3B,eAAe,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.rustic-mermaid-container {
|
|
2
|
+
height: 100%;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.rustic-mermaid-container .rustic-mermaid {
|
|
7
|
+
flex: 1;
|
|
8
|
+
min-height: 0;
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.rustic-mermaid-container .rustic-mermaid svg {
|
|
14
|
+
height: 100%;
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.rustic-invisible {
|
|
19
|
+
visibility: hidden;
|
|
20
|
+
}
|
|
21
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/mermaidViz/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAEzB,OAAO,UAAU,MAAM,cAAc,CAAA;AAErC,cAAc,oBAAoB,CAAA;AAClC,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports["@rustic-ai/ui-components"]=r():e["@rustic-ai/ui-components"]=r()}(global,(()=>(()=>{"use strict";var e={n:r=>{var t=r&&r.__esModule?()=>r.default:()=>r;return e.d(t,{a:t}),t},d:(r,t)=>{for(var n in t)e.o(t,n)&&!e.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:t[n]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{default:()=>p});const t=require("react/jsx-runtime"),n=require("@mui/material/Stack");var i=e.n(n);const a=require("@mui/material/Typography");var o=e.n(a);const c=require("@mui/system/useTheme");var u=e.n(c);const s=require("mermaid");var l=e.n(s);const d=require("react"),m=require("uuid");var f=function(){return f=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var i in r=arguments[t])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e},f.apply(this,arguments)};const p=function(e){var r=(0,d.useRef)(null),n=(0,d.useState)(),a=n[0],c=n[1],s=u()(),p=(0,m.v4)();return(0,d.useEffect)((function(){var t="dark"===s.palette.mode?"dark":"neutral",n=s.typography.fontFamily;r.current&&(l().initialize(f({theme:t,themeVariables:{fontFamily:n}},e.config)),l().render("mermaid-svg-".concat(p),e.diagram,r.current).then((function(e){r.current&&(r.current.innerHTML=e.svg),c("")})).catch((function(){var e;null===(e=r.current)||void 0===e||e.replaceChildren(),c("Failed to render the diagram.")})))})),(0,t.jsxs)(i(),{className:"rustic-mermaid-container",children:[e.title&&(0,t.jsx)(o(),{variant:"subtitle2",children:e.title}),e.description&&(0,t.jsx)(o(),{variant:"caption",children:e.description}),(0,t.jsx)("div",{className:"rustic-mermaid",ref:r}),a&&(0,t.jsx)(o(),{variant:"body2",children:a})]})};return r})()));
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import './mermaidViz.css';
|
|
2
|
-
import type { MermaidData } from '
|
|
3
|
-
/** The `MermaidViz` component leverages [Mermaid.js](https://mermaid.js.org/) to create dynamic and interactive diagrams, including flowcharts, sequence diagrams, class diagrams, and more. It is ideal for visualizing complex data and processes in a clear and structured manner.
|
|
2
|
+
import type { MermaidData } from './mermaidViz.types';
|
|
3
|
+
/** The `MermaidViz` component leverages [Mermaid.js](https://mermaid.js.org/) to create dynamic and interactive diagrams, including flowcharts, sequence diagrams, class diagrams, and more. It is ideal for visualizing complex data and processes in a clear and structured manner.
|
|
4
|
+
*
|
|
5
|
+
* Note: `mermaid` and `uuid` are not bundled, so please install the following packages using npm:
|
|
6
|
+
*
|
|
7
|
+
* ```typescript
|
|
8
|
+
* npm i mermaid uuid
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
4
11
|
declare function MermaidViz(props: MermaidData): import("react/jsx-runtime").JSX.Element;
|
|
5
12
|
export default MermaidViz;
|
|
6
13
|
//# sourceMappingURL=mermaidViz.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mermaidViz.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/mermaidViz/mermaidViz.tsx"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAUzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"mermaidViz.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/mermaidViz/mermaidViz.tsx"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAUzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;;;;;GAOG;AACH,iBAAS,UAAU,CAAC,KAAK,EAAE,WAAW,2CA4CrC;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MermaidConfig } from 'mermaid/dist/config.type.js';
|
|
2
|
+
import type { Updates, VisualizationFormat } from '../../types';
|
|
3
|
+
export interface MermaidFormat extends VisualizationFormat {
|
|
4
|
+
/** Diagram definition following [Mermaid's syntax](https://mermaid.js.org/intro/syntax-reference.html#syntax-structure). The use of [these](https://mermaid.js.org/intro/syntax-reference.html#diagram-breaking) words or symbols can break diagrams. */
|
|
5
|
+
diagram: string;
|
|
6
|
+
/** Configuration for altering and customizing Mermaid Diagrams. Refer [Mermaid docs](https://mermaid.js.org/config/schema-docs/config.html) for details. */
|
|
7
|
+
config?: MermaidConfig;
|
|
8
|
+
}
|
|
9
|
+
export type MermaidData = MermaidFormat & Updates<MermaidFormat>;
|
|
10
|
+
//# sourceMappingURL=mermaidViz.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mermaidViz.types.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/mermaidViz/mermaidViz.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAE/D,MAAM,WAAW,aAAc,SAAQ,mBAAmB;IACxD,yPAAyP;IACzP,OAAO,EAAE,MAAM,CAAA;IACf,4JAA4J;IAC5J,MAAM,CAAC,EAAE,aAAa,CAAA;CACvB;AAED,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.rustic-perspective-viz {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
min-width: 250px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.rustic-perspective-viz perspective-viewer {
|
|
8
|
+
flex: 1;
|
|
9
|
+
min-height: 200px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* Hide scroll button */
|
|
13
|
+
perspective-viewer-datagrid-toolbar {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/perspectiveViz/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAE7B,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAE7C,cAAc,aAAa,CAAA;AAC3B,eAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["@rustic-ai/ui-components"]=t():e["@rustic-ai/ui-components"]=t()}(global,(()=>(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>b});const n=require("react/jsx-runtime"),r=(require("@finos/perspective-viewer"),require("@finos/perspective-viewer-datagrid"),require("@finos/perspective-viewer-d3fc"),require("@finos/perspective-viewer/dist/css/pro.css"),require("@finos/perspective-viewer/dist/css/pro-dark.css"),require("@finos/perspective"));var o=e.n(r);const i=require("@mui/material/styles"),a=require("@mui/material/Typography");var s=e.n(a);const u=require("@mui/system/Stack");var c=e.n(u);const l=require("react");var p=function(){return p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},p.apply(this,arguments)};function d(e){return e?e.reduce((function(e,t){var n=t.dataKey,r=t.label;return e[n]=r||n,e}),{}):{}}const b=function(e){if(0===e.data.length)return(0,n.jsx)(s(),{variant:"body2",children:"No data available."});var t=(0,l.useRef)(null),r=(0,i.useTheme)(),a=(0,l.useState)(!1),u=a[0],b=a[1],f=r.palette.mode,m="dark"===f?"Pro Dark":"Pro Light",v=d(e.headers),g="\n /* General Button Styles */\n button, .button:hover, #editor-container, .editable, #settings_button {\n border-radius: 16px !important;\n color: ".concat(r.palette.text.primary," !important;\n /* TODO: add background color after updating the theme */\n }\n \n #settings_button {\n border: 1px solid ").concat(r.palette.primary.light," !important;\n }\n \n /* Hide border for aggregate Selector */\n .aggregate-selector:hover {\n border: none !important;\n }\n \n /* Input and Select Elements */\n input, select, .noselect, #add-expression, .dropdown-width-container, \n .pivot-column-border, .pivot-column, .column-selector-column-border {\n border-radius: 8px !important;\n }\n \n /* Change background color */\n #settings_panel, #column_settings_sidebar {\n background: ").concat("dark"===f?"dark":"white"," !important;\n background-image: none !important;\n }\n \n /* Expression Edit Button */\n .expression-edit-button {\n display: none;\n }\n \n /* Add padding to expression input */\n #editor-container, .editable {\n padding: 8px !important;\n }\n \n /* Change Button Font Size */\n .button select, .button {\n font-size: 12px !important;\n }\n \n /* Button and Icon Colors */\n span.button {\n color: ").concat(r.palette.primary.main," !important;\n }\n \n span.button:hover:before {\n background-color: ").concat(r.palette.primary.main," !important;\n }\n \n .button select:hover, .button:hover, .psp-expression-editor__button:hover, \n .sidebar_close_button_inner:hover {\n background-color: ").concat(r.palette.primary.light," !important;\n }\n \n /* Enable Scrolling */\n #plugin_selector_container.open, #status_bar, #menu-bar, #app_panel {\n overflow: scroll !important;\n }\n \n /* Hide unused buttons */\n #debug_open_button.sidebar_close_button, .reset-default-style-disabled, \n .expression-edit-button, #theme, #status, #status_bar .input-sizer {\n display: none !important;\n }\n ");var h,y,_,x,j,S,w,k,O,q=e.config&&(y=(h=e.config).groupBy,_=h.splitBy,x=h.aggregates,j=h.sort,S=h.filter,w=h.columns,k=null==j?void 0:j.map((function(e){return[v[e[0]]||e[0],e[1]]})),O=x&&Object.fromEntries(Object.entries(x).map((function(e){var t=e[0],n=e[1];return[v[t]||t,n]}))),{group_by:null==y?void 0:y.map((function(e){return v[e]||e})),split_by:null==_?void 0:_.map((function(e){return v[e]||e})),aggregates:O,sort:k,filter:S&&function(e){return e.map((function(e){return[v[e[0]]||e[0],e[1],e[e.length-1]]}))}(S),columns:null==w?void 0:w.map((function(e){return v[e]||e}))});return(0,l.useEffect)((function(){o().worker().table(function(e,t){var n=d(t);return e.map((function(e){for(var t={},r=0,o=Object.entries(e);r<o.length;r++){var i=o[r],a=i[0],s=i[1];t[n[a]||a]=[s]}return t}))}(e.data,e.headers)).then((function(n){var r=t.current;r&&r.load(n).then((function(){if(r.restore(p(p({},q),{theme:m,title:e.title,settings:!1})),r.shadowRoot){var t=new CSSStyleSheet;t.replaceSync(g),r.shadowRoot.adoptedStyleSheets.push(t)}})).catch((function(){b(!0)}))})).catch((function(){b(!0)}))}),[e.data,m]),u?(0,n.jsx)(s(),{variant:"body2",children:"Failed to create table from data."}):(0,n.jsxs)(c(),{direction:"column",className:"rustic-perspective-viz",children:[e.title&&(0,n.jsx)(s(),{variant:"h6",children:e.title}),e.description&&(0,n.jsx)(s(),{variant:"body1",children:e.description}),(0,n.jsx)("perspective-viewer",{ref:t,style:{fontFamily:r.typography.fontFamily}})]})};return t})()));
|