@bikdotai/bik-component-library 0.0.510-beta-003 → 0.0.510-beta-004
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/cjs/components/action-button/ActionButton.styled.d.ts +6 -1
- package/dist/cjs/components/action-button/index.d.ts +4 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +5 -0
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/cjs/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/components/action-button/ActionButton.styled.d.ts +6 -1
- package/dist/esm/components/action-button/index.d.ts +4 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +5 -0
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/esm/components/bik-layout/MockMenus.d.ts +0 -1
- package/package.json +1 -1
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export declare const ActionButtonContainer: import("styled-components").StyledComponent<"div", any, {
|
|
1
|
+
export declare const ActionButtonContainer: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
isSelected: boolean;
|
|
3
|
+
isError: boolean;
|
|
4
|
+
border: string;
|
|
5
|
+
isConfigured: boolean;
|
|
6
|
+
}, never>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface ActionButtonInterface {
|
|
3
|
-
|
|
3
|
+
state: 'CONFIGURED' | 'NOT-CONFIGURED';
|
|
4
4
|
buttonText: string;
|
|
5
|
+
isSelected: boolean;
|
|
6
|
+
isError: boolean;
|
|
7
|
+
onClick: () => void;
|
|
5
8
|
icon: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
|
|
6
9
|
}
|
|
7
10
|
declare const ActionButton: React.FC<ActionButtonInterface>;
|
|
@@ -15,6 +15,8 @@ export type LineChartProps = {
|
|
|
15
15
|
x?: string;
|
|
16
16
|
y?: string;
|
|
17
17
|
yPrefix?: string;
|
|
18
|
+
xDrawBorder?: boolean;
|
|
19
|
+
yDrawBorder?: boolean;
|
|
18
20
|
};
|
|
19
21
|
legends: Array<string>;
|
|
20
22
|
stepSize?: number;
|
|
@@ -22,5 +24,8 @@ export type LineChartProps = {
|
|
|
22
24
|
max?: number;
|
|
23
25
|
isZeroState?: boolean;
|
|
24
26
|
ticksLabelCallback?: (val: string, index: number) => void;
|
|
27
|
+
tension?: number;
|
|
28
|
+
newLineStyles?: boolean;
|
|
29
|
+
prefixCurrencyInYAxis?: string;
|
|
25
30
|
};
|
|
26
31
|
export declare const LineChart: React.FC<LineChartProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("chart.js"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("chart.js"),r=require("react"),n=require("react-chartjs-2"),l=require("../../../TypographyStyle.js"),o=require("../../../../constants/Theme.js"),i=require("./LineChart.styled.js");t.Chart.register(t.CategoryScale,t.LinearScale,t.PointElement,t.BarElement,t.LineElement,t.ArcElement,t.Filler,t.Title,t.Tooltip,t.Legend);exports.LineChart=t=>{let{scaleText:a,labels:s,canvasHeight:d,datas:c,maintainAspectRatio:u=!1,stepSize:g,min:p,max:b,isZeroState:y,tension:C,newLineStyles:O,ticksLabelCallback:v,prefixCurrencyInYAxis:x}=t;var h,m,L;const[S,j]=r.useState(null),R=r.useRef();r.useEffect((()=>{var e,t,r,n;if(null===(n=null===(r=null===(t=null===(e=R.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===r?void 0:r.ticks)||void 0===n?void 0:n.length){const e=38*R.current.scales.y.ticks.length;j(e)}}),[R]);const f=c.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?o.COLORS.content.placeholder:o.COLORS.background.brand}))),k={labels:s,datasets:c.map(((e,t)=>{var r;return Object.assign(Object.assign({tension:null!=C?C:.4,fill:e.gradient?"start":0},((e,t)=>{const r={borderColor:e||(t?o.COLORS.content.placeholder:o.COLORS.background.brand)};return O?Object.assign({pointStyle:"circle",pointRadius:5,pointBorderColor:"transparent",pointBackgroundColor:e||(t?o.COLORS.content.placeholder:o.COLORS.background.brand)},r):Object.assign({pointRadius:1},r)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,S?S-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(r=e.backgroundColor)&&void 0!==r?r:"transparent"})}))},w={maintainAspectRatio:u,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:!1,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>o.COLORS.content.primaryInverse,backgroundColor:o.COLORS.content.primary,callbacks:{labelTextColor:()=>o.COLORS.content.primaryInverse},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:y?0:p,max:y?10:b,ticks:{color:o.COLORS.content.secondary,callback:e=>{var t;return`${null!==(t=null==a?void 0:a.yPrefix)&&void 0!==t?t:""}${e}${null!=x?x:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:y?1:g},title:{display:!!(null==a?void 0:a.y),text:null==a?void 0:a.y},grid:{color:o.COLORS.background.base,drawBorder:null===(h=null==a?void 0:a.yDrawBorder)||void 0===h||h}},x:{ticks:{callback:v,color:o.COLORS.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==a?void 0:a.x),text:null==a?void 0:a.x},grid:{display:!1,drawBorder:null!==(m=null==a?void 0:a.xDrawBorder)&&void 0!==m&&m}}}};return e.jsxs("div",Object.assign({style:Object.assign(Object.assign({},u?{}:{height:null!==(L=null!=d?d:S)&&void 0!==L?L:204}),{display:"flex",flexDirection:"column",gap:2})},{children:[e.jsx(i.LegendWrapper,{children:f.map(((t,r)=>{let{text:n,color:o}=t;return n?e.jsxs(i.LegendContainer,{children:[e.jsx(i.LegendColor,{color:o}),e.jsx(l.SmallRegular,Object.assign({color:"#667085"},{children:n}))]},r):e.jsx(e.Fragment,{})}))}),e.jsx(n.Line,{ref:R,options:w,data:k})]}))};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export declare const ActionButtonContainer: import("styled-components").StyledComponent<"div", any, {
|
|
1
|
+
export declare const ActionButtonContainer: import("styled-components").StyledComponent<"div", any, {
|
|
2
|
+
isSelected: boolean;
|
|
3
|
+
isError: boolean;
|
|
4
|
+
border: string;
|
|
5
|
+
isConfigured: boolean;
|
|
6
|
+
}, never>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface ActionButtonInterface {
|
|
3
|
-
|
|
3
|
+
state: 'CONFIGURED' | 'NOT-CONFIGURED';
|
|
4
4
|
buttonText: string;
|
|
5
|
+
isSelected: boolean;
|
|
6
|
+
isError: boolean;
|
|
7
|
+
onClick: () => void;
|
|
5
8
|
icon: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
|
|
6
9
|
}
|
|
7
10
|
declare const ActionButton: React.FC<ActionButtonInterface>;
|
|
@@ -15,6 +15,8 @@ export type LineChartProps = {
|
|
|
15
15
|
x?: string;
|
|
16
16
|
y?: string;
|
|
17
17
|
yPrefix?: string;
|
|
18
|
+
xDrawBorder?: boolean;
|
|
19
|
+
yDrawBorder?: boolean;
|
|
18
20
|
};
|
|
19
21
|
legends: Array<string>;
|
|
20
22
|
stepSize?: number;
|
|
@@ -22,5 +24,8 @@ export type LineChartProps = {
|
|
|
22
24
|
max?: number;
|
|
23
25
|
isZeroState?: boolean;
|
|
24
26
|
ticksLabelCallback?: (val: string, index: number) => void;
|
|
27
|
+
tension?: number;
|
|
28
|
+
newLineStyles?: boolean;
|
|
29
|
+
prefixCurrencyInYAxis?: string;
|
|
25
30
|
};
|
|
26
31
|
export declare const LineChart: React.FC<LineChartProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e,Fragment as o}from"react/jsx-runtime";import{Chart as r,CategoryScale as
|
|
1
|
+
import{jsxs as t,jsx as e,Fragment as o}from"react/jsx-runtime";import{Chart as r,CategoryScale as n,LinearScale as l,PointElement as i,BarElement as a,LineElement as s,ArcElement as d,Filler as c,Title as p,Tooltip as u,Legend as g}from"chart.js";import{useState as b,useRef as m,useEffect as y}from"react";import{Line as v}from"react-chartjs-2";import{SmallRegular as h}from"../../../TypographyStyle.js";import{COLORS as f}from"../../../../constants/Theme.js";import{LegendWrapper as x,LegendContainer as k,LegendColor as C}from"./LineChart.styled.js";r.register(n,l,i,a,s,d,c,p,u,g);const j=r=>{let{scaleText:n,labels:l,canvasHeight:i,datas:a,maintainAspectRatio:s=!1,stepSize:d,min:c,max:p,isZeroState:u,tension:g,newLineStyles:j,ticksLabelCallback:w,prefixCurrencyInYAxis:O}=r;var S,B,z;const[A,D]=b(null),F=m();y((()=>{var t,e,o,r;if(null===(r=null===(o=null===(e=null===(t=F.current)||void 0===t?void 0:t.scales)||void 0===e?void 0:e.y)||void 0===o?void 0:o.ticks)||void 0===r?void 0:r.length){const t=38*F.current.scales.y.ticks.length;D(t)}}),[F]);const L=a.map((t=>({text:t.legend,color:t.lineColor?t.lineColor:t.dotted?f.content.placeholder:f.background.brand}))),R={labels:l,datasets:a.map(((t,e)=>{var o;return Object.assign(Object.assign({tension:null!=g?g:.4,fill:t.gradient?"start":0},((t,e)=>{const o={borderColor:t||(e?f.content.placeholder:f.background.brand)};return j?Object.assign({pointStyle:"circle",pointRadius:5,pointBorderColor:"transparent",pointBackgroundColor:t||(e?f.content.placeholder:f.background.brand)},o):Object.assign({pointRadius:1},o)})(t.lineColor,t.dotted)),{borderDash:t.dotted?[8,3]:void 0,data:t.data,borderWidth:2,backgroundColor:t.gradient?t=>{const e=t.chart.ctx.createLinearGradient(0,0,0,A?A-75:150);return e.addColorStop(0,"#F1EEFB"),e.addColorStop(1,"rgba(127, 86, 217, 0)"),e}:null!==(o=t.backgroundColor)&&void 0!==o?o:"transparent"})}))},T={maintainAspectRatio:s,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:!1,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>f.content.primaryInverse,backgroundColor:f.content.primary,callbacks:{labelTextColor:()=>f.content.primaryInverse},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:u?0:c,max:u?10:p,ticks:{color:f.content.secondary,callback:t=>{var e;return`${null!==(e=null==n?void 0:n.yPrefix)&&void 0!==e?e:""}${t}${null!=O?O:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:u?1:d},title:{display:!!(null==n?void 0:n.y),text:null==n?void 0:n.y},grid:{color:f.background.base,drawBorder:null===(S=null==n?void 0:n.yDrawBorder)||void 0===S||S}},x:{ticks:{callback:w,color:f.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==n?void 0:n.x),text:null==n?void 0:n.x},grid:{display:!1,drawBorder:null!==(B=null==n?void 0:n.xDrawBorder)&&void 0!==B&&B}}}};return t("div",Object.assign({style:Object.assign(Object.assign({},s?{}:{height:null!==(z=null!=i?i:A)&&void 0!==z?z:204}),{display:"flex",flexDirection:"column",gap:2})},{children:[e(x,{children:L.map(((r,n)=>{let{text:l,color:i}=r;return l?t(k,{children:[e(C,{color:i}),e(h,Object.assign({color:"#667085"},{children:l}))]},n):e(o,{})}))}),e(v,{ref:F,options:T,data:R})]}))};export{j as LineChart};
|