@bikdotai/bik-component-library 0.0.670-beta.2 → 0.0.670
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/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +0 -11
- package/dist/cjs/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/cjs/components/tag/Tag.d.ts +1 -1
- package/dist/cjs/components/tag/Tag.js +1 -1
- package/dist/cjs/components/tag/model.d.ts +1 -12
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.d.ts +0 -11
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.js +1 -1
- package/dist/esm/components/tag/Tag.d.ts +1 -1
- package/dist/esm/components/tag/Tag.js +1 -1
- package/dist/esm/components/tag/model.d.ts +1 -12
- package/package.json +1 -1
- package/dist/cjs/components/tag/Tag.stories.d.ts +0 -22
- package/dist/esm/components/tag/Tag.stories.d.ts +0 -22
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default EventsTrigger;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default IGTrigger;
|
package/dist/cjs/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
package/dist/cjs/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropdownOption } from "../../../dropdown/type";
|
|
3
|
-
import { QueryBuilderProperty } from "../../
|
|
4
|
-
import { QueryBuilderNodeProps } from "../../
|
|
3
|
+
import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
|
|
4
|
+
import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
|
|
5
5
|
declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
|
|
6
6
|
cacheKey: string;
|
|
7
7
|
propertyAddBtnText: string;
|
|
@@ -11,18 +11,14 @@ export type LineChartProps = {
|
|
|
11
11
|
legend?: string;
|
|
12
12
|
lineWidth?: number;
|
|
13
13
|
squareLegends?: boolean;
|
|
14
|
-
useSecondYAxis?: boolean;
|
|
15
14
|
}[];
|
|
16
15
|
labels: Array<string>;
|
|
17
16
|
scaleText?: {
|
|
18
17
|
x?: string;
|
|
19
18
|
y?: string;
|
|
20
19
|
yPrefix?: string;
|
|
21
|
-
y2?: string;
|
|
22
|
-
y2Prefix?: string;
|
|
23
20
|
xDrawBorder?: boolean;
|
|
24
21
|
yDrawBorder?: boolean;
|
|
25
|
-
y2DrawBorder?: boolean;
|
|
26
22
|
};
|
|
27
23
|
legends: Array<string>;
|
|
28
24
|
stepSize?: number;
|
|
@@ -43,12 +39,5 @@ export type LineChartProps = {
|
|
|
43
39
|
customYHeaders?: any;
|
|
44
40
|
legendsAndIconDirection?: 'row-reverse' | 'row';
|
|
45
41
|
headerIcons?: React.ReactNode[];
|
|
46
|
-
hasSecondYAxis?: boolean;
|
|
47
|
-
min2?: number;
|
|
48
|
-
max2?: number;
|
|
49
|
-
stepSize2?: number;
|
|
50
|
-
prefixCurrencyInY2Axis?: string;
|
|
51
|
-
useKFormat2?: boolean;
|
|
52
|
-
customY2Headers?: any;
|
|
53
42
|
};
|
|
54
43
|
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"),n=require("react"),l=require("react-chartjs-2"),r=require("../../../TypographyStyle.js"),i=require("../../../../constants/Theme.js"),o=require("../utils/calcPercentage.js"),a=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:s,labels:d,canvasHeight:c,datas:u,maintainAspectRatio:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("chart.js"),n=require("react"),l=require("react-chartjs-2"),r=require("../../../TypographyStyle.js"),i=require("../../../../constants/Theme.js"),o=require("../utils/calcPercentage.js"),a=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:s,labels:d,canvasHeight:c,datas:u,maintainAspectRatio:g=!1,stepSize:p,min:y,max:b,isZeroState:C,tension:v,isNewStyles:h,prefixCurrencyInYAxis:x,pointRadius:O,useKFormat:j,lineThickness:m,ticksLabelCallback:S,labelCallback:L,afterBodyCallBack:f,titleTooltipCallback:k,isInternationalStore:R,customYHeaders:w,headerIcons:q=[],legendsAndIconDirection:B="row"}=t;var F,T,I;const[E,z]=n.useState(null),A=n.useRef();n.useEffect((()=>{var e,t,n,l;if(null===(l=null===(n=null===(t=null===(e=A.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===n?void 0:n.ticks)||void 0===l?void 0:l.length){const e=38*A.current.scales.y.ticks.length;z(e)}}),[A]);const D=u.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?i.COLORS.content.placeholder:i.COLORS.background.brand,square:e.squareLegends}))),$={labels:d,datasets:u.map(((e,t)=>{var n,l,r;return Object.assign(Object.assign({tension:null!=v?v:.4,fill:e.gradient?"start":0},((e,t)=>{const n={borderColor:e||(t?i.COLORS.content.placeholder:i.COLORS.background.brand)};return h?Object.assign({pointStyle:"circle",pointRadius:O||(d&&d.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?i.COLORS.content.placeholder:i.COLORS.background.brand)},n):Object.assign({pointRadius:null!=O?O:1},n)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(l=null!==(n=e.lineWidth)&&void 0!==n?n:m)&&void 0!==l?l:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,E?E-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",legend:e.legend})}))},P={maintainAspectRatio:g,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=h&&h,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>i.COLORS.content.primaryInverse,backgroundColor:i.COLORS.content.primary,callbacks:{labelTextColor:()=>i.COLORS.content.primaryInverse,title:k,label:L,afterBody:f},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:C?0:y,max:C?10:b,ticks:{color:i.COLORS.content.secondary,callback:e=>{var t,n;return j?`${null!==(t=null==s?void 0:s.yPrefix)&&void 0!==t?t:""}${R?o.truncateValueForInternationalStore(e):o.truncateValueForIndianStore(e)}${null!=x?x:""}`:w&&Object.keys(w).length>0?w[e]:`${null!==(n=null==s?void 0:s.yPrefix)&&void 0!==n?n:""}${e}${null!=x?x:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:C?1:p,padding:h?24:0},title:{display:!!(null==s?void 0:s.y),text:null==s?void 0:s.y},grid:{color:i.COLORS.background.base,drawBorder:null===(F=null==s?void 0:s.yDrawBorder)||void 0===F||F}},x:{ticks:{callback:S,color:i.COLORS.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==s?void 0:s.x),text:null==s?void 0:s.x},grid:{display:!1,drawBorder:null!==(T=null==s?void 0:s.xDrawBorder)&&void 0!==T&&T}}}};return e.jsxs("div",Object.assign({style:Object.assign(Object.assign({},g?{}:{height:null!==(I=null!=c?c:E)&&void 0!==I?I:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[e.jsxs("div",Object.assign({style:{display:"flex",justifyContent:"space-between",width:"100%",flexDirection:B}},{children:[e.jsx(a.LegendWrapper,{children:q.map(((t,n)=>e.jsx(a.LegendContainer,{children:t},n)))}),e.jsx(a.LegendWrapper,{children:D.map(((t,n)=>{let{text:l,color:i,square:o}=t;return l?e.jsxs(a.LegendContainer,{children:[e.jsx(a.LegendColor,{color:i,square:o,newStyle:h}),e.jsx(r.BodyTiny,Object.assign({color:"#667085"},{children:l}))]},n):e.jsx(e.Fragment,{})}))})]})),e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(l.Line,{ref:A,options:P,data:$})}))]}))};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TagProps } from './model';
|
|
2
2
|
export declare const Tag: {
|
|
3
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding,
|
|
3
|
+
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, }: TagProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),n=require("../
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),n=require("../TypographyStyle.js"),t=require("./model.js"),a=require("./Tag.styled.js"),r=require("./themes.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=s(i);const o=i=>{let{tagText:s,LeadingIcon:o,TrailingIcon:l,onLeadingIconClicked:d,leadingIconId:g,trailingIconId:p,onTrailingIconClicked:j,theme:u="light",type:h="neutral",variant:m="regular",version:y,cursor:b,alignIcon:x,noBorder:T,tagHtmlText:I,contentPadding:O}=i,C=s;const f=u;let v=h;t.ValidTagTypeMap[m][h]||(v="neutral"),"circle"===m&&"number"==typeof C&&C>99&&(C="99+");const q={height:"compressed"===m?12:16,width:"compressed"===m?12:16,color:r.getTagIconColor(u,v),style:{display:"block"}};return e.jsx(a.Tag,Object.assign({cursor:b,theme:f,type:h,variant:m,version:y,alignIcon:x,noBorder:T,contentPadding:O},{children:e.jsxs("div",Object.assign({className:"container"},{children:[o&&e.jsx("button",Object.assign({className:"icon-leading",onClick:d,id:`${g}-wrapper`||"leading-icon-wrapper"},{children:c.default.createElement(o,Object.assign(Object.assign({},q),{id:g||"leading-icon"}))})),I&&("ai"===h&&"light"===u?e.jsx(n.AiBodyCaption,{children:I}):e.jsx(n.BodyCaption,Object.assign({className:"text"},{children:I}))),!I&&""!==C&&("ai"===h&&"light"===u?e.jsx(n.AiBodyCaption,{children:C}):e.jsx(n.BodyCaption,Object.assign({className:"text"},{children:C}))),l&&e.jsx("button",Object.assign({className:"icon-trailing",onClick:j,id:`${p}-wrapper`||"trailing-icon-wrapper"},{children:c.default.createElement(l,Object.assign(Object.assign({},q),{id:p||"trailing-icon"}))}))]}))}))};o.displayName="Tag",exports.Tag=o;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MouseEventHandler } from 'react';
|
|
3
|
-
import { TooltipProps } from '../tooltips/Tooltip';
|
|
4
3
|
export type TagTheme = 'light' | 'dark';
|
|
5
4
|
export type TagVariant = 'regular' | 'circle' | 'compressed';
|
|
6
5
|
export type TagType = 'negative' | 'warning' | 'positive' | 'neutral' | 'white' | 'purple' | 'blue' | 'grey' | 'ai';
|
|
@@ -63,14 +62,9 @@ export interface TagProps extends React.BaseHTMLAttributes<HTMLDivElement> {
|
|
|
63
62
|
*/
|
|
64
63
|
trailingIconId?: string;
|
|
65
64
|
/**
|
|
66
|
-
* The
|
|
65
|
+
* The left icon on click event, defaults to () => {}
|
|
67
66
|
*/
|
|
68
67
|
onTrailingIconClicked?: MouseEventHandler<HTMLButtonElement>;
|
|
69
|
-
/**
|
|
70
|
-
* Tooltip props for the trailing icon
|
|
71
|
-
* @default undefined
|
|
72
|
-
*/
|
|
73
|
-
trailingIconTooltip?: Omit<TooltipProps, 'children'>;
|
|
74
68
|
/**
|
|
75
69
|
* The icon component that is to the left of the text
|
|
76
70
|
* Referred to https://ozzie.sh/passing-icons-as-props-in-a-consistent-way-using-react
|
|
@@ -86,11 +80,6 @@ export interface TagProps extends React.BaseHTMLAttributes<HTMLDivElement> {
|
|
|
86
80
|
* @default leading-icon
|
|
87
81
|
*/
|
|
88
82
|
leadingIconId?: string;
|
|
89
|
-
/**
|
|
90
|
-
* Tooltip props for the leading icon
|
|
91
|
-
* @default undefined
|
|
92
|
-
*/
|
|
93
|
-
leadingIconTooltip?: Omit<TooltipProps, 'children'>;
|
|
94
83
|
tagText: string | number;
|
|
95
84
|
version?: '1.0' | '2.0';
|
|
96
85
|
cursor?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const EventsTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default EventsTrigger;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default IGTrigger;
|
package/dist/esm/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
package/dist/esm/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropdownOption } from "../../../dropdown/type";
|
|
3
|
-
import { QueryBuilderProperty } from "../../
|
|
4
|
-
import { QueryBuilderNodeProps } from "../../
|
|
3
|
+
import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
|
|
4
|
+
import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
|
|
5
5
|
declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
|
|
6
6
|
cacheKey: string;
|
|
7
7
|
propertyAddBtnText: string;
|
|
@@ -11,18 +11,14 @@ export type LineChartProps = {
|
|
|
11
11
|
legend?: string;
|
|
12
12
|
lineWidth?: number;
|
|
13
13
|
squareLegends?: boolean;
|
|
14
|
-
useSecondYAxis?: boolean;
|
|
15
14
|
}[];
|
|
16
15
|
labels: Array<string>;
|
|
17
16
|
scaleText?: {
|
|
18
17
|
x?: string;
|
|
19
18
|
y?: string;
|
|
20
19
|
yPrefix?: string;
|
|
21
|
-
y2?: string;
|
|
22
|
-
y2Prefix?: string;
|
|
23
20
|
xDrawBorder?: boolean;
|
|
24
21
|
yDrawBorder?: boolean;
|
|
25
|
-
y2DrawBorder?: boolean;
|
|
26
22
|
};
|
|
27
23
|
legends: Array<string>;
|
|
28
24
|
stepSize?: number;
|
|
@@ -43,12 +39,5 @@ export type LineChartProps = {
|
|
|
43
39
|
customYHeaders?: any;
|
|
44
40
|
legendsAndIconDirection?: 'row-reverse' | 'row';
|
|
45
41
|
headerIcons?: React.ReactNode[];
|
|
46
|
-
hasSecondYAxis?: boolean;
|
|
47
|
-
min2?: number;
|
|
48
|
-
max2?: number;
|
|
49
|
-
stepSize2?: number;
|
|
50
|
-
prefixCurrencyInY2Axis?: string;
|
|
51
|
-
useKFormat2?: boolean;
|
|
52
|
-
customY2Headers?: any;
|
|
53
42
|
};
|
|
54
43
|
export declare const LineChart: React.FC<LineChartProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{Chart as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{Chart as n,CategoryScale as o,LinearScale as r,PointElement as i,BarElement as a,LineElement as s,ArcElement as d,Filler as c,Title as u,Tooltip as p,Legend as g}from"chart.js";import{useState as b,useRef as y,useEffect as m}from"react";import{Line as v}from"react-chartjs-2";import{BodyTiny as h}from"../../../TypographyStyle.js";import{COLORS as f}from"../../../../constants/Theme.js";import{truncateValueForInternationalStore as x,truncateValueForIndianStore as k}from"../utils/calcPercentage.js";import{LegendWrapper as C,LegendContainer as j,LegendColor as w}from"./LineChart.styled.js";n.register(o,r,i,a,s,d,c,u,p,g);const O=n=>{let{scaleText:o,labels:r,canvasHeight:i,datas:a,maintainAspectRatio:s=!1,stepSize:d,min:c,max:u,isZeroState:p,tension:g,isNewStyles:O,prefixCurrencyInYAxis:B,pointRadius:S,useKFormat:z,lineThickness:D,ticksLabelCallback:I,labelCallback:T,afterBodyCallBack:$,titleTooltipCallback:A,isInternationalStore:F,customYHeaders:R,headerIcons:q=[],legendsAndIconDirection:L="row"}=n;var P,E,H;const[W,Y]=b(null),Z=y();m((()=>{var e,t,l,n;if(null===(n=null===(l=null===(t=null===(e=Z.current)||void 0===e?void 0:e.scales)||void 0===t?void 0:t.y)||void 0===l?void 0:l.ticks)||void 0===n?void 0:n.length){const e=38*Z.current.scales.y.ticks.length;Y(e)}}),[Z]);const G=a.map((e=>({text:e.legend,color:e.lineColor?e.lineColor:e.dotted?f.content.placeholder:f.background.brand,square:e.squareLegends}))),K={labels:r,datasets:a.map(((e,t)=>{var l,n,o;return Object.assign(Object.assign({tension:null!=g?g:.4,fill:e.gradient?"start":0},((e,t)=>{const l={borderColor:e||(t?f.content.placeholder:f.background.brand)};return O?Object.assign({pointStyle:"circle",pointRadius:S||(r&&r.length>10?2.5:4),pointBorderColor:"transparent",pointBackgroundColor:e||(t?f.content.placeholder:f.background.brand)},l):Object.assign({pointRadius:null!=S?S:1},l)})(e.lineColor,e.dotted)),{borderDash:e.dotted?[8,3]:void 0,data:e.data,borderWidth:null!==(n=null!==(l=e.lineWidth)&&void 0!==l?l:D)&&void 0!==n?n:2,backgroundColor:e.gradient?e=>{const t=e.chart.ctx.createLinearGradient(0,0,0,W?W-75:150);return t.addColorStop(0,"#F1EEFB"),t.addColorStop(1,"rgba(127, 86, 217, 0)"),t}:null!==(o=e.backgroundColor)&&void 0!==o?o:"transparent",legend:e.legend})}))},N={maintainAspectRatio:s,responsive:!0,plugins:{legend:{display:!1},title:{display:!1},tooltip:{displayColors:null!=O&&O,titleFont:()=>({weight:"600",size:14,family:"inter"}),titleColor:()=>f.content.primaryInverse,backgroundColor:f.content.primary,callbacks:{labelTextColor:()=>f.content.primaryInverse,title:A,label:T,afterBody:$},bodyFont:()=>({weight:"400",size:14,family:"inter"})}},scales:{y:{beginAtZero:!0,min:p?0:c,max:p?10:u,ticks:{color:f.content.secondary,callback:e=>{var t,l;return z?`${null!==(t=null==o?void 0:o.yPrefix)&&void 0!==t?t:""}${F?x(e):k(e)}${null!=B?B:""}`:R&&Object.keys(R).length>0?R[e]:`${null!==(l=null==o?void 0:o.yPrefix)&&void 0!==l?l:""}${e}${null!=B?B:""}`},font:{family:"inter",size:12,weight:"400"},stepSize:p?1:d,padding:O?24:0},title:{display:!!(null==o?void 0:o.y),text:null==o?void 0:o.y},grid:{color:f.background.base,drawBorder:null===(P=null==o?void 0:o.yDrawBorder)||void 0===P||P}},x:{ticks:{callback:I,color:f.content.secondary,font:{family:"inter",size:12,weight:"400"}},title:{display:!!(null==o?void 0:o.x),text:null==o?void 0:o.x},grid:{display:!1,drawBorder:null!==(E=null==o?void 0:o.xDrawBorder)&&void 0!==E&&E}}}};return e("div",Object.assign({style:Object.assign(Object.assign({},s?{}:{height:null!==(H=null!=i?i:W)&&void 0!==H?H:204}),{display:"flex",flexDirection:"column",gap:2,width:"100%"})},{children:[e("div",Object.assign({style:{display:"flex",justifyContent:"space-between",width:"100%",flexDirection:L}},{children:[t(C,{children:q.map(((e,l)=>t(j,{children:e},l)))}),t(C,{children:G.map(((n,o)=>{let{text:r,color:i,square:a}=n;return r?e(j,{children:[t(w,{color:i,square:a,newStyle:O}),t(h,Object.assign({color:"#667085"},{children:r}))]},o):t(l,{})}))})]})),t("div",Object.assign({style:{flex:1}},{children:t(v,{ref:Z,options:N,data:K})}))]}))};export{O as LineChart};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TagProps } from './model';
|
|
2
2
|
export declare const Tag: {
|
|
3
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding,
|
|
3
|
+
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, }: TagProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import n from"react";import{AiBodyCaption as t,BodyCaption as r}from"../TypographyStyle.js";import{ValidTagTypeMap as a}from"./model.js";import{Tag as c}from"./Tag.styled.js";import{getTagIconColor as o}from"./themes.js";const s=s=>{let{tagText:l,LeadingIcon:g,TrailingIcon:d,onLeadingIconClicked:m,leadingIconId:p,trailingIconId:h,onTrailingIconClicked:j,theme:b="light",type:u="neutral",variant:y="regular",version:I,cursor:O,alignIcon:T,noBorder:f,tagHtmlText:x,contentPadding:N}=s,k=l;const v=b;let w=u;a[y][u]||(w="neutral"),"circle"===y&&"number"==typeof k&&k>99&&(k="99+");const C={height:"compressed"===y?12:16,width:"compressed"===y?12:16,color:o(b,w),style:{display:"block"}};return e(c,Object.assign({cursor:O,theme:v,type:u,variant:y,version:I,alignIcon:T,noBorder:f,contentPadding:N},{children:i("div",Object.assign({className:"container"},{children:[g&&e("button",Object.assign({className:"icon-leading",onClick:m,id:`${p}-wrapper`||"leading-icon-wrapper"},{children:n.createElement(g,Object.assign(Object.assign({},C),{id:p||"leading-icon"}))})),x&&("ai"===u&&"light"===b?e(t,{children:x}):e(r,Object.assign({className:"text"},{children:x}))),!x&&""!==k&&("ai"===u&&"light"===b?e(t,{children:k}):e(r,Object.assign({className:"text"},{children:k}))),d&&e("button",Object.assign({className:"icon-trailing",onClick:j,id:`${h}-wrapper`||"trailing-icon-wrapper"},{children:n.createElement(d,Object.assign(Object.assign({},C),{id:h||"trailing-icon"}))}))]}))}))};s.displayName="Tag";export{s as Tag};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MouseEventHandler } from 'react';
|
|
3
|
-
import { TooltipProps } from '../tooltips/Tooltip';
|
|
4
3
|
export type TagTheme = 'light' | 'dark';
|
|
5
4
|
export type TagVariant = 'regular' | 'circle' | 'compressed';
|
|
6
5
|
export type TagType = 'negative' | 'warning' | 'positive' | 'neutral' | 'white' | 'purple' | 'blue' | 'grey' | 'ai';
|
|
@@ -63,14 +62,9 @@ export interface TagProps extends React.BaseHTMLAttributes<HTMLDivElement> {
|
|
|
63
62
|
*/
|
|
64
63
|
trailingIconId?: string;
|
|
65
64
|
/**
|
|
66
|
-
* The
|
|
65
|
+
* The left icon on click event, defaults to () => {}
|
|
67
66
|
*/
|
|
68
67
|
onTrailingIconClicked?: MouseEventHandler<HTMLButtonElement>;
|
|
69
|
-
/**
|
|
70
|
-
* Tooltip props for the trailing icon
|
|
71
|
-
* @default undefined
|
|
72
|
-
*/
|
|
73
|
-
trailingIconTooltip?: Omit<TooltipProps, 'children'>;
|
|
74
68
|
/**
|
|
75
69
|
* The icon component that is to the left of the text
|
|
76
70
|
* Referred to https://ozzie.sh/passing-icons-as-props-in-a-consistent-way-using-react
|
|
@@ -86,11 +80,6 @@ export interface TagProps extends React.BaseHTMLAttributes<HTMLDivElement> {
|
|
|
86
80
|
* @default leading-icon
|
|
87
81
|
*/
|
|
88
82
|
leadingIconId?: string;
|
|
89
|
-
/**
|
|
90
|
-
* Tooltip props for the leading icon
|
|
91
|
-
* @default undefined
|
|
92
|
-
*/
|
|
93
|
-
leadingIconTooltip?: Omit<TooltipProps, 'children'>;
|
|
94
83
|
tagText: string | number;
|
|
95
84
|
version?: '1.0' | '2.0';
|
|
96
85
|
cursor?: string;
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
-
declare const _default: ComponentMeta<{
|
|
3
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: import("./model").TagProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
displayName: string;
|
|
5
|
-
}>;
|
|
6
|
-
export default _default;
|
|
7
|
-
export declare const Default: ComponentStory<{
|
|
8
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: import("./model").TagProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
displayName: string;
|
|
10
|
-
}>;
|
|
11
|
-
export declare const WithIcons: ComponentStory<{
|
|
12
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: import("./model").TagProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
displayName: string;
|
|
14
|
-
}>;
|
|
15
|
-
export declare const WithIconTooltips: ComponentStory<{
|
|
16
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: import("./model").TagProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
displayName: string;
|
|
18
|
-
}>;
|
|
19
|
-
export declare const DarkTheme: ComponentStory<{
|
|
20
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: import("./model").TagProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
displayName: string;
|
|
22
|
-
}>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
-
declare const _default: ComponentMeta<{
|
|
3
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: import("./model").TagProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
displayName: string;
|
|
5
|
-
}>;
|
|
6
|
-
export default _default;
|
|
7
|
-
export declare const Default: ComponentStory<{
|
|
8
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: import("./model").TagProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
displayName: string;
|
|
10
|
-
}>;
|
|
11
|
-
export declare const WithIcons: ComponentStory<{
|
|
12
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: import("./model").TagProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
displayName: string;
|
|
14
|
-
}>;
|
|
15
|
-
export declare const WithIconTooltips: ComponentStory<{
|
|
16
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: import("./model").TagProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
displayName: string;
|
|
18
|
-
}>;
|
|
19
|
-
export declare const DarkTheme: ComponentStory<{
|
|
20
|
-
({ tagText, LeadingIcon, TrailingIcon, onLeadingIconClicked, leadingIconId, trailingIconId, onTrailingIconClicked, theme, type, variant, version, cursor, alignIcon, noBorder, tagHtmlText, contentPadding, leadingIconTooltip, trailingIconTooltip, }: import("./model").TagProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
displayName: string;
|
|
22
|
-
}>;
|