@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
|
@@ -6,10 +6,13 @@ import '@finos/perspective-viewer/dist/css/pro.css';
|
|
|
6
6
|
import '@finos/perspective-viewer/dist/css/pro-dark.css';
|
|
7
7
|
import type { TableData, TableHeader } from '../../types';
|
|
8
8
|
export declare function transformTableData(originalData: Array<Record<string, string | number>>, headers?: TableHeader[]): Record<string, (string | number)[]>[];
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
/** The PerspectiveViz component is designed to efficiently display and process large datasets, supporting interactive features such as filtering, sorting, and aggregating data for enhanced analysis and visualization. It integrates with the [Perspective library](https://perspective.finos.org/) to render data in various formats, including datagrids(pivot tables) and charts.
|
|
10
|
+
*
|
|
11
|
+
* Note: [Perspective](https://perspective.finos.org/) libraries are not bundled, so they must be included in the application's build process:
|
|
12
|
+
*
|
|
13
|
+
* ```typescript
|
|
14
|
+
* npm i @finos/perspective @finos/perspective-viewer @finos/perspective-viewer-d3fc @finos/perspective-viewer-datagrid
|
|
15
|
+
* ```
|
|
13
16
|
*/
|
|
14
17
|
declare function PerspectiveViz(props: TableData): import("react/jsx-runtime").JSX.Element;
|
|
15
18
|
export default PerspectiveViz;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perspectiveViz.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/perspectiveViz/perspectiveViz.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,2BAA2B,CAAA;AAClC,OAAO,oCAAoC,CAAA;AAC3C,OAAO,gCAAgC,CAAA;AACvC,OAAO,4CAA4C,CAAA;AACnD,OAAO,iDAAiD,CAAA;
|
|
1
|
+
{"version":3,"file":"perspectiveViz.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/perspectiveViz/perspectiveViz.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,2BAA2B,CAAA;AAClC,OAAO,oCAAoC,CAAA;AAC3C,OAAO,gCAAgC,CAAA;AACvC,OAAO,4CAA4C,CAAA;AACnD,OAAO,iDAAiD,CAAA;AASxD,OAAO,KAAK,EAEV,SAAS,EAET,WAAW,EAEZ,MAAM,aAAa,CAAA;AAiBpB,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,EACpD,OAAO,CAAC,EAAE,WAAW,EAAE,yCAWxB;AAED;;;;;;;GAOG;AACH,iBAAS,cAAc,CAAC,KAAK,EAAE,SAAS,2CAuLvC;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
.rustic-vega-lite-container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
scroll-behavior: auto;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.rustic-vega-lite {
|
|
8
|
+
flex: 1;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
#rustic-vega-lite-tooltip {
|
|
12
|
+
position: fixed;
|
|
13
|
+
visibility: hidden;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
#rustic-vega-lite-tooltip.visible {
|
|
17
|
+
visibility: visible;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.rustic-popover-menu ul {
|
|
21
|
+
padding: 0;
|
|
22
|
+
min-width: 100px;
|
|
23
|
+
max-width: 240px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.rustic-popover-menu li {
|
|
27
|
+
padding-block: 8px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.rustic-popover-menu-item-icon {
|
|
31
|
+
display: flex;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.rustic-popover-menu-item-start-icon {
|
|
35
|
+
margin-right: 8px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.rustic-popover-menu-item-end-icon {
|
|
39
|
+
margin-left: 80px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
span.rustic-icon-large {
|
|
43
|
+
font-size: 32px;
|
|
44
|
+
}
|
|
45
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/vegaLiteViz/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAE1B,OAAO,WAAW,MAAM,eAAe,CAAA;AAEvC,cAAc,qBAAqB,CAAA;AACnC,eAAe,WAAW,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:()=>_});const r=require("react/jsx-runtime"),n=require("@mui/material/Typography");var o=e.n(n);const i=require("@mui/system/Box");var a=e.n(i);const c=require("@mui/system/Stack");var s=e.n(c);const l=require("@mui/system/useTheme");var u=e.n(l);const d=require("react"),p=require("react-dom/server"),m=require("vega-embed");var f=e.n(m);const v=require("@mui/material"),h=require("@mui/material/Button");var b=e.n(h);const x=require("@mui/material/Drawer");var y=e.n(x);const j=require("@mui/material/IconButton");var g=e.n(j);const q=require("@mui/material/ListItemText");var w=e.n(q);const k=require("@mui/material/Menu");var S=e.n(k);const N=require("@mui/material/MenuItem");var O=e.n(N);const F=require("@mui/material/styles"),T=require("@mui/material/Tooltip");var P=e.n(T);const R=require("@mui/system");function C(e){return e.name.replaceAll("_","-"),(0,r.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),children:e.name})}var I=function(){return I=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},I.apply(this,arguments)};function M(e){var t=(0,d.useState)(!1),n=t[0],i=t[1],a=(0,d.useRef)(null),c=(0,F.useTheme)(),s=(0,v.useMediaQuery)(c.breakpoints.down("md")),l=s?y():S(),u={borderRadius:"".concat(c.shape.borderRadius,"px"),border:"1px solid ".concat(c.palette.divider)};function p(e){return(0,r.jsxs)(r.Fragment,{children:[e.startDecorator&&(0,r.jsx)(R.Box,{sx:{color:"primary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-start-icon",children:e.startDecorator}),(0,r.jsx)(w(),{children:(0,r.jsx)(o(),{variant:"body2",children:e.label})}),e.endDecorator&&(0,r.jsx)(R.Box,{sx:{color:"secondary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-end-icon",children:e.endDecorator})]})}s&&(u=I(I({},u),{borderRadius:"".concat(c.shape.borderRadius,"px ").concat(c.shape.borderRadius,"px 0 0"),borderBottom:0}));var m=e.menuItems.map((function(e){return e.href?(0,r.jsx)(O(),{component:"a",onClick:function(){return i(!1)},href:e.href,download:e.downloadFileName||e.isFiledownload,children:p(e)},e.label):(0,r.jsx)(O(),{onClick:function(t){e.onClick&&e.onClick(t),i(!1)},disabled:!e.onClick,children:p(e)},e.label)}));var f,h,x=s?{}:{anchorEl:a.current};return(0,r.jsxs)(r.Fragment,{children:[(f={onClick:function(e){e.stopPropagation(),i(!0)},"aria-label":e.ariaLabel,ref:a,className:"rustic-popover-menu-button"},h=(0,r.jsx)(C,{name:"more_vert"}),e.buttonText?(0,r.jsx)(b(),I({},f,{startIcon:e.icon?e.icon:null,children:e.buttonText})):(0,r.jsx)(P(),{title:e.ariaLabel,children:(0,r.jsx)(g(),I({},f,{children:e.icon?e.icon:h}))})),(0,r.jsx)(l,I({open:n,onClose:function(){return i(!1)}},x,{anchor:"bottom",className:"rustic-popover-menu",sx:{"& .MuiPaper-root":I(I({},u),{backgroundImage:"none",boxShadow:c.shadows[2]})},children:m}))]})}var D=function(){return D=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},D.apply(this,arguments)};function L(e){var t=(0,d.useRef)(null),n=(0,d.useState)(!1),i=n[0],c=n[1],l=u()(),m="dark"===l.palette.mode,v=l.typography.fontFamily,h={backgroundColor:l.palette.primary.main,color:l.palette.background.paper,borderRadius:l.shape.borderRadius+"px",padding:"4px 8px",fontSize:l.typography.caption.fontSize,fontFamily:v,fontWeight:l.typography.caption.fontWeight},b={formatTooltip:function(e,t){return(0,p.renderToStaticMarkup)((0,r.jsx)("div",{role:"tooltip",className:"rustic-vega-lite-tooltip-content",style:h,children:Object.entries(e).map((function(e){var n=e[0],o=e[1];return(0,r.jsxs)("div",{children:[(0,r.jsxs)("strong",{children:[t(n),":"]})," ",t(o)]},n)}))}))},disableDefaultStyle:!0,id:"rustic-vega-lite-tooltip"},x=[{label:"Save as SVG"},{label:"Save as PNG"}];function y(){var r,n,o,i;if(t.current&&e.spec){var a=D(D({config:{font:v}},e.options),{theme:m?null===(r=e.theme)||void 0===r?void 0:r.dark:null===(n=e.theme)||void 0===n?void 0:n.light,tooltip:b,actions:!1});(null===(i=null===(o=e.options)||void 0===o?void 0:o.config)||void 0===i?void 0:i.font)||(a.config.font=v);var s=D({},e.spec);delete s.title,f()(t.current,s,a).then((function(e){var t=e.embedOptions,r=e.embedOptions.downloadFileName||"visualization";["svg","png"].map((function(n,o){var i="object"==typeof t.scaleFactor?t.scaleFactor[n]:t.scaleFactor;e.view.toImageURL(n,i).then((function(e){x[o].href=e,x[o].downloadFileName="".concat(r,".").concat(n)}))})),c(!1)})).catch((function(){c(!0)}))}}return(0,d.useEffect)((function(){function e(){y()}return y(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[e.spec,m]),i?(0,r.jsx)(o(),{variant:"body2",children:"Failed to load the chart."}):(0,r.jsxs)(s(),{direction:"column",className:"rustic-vega-lite-container",children:[(0,r.jsx)(a(),{justifyContent:"end",display:"flex",children:(0,r.jsx)(M,{menuItems:x,ariaLabel:"Download options"})}),e.title&&(0,r.jsx)(o(),{variant:"h6",children:e.title}),e.description&&(0,r.jsx)(o(),{variant:"body1",children:e.description}),(0,r.jsxs)(a(),{textAlign:"center",mt:1,children:["string"==typeof e.spec.title&&(0,r.jsx)(o(),{variant:"subtitle2",children:e.spec.title}),e.spec.description&&(0,r.jsx)(o(),{variant:"caption",children:e.spec.description})]}),(0,r.jsx)("div",{ref:t,className:"rustic-vega-lite"})]})}const B=L;L.defaultProps={theme:{dark:"dark"}};const _=B;return t})()));
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import './vegaLiteViz.css';
|
|
2
|
-
import type { VegaLiteData } from '
|
|
3
|
-
/** The `VegaLiteViz` component is a versatile tool for visualizing data using the Vega-Lite grammar. With support for various graphic types, it empowers users to create engaging and informative data visualizations effortlessly.
|
|
2
|
+
import type { VegaLiteData } from './vegaLiteViz.types';
|
|
3
|
+
/** The `VegaLiteViz` component is a versatile tool for visualizing data using the Vega-Lite grammar. With support for various graphic types, it empowers users to create engaging and informative data visualizations effortlessly.
|
|
4
|
+
*
|
|
5
|
+
* Note: `vega-embed` is not bundled, so please install the following package using npm:
|
|
6
|
+
*
|
|
7
|
+
* ```typescript
|
|
8
|
+
* npm i vega-embed
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
4
11
|
declare function VegaLiteViz(props: VegaLiteData): import("react/jsx-runtime").JSX.Element;
|
|
5
12
|
declare namespace VegaLiteViz {
|
|
6
13
|
var defaultProps: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vegaLiteViz.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/vegaLiteViz/vegaLiteViz.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAY1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"vegaLiteViz.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/vegaLiteViz/vegaLiteViz.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAY1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAEvD;;;;;;;GAOG;AACH,iBAAS,WAAW,CAAC,KAAK,EAAE,YAAY,2CAiIvC;kBAjIQ,WAAW;;;;;;;AAmIpB,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Renderers } from 'vega';
|
|
2
|
+
import type { EmbedOptions, VisualizationSpec } from 'vega-embed';
|
|
3
|
+
import type { Updates, VisualizationFormat } from '../../types';
|
|
4
|
+
type VegaLiteOptions = EmbedOptions<string, Renderers> & {
|
|
5
|
+
config?: EmbedOptions['config'] & {
|
|
6
|
+
font?: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export interface VegaLiteFormat extends VisualizationFormat {
|
|
10
|
+
/** 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. */
|
|
11
|
+
spec: VisualizationSpec;
|
|
12
|
+
theme: {
|
|
13
|
+
light?: VegaLiteOptions['theme'];
|
|
14
|
+
dark: VegaLiteOptions['theme'];
|
|
15
|
+
};
|
|
16
|
+
options?: VegaLiteOptions;
|
|
17
|
+
}
|
|
18
|
+
export type VegaLiteData = VegaLiteFormat & Updates<VegaLiteFormat>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=vegaLiteViz.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vegaLiteViz.types.d.ts","sourceRoot":"","sources":["../../../../src/components/visualization/vegaLiteViz/vegaLiteViz.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEjE,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAG/D,KAAK,eAAe,GAAG,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG;IACvD,MAAM,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG;QAChC,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;CACF,CAAA;AAED,MAAM,WAAW,cAAe,SAAQ,mBAAmB;IACzD,wNAAwN;IACxN,IAAI,EAAE,iBAAiB,CAAA;IACvB,KAAK,EAAE;QACL,KAAK,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAA;QAChC,IAAI,EAAE,eAAe,CAAC,OAAO,CAAC,CAAA;KAC/B,CAAA;IACD,OAAO,CAAC,EAAE,eAAe,CAAA;CAC1B;AAED,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
.rustic-weather {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
padding: 16px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.rustic-weather .rustic-current-weather-description {
|
|
8
|
+
text-transform: capitalize;
|
|
9
|
+
margin-top: 8px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.rustic-weather .rustic-current-weather-description img {
|
|
13
|
+
width: 24px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.rustic-weather .rustic-current-temp {
|
|
17
|
+
margin-block: 16px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.rustic-weather .rustic-daily-weather-container {
|
|
21
|
+
display: flex;
|
|
22
|
+
gap: 8px;
|
|
23
|
+
overflow-x: scroll;
|
|
24
|
+
margin-block: 24px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.rustic-weather .rustic-daily-weather-card {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
align-items: center;
|
|
31
|
+
padding: 16px 24px;
|
|
32
|
+
gap: 8px;
|
|
33
|
+
min-width: fit-content;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.rustic-weather .rustic-daily-weather-card span {
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.rustic-weather .rustic-daily-weather-card img {
|
|
41
|
+
width: 40px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.rustic-weather .rustic-weather-attribution {
|
|
45
|
+
text-align: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.rustic-weather .rustic-popover-menu-button {
|
|
49
|
+
align-self: flex-end;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
span.rustic-icon-large {
|
|
53
|
+
font-size: 32px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.rustic-popover-menu ul {
|
|
57
|
+
padding: 0;
|
|
58
|
+
min-width: 100px;
|
|
59
|
+
max-width: 240px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.rustic-popover-menu li {
|
|
63
|
+
padding-block: 8px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.rustic-popover-menu-item-icon {
|
|
67
|
+
display: flex;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.rustic-popover-menu-item-start-icon {
|
|
71
|
+
margin-right: 8px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.rustic-popover-menu-item-end-icon {
|
|
75
|
+
margin-left: 80px;
|
|
76
|
+
}
|
|
77
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/weather/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;AAEtB,OAAO,OAAO,MAAM,WAAW,CAAA;AAE/B,cAAc,UAAU,CAAA;AACxB,eAAe,OAAO,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 a in t)e.o(t,a)&&!e.o(r,a)&&Object.defineProperty(r,a,{enumerable:!0,get:t[a]})},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"),a=require("@mui/material/Box");var n=e.n(a);const i=require("@mui/material/Card");var o=e.n(i);const c=require("@mui/material/Stack");var s=e.n(c);const u=require("@mui/material/Typography");var l=e.n(u);const m=require("react");var d;require("pluralize"),function(e){e[e.HOUR=0]="HOUR",e[e.MONTH_DATE=1]="MONTH_DATE"}(d||(d={}));var h=function(e){var r=["Sun","Mon","Tues","Wed","Thurs","Fri","Sat"][new Date(1e3*e).getDay()];return{shortName:r,fullName:{Sun:"Sunday",Mon:"Monday",Tues:"Tuesday",Wed:"Wednesday",Thurs:"Thursday",Fri:"Friday",Sat:"Saturday"}[r]}};function p(e){return e.name.replaceAll("_","-"),(0,t.jsx)("span",{className:"".concat(e.className?e.className+" ":"","material-symbols-rounded"),children:e.name})}const x=require("@mui/material"),v=require("@mui/material/Button");var b=e.n(v);const f=require("@mui/material/Drawer");var j=e.n(f);const y=require("@mui/material/IconButton");var w=e.n(y);const g=require("@mui/material/ListItemText");var N=e.n(g);const T=require("@mui/material/Menu");var q=e.n(T);const S=require("@mui/material/MenuItem");var I=e.n(S);const M=require("@mui/material/styles"),D=require("@mui/material/Tooltip");var O=e.n(D);const C=require("@mui/system");var k=function(){return k=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},k.apply(this,arguments)};function F(e){var r=(0,m.useState)(!1),a=r[0],n=r[1],i=(0,m.useRef)(null),o=(0,M.useTheme)(),c=(0,x.useMediaQuery)(o.breakpoints.down("md")),s=c?j():q(),u={borderRadius:"".concat(o.shape.borderRadius,"px"),border:"1px solid ".concat(o.palette.divider)};function d(e){return(0,t.jsxs)(t.Fragment,{children:[e.startDecorator&&(0,t.jsx)(C.Box,{sx:{color:"primary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-start-icon",children:e.startDecorator}),(0,t.jsx)(N(),{children:(0,t.jsx)(l(),{variant:"body2",children:e.label})}),e.endDecorator&&(0,t.jsx)(C.Box,{sx:{color:"secondary.main"},className:"rustic-popover-menu-item-icon rustic-popover-menu-item-end-icon",children:e.endDecorator})]})}c&&(u=k(k({},u),{borderRadius:"".concat(o.shape.borderRadius,"px ").concat(o.shape.borderRadius,"px 0 0"),borderBottom:0}));var h=e.menuItems.map((function(e){return e.href?(0,t.jsx)(I(),{component:"a",onClick:function(){return n(!1)},href:e.href,download:e.downloadFileName||e.isFiledownload,children:d(e)},e.label):(0,t.jsx)(I(),{onClick:function(r){e.onClick&&e.onClick(r),n(!1)},disabled:!e.onClick,children:d(e)},e.label)}));var v,f,y=c?{}:{anchorEl:i.current};return(0,t.jsxs)(t.Fragment,{children:[(v={onClick:function(e){e.stopPropagation(),n(!0)},"aria-label":e.ariaLabel,ref:i,className:"rustic-popover-menu-button"},f=(0,t.jsx)(p,{name:"more_vert"}),e.buttonText?(0,t.jsx)(b(),k({},v,{startIcon:e.icon?e.icon:null,children:e.buttonText})):(0,t.jsx)(O(),{title:e.ariaLabel,children:(0,t.jsx)(w(),k({},v,{children:e.icon?e.icon:f}))})),(0,t.jsx)(s,k({open:a,onClose:function(){return n(!1)}},y,{anchor:"bottom",className:"rustic-popover-menu",sx:{"& .MuiPaper-root":k(k({},u),{backgroundImage:"none",boxShadow:o.shadows[2]})},children:h}))]})}const P=function(e){var r=(0,m.useState)(e.units),a=r[0],i=r[1];function c(r){return"metric"===e.units&&"imperial"===a?Math.round(1.8*r+32):"imperial"===e.units&&"metric"===a?Math.round(r*(5/9)-32):Math.round(r)}var u=new Date(1e3*e.weather[0].timestamp),d=h(e.weather[0].timestamp).shortName,x=u.getDate(),v=u.getFullYear().toString().slice(2),b="".concat(d," ").concat(x,"/").concat(v," TODAY"),f="HIGH: ".concat(c(e.weather[0].temp.high)," / LOW: ").concat(c(e.weather[0].temp.high)),j=e.weather.map((function(e,r){if(0!==r)return(0,t.jsxs)(o(),{variant:"outlined",className:"rustic-daily-weather-card",children:[(0,t.jsx)(l(),{variant:"h5",component:"span",color:"text.secondary","aria-label":h(e.timestamp).fullName,children:h(e.timestamp).shortName}),(0,t.jsx)("img",{src:e.weatherIcon.icon,alt:e.weatherIcon.description}),(0,t.jsxs)(l(),{variant:"body2",color:"text.secondary",children:["High: ",c(e.temp.high),"°"]}),(0,t.jsxs)(l(),{variant:"body2",color:"text.secondary",children:["Low: ",c(e.temp.low),"°"]})]},r)}));return(0,t.jsxs)(o(),{variant:"outlined",className:"rustic-weather",children:[(0,t.jsx)(F,{ariaLabel:"Temperature units",menuItems:[{label:"Celsius",endDecorator:"°C",onClick:function(){return i("metric")}},{label:"Fahrenheit",endDecorator:"°F",onClick:function(){return i("imperial")}}]}),(0,t.jsxs)(s(),{alignItems:"center",children:[(0,t.jsx)(l(),{variant:"h4",component:"span",children:e.location}),(0,t.jsxs)(s(),{direction:"row",alignItems:"center",spacing:1,className:"rustic-current-weather-description",children:[(0,t.jsx)("img",{src:e.weather[0].weatherIcon.icon,alt:""}),(0,t.jsx)(l(),{variant:"body2",children:e.weather[0].weatherIcon.description})]}),e.weather[0].temp.current&&(0,t.jsxs)(l(),{variant:"h1",component:"span",className:"rustic-current-temp",children:[c(e.weather[0].temp.current),"°",function(e){switch(e){case"imperial":return"F";case"metric":return"C"}}(a)]}),(0,t.jsxs)(s(),{direction:"row",spacing:2,children:[(0,t.jsx)(l(),{variant:"overline",children:b}),(0,t.jsx)(l(),{variant:"overline",children:f})]})]}),(0,t.jsx)(n(),{className:"rustic-daily-weather-container",children:j}),e.weatherProvider&&(0,t.jsxs)(s(),{alignItems:"center",direction:"row",spacing:1,alignSelf:"center",className:"rustic-weather-attribution",children:[(0,t.jsx)(p,{name:"cloud"}),(0,t.jsx)(l(),{variant:"body2",children:"Weather data provided by ".concat(e.weatherProvider)})]})]})};return r})()));
|
package/dist/index.css
CHANGED
|
@@ -72,6 +72,10 @@ code {
|
|
|
72
72
|
cursor: pointer;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
.rustic-align-self-center {
|
|
76
|
+
align-self: center;
|
|
77
|
+
}
|
|
78
|
+
|
|
75
79
|
.rustic-multimodal-input .rustic-bottom-buttons {
|
|
76
80
|
display: flex;
|
|
77
81
|
justify-content: space-between;
|
|
@@ -686,6 +690,64 @@ span.rustic-open-layers-map-marker {
|
|
|
686
690
|
margin-inline: 24px;
|
|
687
691
|
}
|
|
688
692
|
|
|
693
|
+
.rustic-prompt-builder {
|
|
694
|
+
padding: 24px;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.rustic-prompt-builder-avatar {
|
|
698
|
+
width: 24px;
|
|
699
|
+
height: 24px;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
.rustic-prompt-builder-divider {
|
|
703
|
+
margin-top: 16px;
|
|
704
|
+
margin-bottom: 24px;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
.rustic-prompt-builder-questions {
|
|
708
|
+
display: flex;
|
|
709
|
+
flex-direction: column;
|
|
710
|
+
gap: 24px;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.rustic-prompt-builder-question {
|
|
714
|
+
gap: 8px;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.rustic-prompt-builder-buttons {
|
|
718
|
+
display: flex;
|
|
719
|
+
justify-content: space-between;
|
|
720
|
+
margin-top: 56px;
|
|
721
|
+
gap: 16px;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
.rustic-prompt-builder-buttons-left {
|
|
725
|
+
width: 100%;
|
|
726
|
+
display: flex;
|
|
727
|
+
gap: 8px;
|
|
728
|
+
justify-content: space-between;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
.rustic-prompt-builder-dialog-buttons {
|
|
732
|
+
display: flex;
|
|
733
|
+
gap: 16px;
|
|
734
|
+
padding: 24px;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
@media (max-width: 900px) {
|
|
738
|
+
.rustic-prompt-builder-buttons-right button {
|
|
739
|
+
flex: 1;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
.rustic-prompt-builder-buttons {
|
|
743
|
+
flex-direction: column;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
.rustic-prompt-builder-buttons-right {
|
|
747
|
+
display: flex;
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
|
|
689
751
|
.rustic-question .rustic-question-text {
|
|
690
752
|
margin-bottom: 16px;
|
|
691
753
|
}
|