@rustic-ai/ui-components 0.0.21 → 0.0.22
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.map +1 -1
- package/dist/components/calendar/index.css +24 -10
- package/dist/components/calendar/index.js +1 -1
- package/dist/components/helper.d.ts +0 -2
- package/dist/components/helper.d.ts.map +1 -1
- package/dist/components/image/index.js +1 -1
- package/dist/components/input/multimodal/multimodalInput/index.css +4 -0
- package/dist/components/input/multimodal/multimodalInput/index.js +1 -1
- package/dist/components/input/multimodal/uploader/index.js +1 -1
- package/dist/components/input/textInput/index.css +4 -0
- package/dist/components/media/audio/index.js +1 -1
- package/dist/components/media/video/index.js +1 -1
- package/dist/components/messageCanvas/index.js +1 -1
- package/dist/components/messageSpace/index.js +1 -1
- package/dist/components/multipart/index.js +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/timestamp/index.js +1 -1
- package/dist/components/video/index.js +1 -1
- package/dist/components/visualization/chart/index.js +1 -1
- package/dist/components/weather/index.js +1 -1
- package/dist/index.css +28 -10
- package/dist/index.js +1 -1
- package/package.json +8 -4
|
@@ -1 +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})}
|
|
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})}!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],M=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 _=k[n];function q(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:q,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 q(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),q()}(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)(_,{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}M(n)}else M(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})()));
|
|
@@ -1 +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
|
|
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/Box");var a=e.n(n);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;!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 S=e.n(T);const q=require("@mui/material/MenuItem");var I=e.n(q);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,n=arguments.length;t<n;t++)for(var a in r=arguments[t])Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a]);return e},k.apply(this,arguments)};function F(e){var r=(0,m.useState)(!1),n=r[0],a=r[1],i=(0,m.useRef)(null),o=(0,M.useTheme)(),c=(0,x.useMediaQuery)(o.breakpoints.down("md")),s=c?j():S(),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 a(!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),a(!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(),a(!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:n,onClose:function(){return a(!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),n=r[0],i=r[1];function c(r){return"metric"===e.units&&"imperial"===n?Math.round(1.8*r+32):"imperial"===e.units&&"metric"===n?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"}}(n)]}),(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)(a(),{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
|
@@ -1,21 +1,35 @@
|
|
|
1
|
-
.rustic-fc-calendar
|
|
2
|
-
|
|
1
|
+
.rustic-fc-calendar {
|
|
2
|
+
padding: 16px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.rustic-fc-calendar .fc-event-title {
|
|
6
|
+
text-overflow: ellipsis;
|
|
3
7
|
}
|
|
4
8
|
|
|
5
9
|
.rustic-fc-calendar .fc-button {
|
|
6
|
-
|
|
7
|
-
padding: 2px 4px;
|
|
10
|
+
padding: 4px 8px;
|
|
8
11
|
}
|
|
9
12
|
|
|
10
|
-
.rustic-fc-calendar
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
.rustic-fc-calendar
|
|
14
|
+
.fc
|
|
15
|
+
.fc-button-primary:not(:disabled).fc-button-active:focus,
|
|
16
|
+
.rustic-fc-calendar .fc .fc-button-primary:focus,
|
|
17
|
+
.rustic-fc-calendar .fc .fc-button-primary:not(:disabled):active:focus {
|
|
18
|
+
box-shadow: none;
|
|
14
19
|
}
|
|
15
20
|
|
|
16
21
|
@media (max-width: 900px) {
|
|
17
|
-
.rustic-fc-calendar {
|
|
18
|
-
|
|
22
|
+
.rustic-fc-calendar .fc-toolbar {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
gap: 4px;
|
|
26
|
+
align-items: flex-start;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.rustic-fc-calendar .fc-toolbar .fc-toolbar-chunk:last-child {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
width: 100%;
|
|
19
33
|
}
|
|
20
34
|
}
|
|
21
35
|
|
|
@@ -146,6 +160,10 @@ code {
|
|
|
146
160
|
margin: 10px 8px;
|
|
147
161
|
}
|
|
148
162
|
|
|
163
|
+
.rustic-base-input .rustic-input-actions {
|
|
164
|
+
display: flex;
|
|
165
|
+
}
|
|
166
|
+
|
|
149
167
|
span.rustic-icon-large {
|
|
150
168
|
font-size: 32px;
|
|
151
169
|
}
|