@bikdotai/bik-component-library 0.0.840-tools-beta.5 → 0.0.840
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/BikGiftedChat/GiftedChat/GiftedChat.js +1 -1
- package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
- package/dist/cjs/components/SearchFilter/index.js +1 -1
- package/dist/cjs/components/SearchFilter/index.js.map +1 -1
- package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChip.js +1 -1
- package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChip.js.map +1 -1
- package/dist/cjs/components/button/themes.js +11 -11
- package/dist/cjs/components/button/themes.js.map +1 -1
- package/dist/cjs/components/dashboard-review-popup/DashboardReviewPopUp.js +1 -1
- package/dist/cjs/components/dashboard-review-popup/DashboardReviewPopUp.js.map +1 -1
- package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
- package/dist/cjs/components/dropdown-button/DropdownButton.js.map +1 -1
- package/dist/cjs/components/input/Input.js +1 -1
- package/dist/cjs/components/input/Input.js.map +1 -1
- package/dist/cjs/components/multi-level-dropdown/MenuItem.js +1 -1
- package/dist/cjs/components/multi-level-dropdown/MenuItem.js.map +1 -1
- package/dist/cjs/components/radioButton/RadioButton.js +1 -1
- package/dist/cjs/components/radioButton/RadioButton.js.map +1 -1
- package/dist/cjs/components/radioList/RadioList.js +1 -1
- package/dist/cjs/components/radioList/RadioList.js.map +1 -1
- package/dist/cjs/components/searchBar/searchBar.js +1 -1
- package/dist/cjs/components/searchBar/searchBar.js.map +1 -1
- package/dist/cjs/components/side-modal/SideModal.js +1 -1
- package/dist/cjs/components/side-modal/SideModal.js.map +1 -1
- package/dist/cjs/components/star-rating/Star.js +1 -1
- package/dist/cjs/components/star-rating/Star.js.map +1 -1
- package/dist/cjs/components/star-rating/StarRating.js +2 -2
- package/dist/cjs/components/star-rating/StarRating.js.map +1 -1
- package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
- package/dist/cjs/components/template-preview/TemplatePreview.js.map +1 -1
- package/dist/cjs/components/thumbnail/Thumbnail.js +1 -1
- package/dist/cjs/components/thumbnail/Thumbnail.js.map +1 -1
- package/dist/cjs/components/zeroState/ZeroState.js +3 -3
- package/dist/cjs/components/zeroState/ZeroState.js.map +1 -1
- package/dist/cjs/icons/Media/Visual/FormkitNeutral.js +2 -0
- package/dist/cjs/icons/Media/Visual/FormkitNeutral.js.map +1 -0
- package/dist/cjs/icons/Media/Visual/FormkitSad.js +2 -0
- package/dist/cjs/icons/Media/Visual/FormkitSad.js.map +1 -0
- package/dist/cjs/icons/index.js +1 -1
- package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js +66 -61
- package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
- package/dist/esm/components/SearchFilter/index.js +11 -10
- package/dist/esm/components/SearchFilter/index.js.map +1 -1
- package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChip.js +11 -10
- package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChip.js.map +1 -1
- package/dist/esm/components/button/themes.d.ts +1 -0
- package/dist/esm/components/button/themes.js +61 -51
- package/dist/esm/components/button/themes.js.map +1 -1
- package/dist/esm/components/dashboard-review-popup/DashboardReviewPopUp.js +28 -21
- package/dist/esm/components/dashboard-review-popup/DashboardReviewPopUp.js.map +1 -1
- package/dist/esm/components/dropdown-button/DropdownButton.js +13 -13
- package/dist/esm/components/dropdown-button/DropdownButton.js.map +1 -1
- package/dist/esm/components/input/Input.js +35 -34
- package/dist/esm/components/input/Input.js.map +1 -1
- package/dist/esm/components/input/Input.model.d.ts +1 -0
- package/dist/esm/components/multi-level-dropdown/MenuItem.js +28 -27
- package/dist/esm/components/multi-level-dropdown/MenuItem.js.map +1 -1
- package/dist/esm/components/radioButton/RadioButton.js +10 -9
- package/dist/esm/components/radioButton/RadioButton.js.map +1 -1
- package/dist/esm/components/radioList/RadioList.js +28 -19
- package/dist/esm/components/radioList/RadioList.js.map +1 -1
- package/dist/esm/components/searchBar/searchBar.js +11 -10
- package/dist/esm/components/searchBar/searchBar.js.map +1 -1
- package/dist/esm/components/side-modal/SideModal.js +13 -5
- package/dist/esm/components/side-modal/SideModal.js.map +1 -1
- package/dist/esm/components/star-rating/Star.d.ts +1 -0
- package/dist/esm/components/star-rating/Star.js +32 -27
- package/dist/esm/components/star-rating/Star.js.map +1 -1
- package/dist/esm/components/star-rating/StarRating.js +17 -16
- package/dist/esm/components/star-rating/StarRating.js.map +1 -1
- package/dist/esm/components/template-preview/TemplatePreview.js +41 -40
- package/dist/esm/components/template-preview/TemplatePreview.js.map +1 -1
- package/dist/esm/components/thumbnail/Thumbnail.js +3 -3
- package/dist/esm/components/thumbnail/Thumbnail.js.map +1 -1
- package/dist/esm/components/zeroState/ZeroState.js +20 -13
- package/dist/esm/components/zeroState/ZeroState.js.map +1 -1
- package/dist/esm/icons/Media/Visual/FormkitNeutral.js +58 -0
- package/dist/esm/icons/Media/Visual/FormkitNeutral.js.map +1 -0
- package/dist/esm/icons/Media/Visual/FormkitSad.js +61 -0
- package/dist/esm/icons/Media/Visual/FormkitSad.js.map +1 -0
- package/dist/esm/icons/Media/Visual/index.d.ts +2 -0
- package/dist/esm/icons/index.d.ts +25 -25
- package/dist/esm/icons/index.js +420 -416
- package/dist/esm/icons/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import y from "../../assets/icons/info.svg.js";
|
|
3
|
-
import { BASE_COLORS as
|
|
3
|
+
import { BASE_COLORS as t } from "../../constants/Theme.js";
|
|
4
4
|
import { BodyCaption as C, TitleLarge as f } from "../TypographyStyle.js";
|
|
5
5
|
import { AnalyticsChipChannelFooter as g } from "./AnalyticsChipChannelFooter.js";
|
|
6
6
|
import { AnalyticsChipContainer as x } from "./CommonStyles.js";
|
|
@@ -10,11 +10,11 @@ const L = (e) => {
|
|
|
10
10
|
title: n,
|
|
11
11
|
primaryValue: a,
|
|
12
12
|
titleColor: c,
|
|
13
|
-
captionColor: s =
|
|
14
|
-
backgroundColor: p =
|
|
15
|
-
width:
|
|
16
|
-
extraJSX:
|
|
17
|
-
tooltipContent:
|
|
13
|
+
captionColor: s = t.grayscale[700],
|
|
14
|
+
backgroundColor: p = t.grayscale[50],
|
|
15
|
+
width: h = "224.67px",
|
|
16
|
+
extraJSX: m,
|
|
17
|
+
tooltipContent: r,
|
|
18
18
|
channelConfig: i,
|
|
19
19
|
style: d
|
|
20
20
|
} = e;
|
|
@@ -23,22 +23,23 @@ const L = (e) => {
|
|
|
23
23
|
{
|
|
24
24
|
style: d ?? {},
|
|
25
25
|
backgroundColor: p,
|
|
26
|
-
width:
|
|
26
|
+
width: h,
|
|
27
27
|
children: [
|
|
28
28
|
/* @__PURE__ */ l("div", { className: "sub--container", children: [
|
|
29
29
|
/* @__PURE__ */ o(C, { style: { color: s }, children: n }),
|
|
30
|
-
|
|
30
|
+
r && /* @__PURE__ */ o(u, { body: r, children: /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
|
|
31
31
|
y,
|
|
32
32
|
{
|
|
33
|
+
"data-test": "analytics-chip-tooltip-icon",
|
|
33
34
|
height: 14.67,
|
|
34
35
|
width: 14.67,
|
|
35
|
-
color:
|
|
36
|
+
color: t.grayscale[500]
|
|
36
37
|
}
|
|
37
38
|
) }) })
|
|
38
39
|
] }),
|
|
39
40
|
/* @__PURE__ */ o(f, { style: { color: c }, children: a }),
|
|
40
41
|
i && /* @__PURE__ */ o(g, { channelConfig: i }),
|
|
41
|
-
|
|
42
|
+
m
|
|
42
43
|
]
|
|
43
44
|
}
|
|
44
45
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyticsChip.js","sources":["../../../../src/components/analytics-chips-and-dropdowns/AnalyticsChip.tsx"],"sourcesContent":["import Info from '@src/assets/icons/info.svg';\nimport React from 'react';\nimport { Tooltip } from '@src/components/tooltips';\nimport { BASE_COLORS } from '@src/constants/Theme';\nimport { BodyCaption, TitleLarge } from '../TypographyStyle';\nimport { AnalyticsChipInterface } from './AnalyticsChip.model';\nimport { AnalyticsChipChannelFooter } from './AnalyticsChipChannelFooter';\nimport { AnalyticsChipContainer } from './CommonStyles';\n\nexport const AnalyticsChip: React.FC<AnalyticsChipInterface> = (props) => {\n\tconst {\n\t\ttitle,\n\t\tprimaryValue,\n\t\ttitleColor,\n\t\tcaptionColor = BASE_COLORS.grayscale[700],\n\t\tbackgroundColor = BASE_COLORS.grayscale[50],\n\t\twidth = '224.67px',\n\t\textraJSX,\n\t\ttooltipContent,\n\t\tchannelConfig,\n\t\tstyle,\n\t} = props;\n\treturn (\n\t\t<AnalyticsChipContainer\n\t\t\tstyle={style ?? {}}\n\t\t\tbackgroundColor={backgroundColor}\n\t\t\twidth={width}\n\t\t>\n\t\t\t<div className=\"sub--container\">\n\t\t\t\t<BodyCaption style={{ color: captionColor }}>{title}</BodyCaption>\n\t\t\t\t{tooltipContent && (\n\t\t\t\t\t<Tooltip body={tooltipContent}>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<Info\n\t\t\t\t\t\t\t\theight={14.67}\n\t\t\t\t\t\t\t\twidth={14.67}\n\t\t\t\t\t\t\t\tcolor={BASE_COLORS.grayscale[500]}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t<TitleLarge style={{ color: titleColor }}>{primaryValue}</TitleLarge>\n\t\t\t{channelConfig && (\n\t\t\t\t<AnalyticsChipChannelFooter channelConfig={channelConfig} />\n\t\t\t)}\n\t\t\t{extraJSX}\n\t\t</AnalyticsChipContainer>\n\t);\n};\n"],"names":["AnalyticsChip","props","title","primaryValue","titleColor","captionColor","BASE_COLORS","backgroundColor","width","extraJSX","tooltipContent","channelConfig","style","jsxs","AnalyticsChipContainer","jsx","BodyCaption","Tooltip","Info","TitleLarge","AnalyticsChipChannelFooter"],"mappings":";;;;;;;AASO,MAAMA,IAAkD,CAACC,MAAU;AACzE,QAAM;AAAA,IACL,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC,IAAeC,EAAY,UAAU,GAAG;AAAA,IACxC,iBAAAC,IAAkBD,EAAY,UAAU,EAAE;AAAA,IAC1C,OAAAE,IAAQ;AAAA,IACR,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,OAAAC;AAAA,EAAA,IACGX;AACJ,SACC,gBAAAY;AAAA,IAACC;AAAA,IAAA;AAAA,MACA,OAAOF,KAAS,CAAA;AAAA,MAChB,iBAAAL;AAAA,MACA,OAAAC;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAK,EAAC,OAAA,EAAI,WAAU,kBACd,UAAA;AAAA,UAAA,gBAAAE,EAACC,KAAY,OAAO,EAAE,OAAOX,EAAA,GAAiB,UAAAH,GAAM;AAAA,UACnDQ,KACA,gBAAAK,EAACE,GAAA,EAAQ,MAAMP,GACd,4BAAC,OAAA,EACA,UAAA,gBAAAK;AAAA,YAACG;AAAAA,YAAA;AAAA,cACA,QAAQ;AAAA,cACR,OAAO;AAAA,cACP,OAAOZ,EAAY,UAAU,GAAG;AAAA,YAAA;AAAA,UAAA,GAElC,EAAA,CACD;AAAA,QAAA,GAEF;AAAA,0BACCa,GAAA,EAAW,OAAO,EAAE,OAAOf,EAAA,GAAe,UAAAD,GAAa;AAAA,QACvDQ,KACA,gBAAAI,EAACK,GAAA,EAA2B,eAAAT,EAAA,CAA8B;AAAA,QAE1DF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGJ;"}
|
|
1
|
+
{"version":3,"file":"AnalyticsChip.js","sources":["../../../../src/components/analytics-chips-and-dropdowns/AnalyticsChip.tsx"],"sourcesContent":["import Info from '@src/assets/icons/info.svg';\nimport React from 'react';\nimport { Tooltip } from '@src/components/tooltips';\nimport { BASE_COLORS } from '@src/constants/Theme';\nimport { BodyCaption, TitleLarge } from '../TypographyStyle';\nimport { AnalyticsChipInterface } from './AnalyticsChip.model';\nimport { AnalyticsChipChannelFooter } from './AnalyticsChipChannelFooter';\nimport { AnalyticsChipContainer } from './CommonStyles';\n\nexport const AnalyticsChip: React.FC<AnalyticsChipInterface> = (props) => {\n\tconst {\n\t\ttitle,\n\t\tprimaryValue,\n\t\ttitleColor,\n\t\tcaptionColor = BASE_COLORS.grayscale[700],\n\t\tbackgroundColor = BASE_COLORS.grayscale[50],\n\t\twidth = '224.67px',\n\t\textraJSX,\n\t\ttooltipContent,\n\t\tchannelConfig,\n\t\tstyle,\n\t} = props;\n\treturn (\n\t\t<AnalyticsChipContainer\n\t\t\tstyle={style ?? {}}\n\t\t\tbackgroundColor={backgroundColor}\n\t\t\twidth={width}\n\t\t>\n\t\t\t<div className=\"sub--container\">\n\t\t\t\t<BodyCaption style={{ color: captionColor }}>{title}</BodyCaption>\n\t\t\t\t{tooltipContent && (\n\t\t\t\t\t<Tooltip body={tooltipContent}>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<Info\n\t\t\t\t\t\t\t\tdata-test=\"analytics-chip-tooltip-icon\"\n\t\t\t\t\t\t\t\theight={14.67}\n\t\t\t\t\t\t\t\twidth={14.67}\n\t\t\t\t\t\t\t\tcolor={BASE_COLORS.grayscale[500]}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t<TitleLarge style={{ color: titleColor }}>{primaryValue}</TitleLarge>\n\t\t\t{channelConfig && (\n\t\t\t\t<AnalyticsChipChannelFooter channelConfig={channelConfig} />\n\t\t\t)}\n\t\t\t{extraJSX}\n\t\t</AnalyticsChipContainer>\n\t);\n};\n"],"names":["AnalyticsChip","props","title","primaryValue","titleColor","captionColor","BASE_COLORS","backgroundColor","width","extraJSX","tooltipContent","channelConfig","style","jsxs","AnalyticsChipContainer","jsx","BodyCaption","Tooltip","Info","TitleLarge","AnalyticsChipChannelFooter"],"mappings":";;;;;;;AASO,MAAMA,IAAkD,CAACC,MAAU;AACzE,QAAM;AAAA,IACL,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAAC,IAAeC,EAAY,UAAU,GAAG;AAAA,IACxC,iBAAAC,IAAkBD,EAAY,UAAU,EAAE;AAAA,IAC1C,OAAAE,IAAQ;AAAA,IACR,UAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,OAAAC;AAAA,EAAA,IACGX;AACJ,SACC,gBAAAY;AAAA,IAACC;AAAA,IAAA;AAAA,MACA,OAAOF,KAAS,CAAA;AAAA,MAChB,iBAAAL;AAAA,MACA,OAAAC;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAK,EAAC,OAAA,EAAI,WAAU,kBACd,UAAA;AAAA,UAAA,gBAAAE,EAACC,KAAY,OAAO,EAAE,OAAOX,EAAA,GAAiB,UAAAH,GAAM;AAAA,UACnDQ,KACA,gBAAAK,EAACE,GAAA,EAAQ,MAAMP,GACd,4BAAC,OAAA,EACA,UAAA,gBAAAK;AAAA,YAACG;AAAAA,YAAA;AAAA,cACA,aAAU;AAAA,cACV,QAAQ;AAAA,cACR,OAAO;AAAA,cACP,OAAOZ,EAAY,UAAU,GAAG;AAAA,YAAA;AAAA,UAAA,GAElC,EAAA,CACD;AAAA,QAAA,GAEF;AAAA,0BACCa,GAAA,EAAW,OAAO,EAAE,OAAOf,EAAA,GAAe,UAAAD,GAAa;AAAA,QACvDQ,KACA,gBAAAI,EAACK,GAAA,EAA2B,eAAAT,EAAA,CAA8B;AAAA,QAE1DF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGJ;"}
|
|
@@ -8,6 +8,7 @@ export declare const GetButtonTextComponent: (size: Size, type: Type, disabled?:
|
|
|
8
8
|
color?: string | undefined;
|
|
9
9
|
}, never>;
|
|
10
10
|
export declare const getBorderColor: (type: Type, inverse?: boolean, error?: boolean) => string;
|
|
11
|
+
export declare const strokeStyle: (size: Size, color: string, width?: number) => string;
|
|
11
12
|
export declare const getBorder: (version: '1.0' | '2.0' | '3.0', type: Type, size: Size, inverse?: boolean, error?: boolean) => string;
|
|
12
13
|
export declare const getLinearGradientValue: (size: Size) => string;
|
|
13
14
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { COLORS as r } from "../../constants/Theme.js";
|
|
2
|
-
import { ButtonRegularAI as
|
|
3
|
-
const
|
|
2
|
+
import { ButtonRegularAI as g, ButtonLargeAI as f, BodySecondary as l, BodyCaption as b, ButtonRegular as p, ButtonLarge as h } from "../TypographyStyle.js";
|
|
3
|
+
const y = (t, n, e, a, i) => {
|
|
4
4
|
if (t === "special") return r.background.brandVeryLight;
|
|
5
5
|
if (t === "secondaryGray") return "transparent";
|
|
6
6
|
if (n === "chip")
|
|
7
7
|
return t === "text" ? "transparent" : a ? r.surface.hovered : r.surface.subdued;
|
|
8
8
|
switch (t) {
|
|
9
9
|
case "primary":
|
|
10
|
-
return
|
|
10
|
+
return i || (e ? r.background.warning.vibrant : r.background.inverseLight);
|
|
11
11
|
case "destructive":
|
|
12
12
|
return r.background.negative.vibrant;
|
|
13
13
|
case "tertiary":
|
|
@@ -36,7 +36,7 @@ const m = (t, n, e, a, o) => {
|
|
|
36
36
|
default:
|
|
37
37
|
return e ? r.content.primaryInverse : r.stroke.brand;
|
|
38
38
|
}
|
|
39
|
-
},
|
|
39
|
+
}, v = (t) => t ? "rgba(255, 255, 255, 0.5)" : r.content.inactive, B = (t, n) => {
|
|
40
40
|
if (t === "text")
|
|
41
41
|
return "0px";
|
|
42
42
|
if (n === "xs")
|
|
@@ -70,27 +70,30 @@ const m = (t, n, e, a, o) => {
|
|
|
70
70
|
default:
|
|
71
71
|
return "14px 12px";
|
|
72
72
|
}
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
a,
|
|
76
|
-
|
|
77
|
-
)
|
|
78
|
-
|
|
79
|
-
!1,
|
|
80
|
-
|
|
81
|
-
)
|
|
73
|
+
}, L = (t, n, e) => !e && n === "ai" ? t === "small" ? g : f : n === "dashRegular" ? l : t === "chip" || t === "xs" ? b : t === "small" ? p : h, d = (t, n, e) => e ? r.stroke.negative.vibrant : n ? r.surface.standard : t == "secondary" ? r.stroke.brand : r.content.placeholder, o = (t, n, e = 1) => t === "xs" ? `box-shadow: inset 0 0 0 ${e}px ${n}; border: none;` : `border: ${e}px solid ${n};`, G = (t, n, e, a, i) => n == "text" ? "border: none;" : n === "special" ? o(e, r.stroke.brandLightAlt) : n === "secondaryGray" ? o(e, r.stroke.primary) : e === "chip" ? `border: ${t === "2.0" ? 0.5 : 1}px solid ${r.stroke.primary};` : a ? n === "secondary" ? o(
|
|
74
|
+
e,
|
|
75
|
+
d(n, a, i),
|
|
76
|
+
t === "2.0" ? 0.5 : 1
|
|
77
|
+
) : "border: none;" : n === "secondary" ? o(
|
|
78
|
+
e,
|
|
79
|
+
d(n, !1, i),
|
|
80
|
+
t === "2.0" ? 0.5 : 1
|
|
81
|
+
) : "border: none;", u = (t) => t === "medium" ? `5px,
|
|
82
82
|
transparent 5px,
|
|
83
83
|
transparent 10px` : `6px,
|
|
84
84
|
transparent 6px,
|
|
85
|
-
transparent 12px`,
|
|
86
|
-
const e = parseInt(t.replace("#", ""), 16), a = Math.round(2.55 * n),
|
|
87
|
-
return `#${(16777216 + (Math.max(
|
|
88
|
-
},
|
|
89
|
-
const e = parseInt(t.replace("#", ""), 16), a = Math.round(2.55 * n),
|
|
90
|
-
return `#${(16777216 + (Math.min(
|
|
91
|
-
},
|
|
92
|
-
opacity: 0.03;` : "",
|
|
93
|
-
text-decoration-color: ${r.content.brand};`,
|
|
85
|
+
transparent 12px`, w = (t, n) => {
|
|
86
|
+
const e = parseInt(t.replace("#", ""), 16), a = Math.round(2.55 * n), i = (e >> 16) - a, c = (e >> 8 & 255) - a, s = (e & 255) - a;
|
|
87
|
+
return `#${(16777216 + (Math.max(i, 0) << 16) + (Math.max(c, 0) << 8) + Math.max(s, 0)).toString(16).slice(1)}`;
|
|
88
|
+
}, k = (t, n) => {
|
|
89
|
+
const e = parseInt(t.replace("#", ""), 16), a = Math.round(2.55 * n), i = (e >> 16) + a, c = (e >> 8 & 255) + a, s = (e & 255) + a;
|
|
90
|
+
return `#${(16777216 + (Math.min(i, 255) << 16) + (Math.min(c, 255) << 8) + Math.min(s, 255)).toString(16).slice(1)}`;
|
|
91
|
+
}, I = (t, n) => t === "ai" ? `background: ${r.surface.aiLight};` : t === "text" ? "background-color:transparent;" : t === "special" || t === "secondaryGray" ? "" : !n && t !== "primary" ? `background-color: #000000;
|
|
92
|
+
opacity: 0.03;` : "", M = (t, n) => n ? "" : `text-decoration-line: underline;
|
|
93
|
+
text-decoration-color: ${r.content.brand};`, S = (t, n) => n ? "" : t === "primary" ? `background-color: ${r.stroke.warning.lightAlt};` : "background-color: rgba(255, 255, 255, 0.1)", A = (t, n, e) => t === "special" ? `background-color: ${r.background.base}; ${o(
|
|
94
|
+
n,
|
|
95
|
+
r.stroke.primary
|
|
96
|
+
)}` : t === "secondaryGray" ? o(n, r.stroke.primary) : n === "chip" ? "background-color: transparent;" : t === "primary" || t === "destructive" ? e ? "background-color: rgba(255,255,255,0.3);" : `background-color: ${r.background.inactive};` : t === "secondary" ? e ? o(n, "rgba(255, 255, 255, 0.5)") : o(n, r.stroke.primary) : "", R = (t, n, e = d(t, !1)) => `
|
|
94
97
|
.line-top {
|
|
95
98
|
position: absolute;
|
|
96
99
|
left: 0;
|
|
@@ -101,7 +104,7 @@ const m = (t, n, e, a, o) => {
|
|
|
101
104
|
to right,
|
|
102
105
|
${e},
|
|
103
106
|
${e}
|
|
104
|
-
${
|
|
107
|
+
${u(n)}
|
|
105
108
|
);
|
|
106
109
|
}
|
|
107
110
|
.line-right {
|
|
@@ -114,7 +117,7 @@ const m = (t, n, e, a, o) => {
|
|
|
114
117
|
to bottom,
|
|
115
118
|
${e},
|
|
116
119
|
${e}
|
|
117
|
-
${
|
|
120
|
+
${u(n)}
|
|
118
121
|
);
|
|
119
122
|
}
|
|
120
123
|
.line-bottom {
|
|
@@ -127,7 +130,7 @@ const m = (t, n, e, a, o) => {
|
|
|
127
130
|
to right,
|
|
128
131
|
${e},
|
|
129
132
|
${e}
|
|
130
|
-
${
|
|
133
|
+
${u(n)}
|
|
131
134
|
);
|
|
132
135
|
}
|
|
133
136
|
.line-left {
|
|
@@ -140,18 +143,24 @@ const m = (t, n, e, a, o) => {
|
|
|
140
143
|
to bottom,
|
|
141
144
|
${e},
|
|
142
145
|
${e}
|
|
143
|
-
${
|
|
146
|
+
${u(n)}
|
|
144
147
|
);
|
|
145
148
|
}
|
|
146
|
-
`,
|
|
149
|
+
`, D = (t, n, e) => {
|
|
147
150
|
if (t === "text")
|
|
148
151
|
return `background-color: ${r.background.brandLight};
|
|
149
152
|
text-decoration-line: underline;
|
|
150
153
|
text-decoration-color: ${r.content.brand};`;
|
|
151
154
|
if (t === "special")
|
|
152
|
-
return `background-color: ${r.background.brandLight};
|
|
155
|
+
return `background-color: ${r.background.brandLight}; ${o(
|
|
156
|
+
n,
|
|
157
|
+
r.stroke.brandLightAlt
|
|
158
|
+
)}`;
|
|
153
159
|
if (t === "secondaryGray")
|
|
154
|
-
return `background-color: ${r.surface.hovered};
|
|
160
|
+
return `background-color: ${r.surface.hovered}; ${o(
|
|
161
|
+
n,
|
|
162
|
+
r.stroke.primary
|
|
163
|
+
)}`;
|
|
155
164
|
if (n === "chip")
|
|
156
165
|
return `border: 1px solid ${r.stroke.brandLightAlt};
|
|
157
166
|
background-color: ${r.background.brandLight};`;
|
|
@@ -161,13 +170,13 @@ const m = (t, n, e, a, o) => {
|
|
|
161
170
|
` : "box-shadow: inset 0px 4px 12px rgba(0, 0, 0, 0.35);";
|
|
162
171
|
if (t === "secondary" || t === "tertiary" || t === "tertiaryGray" || t.startsWith("dash"))
|
|
163
172
|
return e ? `background-color: ${r.background.inverseLight} !important;` : `background-color: ${r.background.brandLight};`;
|
|
164
|
-
},
|
|
173
|
+
}, H = (t, n, e, a) => t === "special" ? `background-color: ${r.background.brandVeryLight};` : t === "secondaryGray" ? `background-color: ${r.surface.subdued};` : n === "chip" ? `background-color: ${r.background.base};` : t === "primary" ? a ? `background-color: ${k(
|
|
165
174
|
a,
|
|
166
175
|
50
|
|
167
|
-
)};` : `background-color: ${e ? r.background.warning.vibrant : r.background.brandLight};` : t === "destructive" ? `background-color: ${r.background.negative.light};` : "background-color: transparent;",
|
|
176
|
+
)};` : `background-color: ${e ? r.background.warning.vibrant : r.background.brandLight};` : t === "destructive" ? `background-color: ${r.background.negative.light};` : "background-color: transparent;", C = (t, n, e) => t === "special" ? o(n, r.stroke.brandLightAlt) : t === "secondaryGray" ? o(n, r.stroke.primary) : n === "chip" ? "border: none;" : t === "secondary" ? e ? o(n, r.content.secondary) : o(n, r.stroke.brandLightAlt) : "", T = (t, n) => t === "secondaryGray" ? r.content.secondary : n ? t === "primary" ? r.content.primary : r.content.primaryInverse : t === "destructive" ? r.content.negative : r.content.brand, V = (t, n, e, a, i, c) => {
|
|
168
177
|
if (t === "chip")
|
|
169
|
-
return a ? r.content.inactive :
|
|
170
|
-
if (
|
|
178
|
+
return a ? r.content.inactive : c ? r.content.primary : r.content.secondary;
|
|
179
|
+
if (i)
|
|
171
180
|
return "transparent";
|
|
172
181
|
if (n === "special")
|
|
173
182
|
return a ? r.content.inactive : r.background.inverseLight;
|
|
@@ -183,25 +192,26 @@ const m = (t, n, e, a, o) => {
|
|
|
183
192
|
return a ? r.content.inactive : r.content.secondary;
|
|
184
193
|
};
|
|
185
194
|
export {
|
|
186
|
-
|
|
187
|
-
|
|
195
|
+
L as GetButtonTextComponent,
|
|
196
|
+
T as SpinnerColorMap,
|
|
188
197
|
A as generateDisabledStyling,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
198
|
+
S as generateInverseHoverBackground,
|
|
199
|
+
y as getBackgroundColor,
|
|
200
|
+
G as getBorder,
|
|
201
|
+
d as getBorderColor,
|
|
202
|
+
V as getButtonIconColor,
|
|
203
|
+
D as getClickEffect,
|
|
195
204
|
$ as getColor,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
205
|
+
R as getDashedBorderStyling,
|
|
206
|
+
v as getDisabledTextColor,
|
|
207
|
+
I as getHoverButtonBackground,
|
|
208
|
+
w as getHoverButtonBackgroundCustom,
|
|
209
|
+
M as getHoverButtonTextDecorationStyle,
|
|
210
|
+
u as getLinearGradientValue,
|
|
211
|
+
H as getLoadingBackground,
|
|
212
|
+
C as getLoadingBorder,
|
|
213
|
+
k as getLoadingButtonBackgroundCustom,
|
|
214
|
+
B as getPadding,
|
|
215
|
+
o as strokeStyle
|
|
206
216
|
};
|
|
207
217
|
//# sourceMappingURL=themes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.js","sources":["../../../../src/components/button/themes.tsx"],"sourcesContent":["import { COLORS } from '@src/constants/Theme';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tButtonLarge,\n\tButtonLargeAI,\n\tButtonRegular,\n\tButtonRegularAI,\n} from '../TypographyStyle';\nimport { Size, Type } from './model';\n\nexport const getBackgroundColor = (\n\ttype: Type,\n\tsize: Size,\n\tinverse?: boolean,\n\tdarkMode?: boolean,\n\tbuttonColor?: string,\n): string => {\n\tif (type === 'special') return COLORS.background.brandVeryLight;\n\tif (type === 'secondaryGray') return 'transparent';\n\n\tif (size === 'chip') {\n\t\tif (type === 'text') {\n\t\t\treturn 'transparent';\n\t\t}\n\t\treturn darkMode ? COLORS.surface.hovered : COLORS.surface.subdued;\n\t}\n\tswitch (type) {\n\t\tcase 'primary':\n\t\t\treturn buttonColor\n\t\t\t\t? buttonColor\n\t\t\t\t: inverse\n\t\t\t\t? COLORS.background.warning.vibrant\n\t\t\t\t: COLORS.background.inverseLight;\n\t\tcase 'destructive':\n\t\t\treturn COLORS.background.negative.vibrant;\n\t\tcase 'tertiary':\n\t\t\treturn 'transparent';\n\t\tdefault:\n\t\t\treturn 'transparent';\n\t}\n};\n\nexport const getColor = (\n\ttype: Type,\n\tsize: Size,\n\tinverse?: boolean,\n\tdarkMode?: boolean,\n): string => {\n\tif (type === 'special') return COLORS.background.inverseLight;\n\tif (type === 'secondaryGray') return COLORS.content.secondary;\n\n\tif (size === 'chip') {\n\t\tif (type === 'text') {\n\t\t\treturn inverse ? COLORS.content.inactive : COLORS.content.brand;\n\t\t}\n\t\treturn darkMode ? COLORS.content.primary : COLORS.content.secondary;\n\t}\n\tswitch (type) {\n\t\tcase 'primary':\n\t\t\treturn inverse ? COLORS.content.primary : COLORS.content.primaryInverse;\n\t\tcase 'tertiaryGray':\n\t\t\treturn COLORS.content.secondary;\n\t\tcase 'destructive':\n\t\t\treturn COLORS.content.primaryInverse;\n\t\tcase 'dashBold':\n\t\t\treturn COLORS.content.secondary;\n\t\tcase 'dashRegular':\n\t\t\treturn COLORS.content.secondary;\n\t\tcase 'ai':\n\t\t\treturn COLORS.content.ai;\n\t\tdefault:\n\t\t\treturn inverse ? COLORS.content.primaryInverse : COLORS.stroke.brand;\n\t}\n};\n\nexport const getDisabledTextColor = (inverse?: boolean) => {\n\tif (inverse) {\n\t\treturn 'rgba(255, 255, 255, 0.5)';\n\t}\n\treturn COLORS.content.inactive;\n};\n\nexport const getPadding = (type: Type, size: Size) => {\n\tif (type === 'text') {\n\t\treturn '0px';\n\t} else if (size === 'xs') {\n\t\treturn '4px 6px';\n\t} else if (size === 'chip') {\n\t\treturn '4px 8px';\n\t} else if (size === 'small') {\n\t\tswitch (type) {\n\t\t\tcase 'tertiary':\n\t\t\t\treturn '6px 4px';\n\t\t\tcase 'tertiaryGray':\n\t\t\t\treturn '6px 4px';\n\t\t\tdefault:\n\t\t\t\treturn '6px 12px';\n\t\t}\n\t} else if (size === 'medium') {\n\t\tswitch (type) {\n\t\t\tcase 'tertiary':\n\t\t\t\treturn '10px 4px';\n\t\t\tcase 'tertiaryGray':\n\t\t\t\treturn '10px 4px';\n\t\t\tdefault:\n\t\t\t\treturn '10px 12px';\n\t\t}\n\t} else if (size === 'large') {\n\t\tswitch (type) {\n\t\t\tcase 'tertiary':\n\t\t\t\treturn '14px 4px';\n\t\t\tcase 'tertiaryGray':\n\t\t\t\treturn '14px 4px';\n\t\t\tdefault:\n\t\t\t\treturn '14px 12px';\n\t\t}\n\t}\n};\nexport const GetButtonTextComponent = (\n\tsize: Size,\n\ttype: Type,\n\tdisabled?: boolean,\n) => {\n\tif (!disabled && type === 'ai') {\n\t\tif (size === 'small') {\n\t\t\treturn ButtonRegularAI;\n\t\t} else {\n\t\t\treturn ButtonLargeAI;\n\t\t}\n\t}\n\n\tif (type === 'dashRegular') {\n\t\treturn BodySecondary;\n\t}\n\tif (size === 'chip' || size === 'xs') {\n\t\treturn BodyCaption;\n\t} else if (size === 'small') {\n\t\treturn ButtonRegular;\n\t}\n\treturn ButtonLarge;\n};\n\nexport const getBorderColor = (\n\ttype: Type,\n\tinverse?: boolean,\n\terror?: boolean,\n): string => {\n\tif (error) {\n\t\treturn COLORS.stroke.negative.vibrant;\n\t}\n\n\tif (inverse) {\n\t\treturn COLORS.surface.standard;\n\t}\n\tif (type == 'secondary') {\n\t\treturn COLORS.stroke.brand;\n\t}\n\treturn COLORS.content.placeholder;\n};\n\nexport const getBorder = (\n\tversion: '1.0' | '2.0' | '3.0',\n\ttype: Type,\n\tsize: Size,\n\tinverse?: boolean,\n\terror?: boolean,\n): string => {\n\tif (type == 'text') {\n\t\treturn 'border: none;';\n\t}\n\tif (type === 'special') {\n\t\treturn `border: 1px solid ${COLORS.stroke.brandLightAlt};`;\n\t}\n\tif (type === 'secondaryGray') {\n\t\treturn `border: 1px solid ${COLORS.stroke.primary};`;\n\t}\n\tif (size === 'chip') {\n\t\treturn `border: ${version === '2.0' ? 0.5 : 1}px solid ${\n\t\t\tCOLORS.stroke.primary\n\t\t};`;\n\t}\n\tif (inverse) {\n\t\tif (type === 'secondary') {\n\t\t\treturn `border: ${version === '2.0' ? 0.5 : 1}px solid ${getBorderColor(\n\t\t\t\ttype,\n\t\t\t\tinverse,\n\t\t\t\terror,\n\t\t\t)};`;\n\t\t}\n\t\treturn 'border: none;';\n\t}\n\n\tif (type === 'secondary') {\n\t\treturn `border: ${version === '2.0' ? 0.5 : 1}px solid ${getBorderColor(\n\t\t\ttype,\n\t\t\tfalse,\n\t\t\terror,\n\t\t)};`;\n\t}\n\treturn 'border: none;';\n};\n\nexport const getLinearGradientValue = (size: Size): string => {\n\tif (size === 'medium') {\n\t\treturn `5px,\n\t\ttransparent 5px,\n\t\ttransparent 10px`;\n\t}\n\treturn `6px,\n\t\ttransparent 6px,\n\t\ttransparent 12px`;\n};\n\n/**\n * Adjusts the brightness of a given hex color by a specified percentage.\n * Below function is used to generate a hover effect for button backgrounds.\n *\n * @param {string} color - The hex color code to be adjusted (e.g., \"#ff0000\").\n * @param {number} percent - The percentage by which to darken the color. Positive values darken the color.\n * @returns {string} - The adjusted hex color code.\n *\n * @example\n * // Darken the color #ff0000 (red) by 10%\n * const darkerRed = getHoverButtonBackgroundCustom(\"#ff0000\", 10);\n * console.log(darkerRed); // Output might be \"#e60000\"\n */\n\nexport const getHoverButtonBackgroundCustom = (\n\tcolor: string,\n\tpercent: number,\n) => {\n\tconst num = parseInt(color.replace('#', ''), 16),\n\t\tamt = Math.round(2.55 * percent),\n\t\tR = (num >> 16) - amt,\n\t\tG = ((num >> 8) & 0x00ff) - amt,\n\t\tB = (num & 0x0000ff) - amt;\n\n\treturn `#${(\n\t\t0x1000000 +\n\t\t(Math.max(R, 0) << 16) +\n\t\t(Math.max(G, 0) << 8) +\n\t\tMath.max(B, 0)\n\t)\n\t\t.toString(16)\n\t\t.slice(1)}`;\n};\n\n/**\n * Generates a new color by adjusting the brightness of the given color by a specified percentage.\n *\n * @param color - The original color in hexadecimal format (e.g., \"#RRGGBB\").\n * @param percent - The percentage to adjust the brightness. Positive values will lighten the color, while negative values will darken it.\n * @returns The new color in hexadecimal format after adjusting the brightness.\n *\n * @example\n * // Lighten the color by 20%\n * const newColor = getLoadingButtonBackgroundCustom(\"#ff0000\", 20); // \"#ff3333\"\n *\n * @example\n * // Darken the color by 10%\n * const newColor = getLoadingButtonBackgroundCustom(\"#00ff00\", -10); // \"#00e600\"\n */\nexport const getLoadingButtonBackgroundCustom = (\n\tcolor: string,\n\tpercent: number,\n) => {\n\tconst num = parseInt(color.replace('#', ''), 16),\n\t\tamt = Math.round(2.55 * percent),\n\t\tR = (num >> 16) + amt,\n\t\tG = ((num >> 8) & 0x00ff) + amt,\n\t\tB = (num & 0x0000ff) + amt;\n\n\treturn `#${(\n\t\t0x1000000 +\n\t\t(Math.min(R, 255) << 16) +\n\t\t(Math.min(G, 255) << 8) +\n\t\tMath.min(B, 255)\n\t)\n\t\t.toString(16)\n\t\t.slice(1)}`;\n};\n\nexport const getHoverButtonBackground = (type: Type, inverse?: boolean) => {\n\tif (type === 'ai') {\n\t\treturn `background: ${COLORS.surface.aiLight};`;\n\t}\n\n\tif (type === 'text') {\n\t\treturn `background-color:transparent;`;\n\t}\n\tif (type === 'special' || type === 'secondaryGray') {\n\t\treturn '';\n\t}\n\tif (!inverse && type !== 'primary') {\n\t\treturn `background-color: #000000;\n\t\t\t\topacity: 0.03;`;\n\t}\n\n\treturn ``;\n};\n\nexport const getHoverButtonTextDecorationStyle = (\n\ttype: Type,\n\tdisabled?: boolean,\n) => {\n\tif (disabled) {\n\t\treturn '';\n\t}\n\treturn `text-decoration-line: underline;\n\t\t\ttext-decoration-color: ${COLORS.content.brand};`;\n};\n\nexport const generateInverseHoverBackground = (\n\ttype: Type,\n\tdisabled?: boolean,\n) => {\n\tif (disabled) {\n\t\treturn '';\n\t}\n\tif (type === 'primary') {\n\t\treturn `background-color: ${COLORS.stroke.warning.lightAlt};`;\n\t}\n\treturn `background-color: rgba(255, 255, 255, 0.1)`;\n};\n\nexport const generateDisabledStyling = (\n\ttype: Type,\n\tsize: Size,\n\tinverse?: boolean,\n) => {\n\tif (type === 'special') {\n\t\treturn `background-color: ${COLORS.background.base}; border: 1px solid ${COLORS.stroke.primary};`;\n\t}\n\tif (type === 'secondaryGray') {\n\t\treturn `border: 1px solid ${COLORS.stroke.primary};`;\n\t}\n\tif (size === 'chip') {\n\t\treturn `background-color: transparent;`;\n\t}\n\tif (type === 'primary' || type === 'destructive') {\n\t\treturn inverse\n\t\t\t? 'background-color: rgba(255,255,255,0.3);'\n\t\t\t: `background-color: ${COLORS.background.inactive};`;\n\t} else if (type === 'secondary') {\n\t\treturn inverse\n\t\t\t? `border: 1px solid rgba(255, 255, 255, 0.5);`\n\t\t\t: `border: 1px solid ${COLORS.stroke.primary};`;\n\t}\n\treturn '';\n};\n\nexport const getDashedBorderStyling = (\n\ttype: Type,\n\tsize: Size,\n\tborderColor: string = getBorderColor(type, false),\n) => {\n\treturn `\n\t.line-top {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\ttop: 0;\n\t\theight: 1px;\n\t\twidth: 100%;\n\t\tbackground: repeating-linear-gradient(\n\t\t\tto right,\n\t\t\t${borderColor},\n\t\t\t${borderColor}\n\t\t\t\t${getLinearGradientValue(size)}\n\t\t);\n\t}\n\t.line-right {\n\t\tposition: absolute;\n\t\tright: 0;\n\t\ttop: 0;\n\t\twidth: 1px;\n\t\theight: 100%;\n\t\tbackground: repeating-linear-gradient(\n\t\t\tto bottom,\n\t\t\t${borderColor},\n\t\t\t${borderColor}\n\t\t\t\t${getLinearGradientValue(size)}\n\t\t);\n\t}\n\t.line-bottom {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tbottom: 0;\n\t\theight: 1px;\n\t\twidth: 100%;\n\t\tbackground: repeating-linear-gradient(\n\t\t\tto right,\n\t\t\t${borderColor},\n\t\t\t${borderColor}\n\t\t\t\t${getLinearGradientValue(size)}\n\t\t);\n\t}\n\t.line-left {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\ttop: 0;\n\t\twidth: 1px;\n\t\theight: 100%;\n\t\tbackground: repeating-linear-gradient(\n\t\t\tto bottom,\n\t\t\t${borderColor},\n\t\t\t${borderColor}\n\t\t\t\t${getLinearGradientValue(size)}\n\t\t);\n\t}\n\t`;\n};\n\nexport const getClickEffect = (type: Type, size: Size, inverse?: boolean) => {\n\tif (type === 'text') {\n\t\treturn `background-color: ${COLORS.background.brandLight};\n\t\t\ttext-decoration-line: underline;\n\t\t\ttext-decoration-color: ${COLORS.content.brand};`;\n\t}\n\tif (type === 'special') {\n\t\treturn `background-color: ${COLORS.background.brandLight}; border: 1px solid ${COLORS.stroke.brandLightAlt};`;\n\t}\n\tif (type === 'secondaryGray') {\n\t\treturn `background-color: ${COLORS.surface.hovered}; border: 1px solid ${COLORS.stroke.primary};`;\n\t}\n\tif (size === 'chip') {\n\t\treturn `border: 1px solid ${COLORS.stroke.brandLightAlt};\n\t\tbackground-color: ${COLORS.background.brandLight};`;\n\t}\n\tif (type === 'primary' || type === 'destructive') {\n\t\tif (inverse) {\n\t\t\treturn `background-color: ${COLORS.background.warning.vibrant} !important;\n\t\t\tbox-shadow: inset 0px 4px 12px rgba(0, 0, 0, 0.35);\n\t\t\t`;\n\t\t}\n\t\treturn 'box-shadow: inset 0px 4px 12px rgba(0, 0, 0, 0.35);';\n\t} else if (\n\t\ttype === 'secondary' ||\n\t\ttype === 'tertiary' ||\n\t\ttype === 'tertiaryGray' ||\n\t\ttype.startsWith('dash')\n\t) {\n\t\treturn inverse\n\t\t\t? `background-color: ${COLORS.background.inverseLight} !important;`\n\t\t\t: `background-color: ${COLORS.background.brandLight};`;\n\t}\n};\nexport const getLoadingBackground = (\n\ttype: Type,\n\tsize: Size,\n\tinverse?: boolean,\n\tbuttonColor?: string,\n) => {\n\tif (type === 'special') {\n\t\treturn `background-color: ${COLORS.background.brandVeryLight};`;\n\t}\n\tif (type === 'secondaryGray') {\n\t\treturn `background-color: ${COLORS.surface.subdued};`;\n\t}\n\tif (size === 'chip') {\n\t\treturn `background-color: ${COLORS.background.base};`;\n\t}\n\tif (type === 'primary') {\n\t\tif (buttonColor) {\n\t\t\treturn `background-color: ${getLoadingButtonBackgroundCustom(\n\t\t\t\tbuttonColor,\n\t\t\t\t50,\n\t\t\t)};`;\n\t\t}\n\t\treturn `background-color: ${\n\t\t\tinverse ? COLORS.background.warning.vibrant : COLORS.background.brandLight\n\t\t};`;\n\t}\n\tif (type === 'destructive') {\n\t\treturn `background-color: ${COLORS.background.negative.light};`;\n\t}\n\treturn 'background-color: transparent;';\n};\n\nexport const getLoadingBorder = (type: Type, size: Size, inverse?: boolean) => {\n\tif (type === 'special') {\n\t\treturn `border: 1px solid ${COLORS.stroke.brandLightAlt};`;\n\t}\n\tif (type === 'secondaryGray') {\n\t\treturn `border: 1px solid ${COLORS.stroke.primary};`;\n\t}\n\tif (size === 'chip') {\n\t\treturn `border: none;`;\n\t}\n\tif (type === 'secondary') {\n\t\treturn inverse\n\t\t\t? `border: 1px solid ${COLORS.content.secondary};`\n\t\t\t: `border: 1px solid ${COLORS.stroke.brandLightAlt};`;\n\t}\n\treturn '';\n};\n\nexport const SpinnerColorMap = (type: Type, inverse?: boolean) => {\n\tif (type === 'secondaryGray') return COLORS.content.secondary;\n\tif (inverse) {\n\t\tif (type === 'primary') {\n\t\t\treturn COLORS.content.primary;\n\t\t}\n\t\treturn COLORS.content.primaryInverse;\n\t}\n\tif (type === 'destructive') {\n\t\treturn COLORS.content.negative;\n\t}\n\treturn COLORS.content.brand;\n};\n\nexport const getButtonIconColor = (\n\tsize: Size,\n\ttype: Type,\n\tinverse?: boolean,\n\tdisabled?: boolean,\n\tisLoading?: boolean,\n\tdarkMode?: boolean,\n) => {\n\tif (size === 'chip') {\n\t\tif (disabled) {\n\t\t\treturn COLORS.content.inactive;\n\t\t} else if (darkMode) {\n\t\t\treturn COLORS.content.primary;\n\t\t}\n\t\treturn COLORS.content.secondary;\n\t}\n\tif (isLoading) {\n\t\treturn 'transparent';\n\t}\n\tif (type === 'special') {\n\t\treturn disabled ? COLORS.content.inactive : COLORS.background.inverseLight;\n\t}\n\tif (type === 'secondaryGray') {\n\t\treturn disabled ? COLORS.content.inactive : COLORS.content.secondary;\n\t}\n\tif (type === 'primary' || type === 'destructive') {\n\t\tif (inverse) {\n\t\t\tif (disabled) {\n\t\t\t\treturn 'rgba(255, 255, 255, 0.5)';\n\t\t\t}\n\t\t\treturn COLORS.content.primary;\n\t\t}\n\t\tif (disabled) {\n\t\t\treturn COLORS.content.inactive;\n\t\t}\n\t\treturn COLORS.content.primaryInverse;\n\t} else if (type === 'secondary') {\n\t\tif (inverse) {\n\t\t\tif (disabled) {\n\t\t\t\treturn 'rgba(255, 255, 255, 0.5)';\n\t\t\t}\n\t\t\treturn COLORS.content.primaryInverse;\n\t\t}\n\t\tif (disabled) {\n\t\t\treturn COLORS.content.inactive;\n\t\t}\n\t\treturn COLORS.content.brand;\n\t} else if (type === 'tertiary') {\n\t\tif (inverse) {\n\t\t\tif (disabled) {\n\t\t\t\treturn 'rgba(255, 255, 255, 0.5)';\n\t\t\t}\n\t\t\treturn COLORS.content.primaryInverse;\n\t\t}\n\t\tif (disabled) {\n\t\t\treturn COLORS.content.inactive;\n\t\t}\n\t\treturn COLORS.content.brand;\n\t} else if (type === 'tertiaryGray' || type.startsWith('dash')) {\n\t\tif (disabled) {\n\t\t\treturn COLORS.content.inactive;\n\t\t}\n\t\treturn COLORS.content.secondary;\n\t}\n};\n"],"names":["getBackgroundColor","type","size","inverse","darkMode","buttonColor","COLORS","getColor","getDisabledTextColor","getPadding","GetButtonTextComponent","disabled","ButtonRegularAI","ButtonLargeAI","BodySecondary","BodyCaption","ButtonRegular","ButtonLarge","getBorderColor","error","getBorder","version","getLinearGradientValue","getHoverButtonBackgroundCustom","color","percent","num","amt","R","G","B","getLoadingButtonBackgroundCustom","getHoverButtonBackground","getHoverButtonTextDecorationStyle","generateInverseHoverBackground","generateDisabledStyling","getDashedBorderStyling","borderColor","getClickEffect","getLoadingBackground","getLoadingBorder","SpinnerColorMap","getButtonIconColor","isLoading"],"mappings":";;AAWO,MAAMA,IAAqB,CACjCC,GACAC,GACAC,GACAC,GACAC,MACY;AACZ,MAAIJ,MAAS,UAAW,QAAOK,EAAO,WAAW;AACjD,MAAIL,MAAS,gBAAiB,QAAO;AAErC,MAAIC,MAAS;AACZ,WAAID,MAAS,SACL,gBAEDG,IAAWE,EAAO,QAAQ,UAAUA,EAAO,QAAQ;AAE3D,UAAQL,GAAA;AAAA,IACP,KAAK;AACJ,aAAOI,MAEJF,IACAG,EAAO,WAAW,QAAQ,UAC1BA,EAAO,WAAW;AAAA,IACtB,KAAK;AACJ,aAAOA,EAAO,WAAW,SAAS;AAAA,IACnC,KAAK;AACJ,aAAO;AAAA,IACR;AACC,aAAO;AAAA,EAAA;AAEV,GAEaC,IAAW,CACvBN,GACAC,GACAC,GACAC,MACY;AACZ,MAAIH,MAAS,UAAW,QAAOK,EAAO,WAAW;AACjD,MAAIL,MAAS,gBAAiB,QAAOK,EAAO,QAAQ;AAEpD,MAAIJ,MAAS;AACZ,WAAID,MAAS,SACLE,IAAUG,EAAO,QAAQ,WAAWA,EAAO,QAAQ,QAEpDF,IAAWE,EAAO,QAAQ,UAAUA,EAAO,QAAQ;AAE3D,UAAQL,GAAA;AAAA,IACP,KAAK;AACJ,aAAOE,IAAUG,EAAO,QAAQ,UAAUA,EAAO,QAAQ;AAAA,IAC1D,KAAK;AACJ,aAAOA,EAAO,QAAQ;AAAA,IACvB,KAAK;AACJ,aAAOA,EAAO,QAAQ;AAAA,IACvB,KAAK;AACJ,aAAOA,EAAO,QAAQ;AAAA,IACvB,KAAK;AACJ,aAAOA,EAAO,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,SAAS,MAC7C,qBAAqBA,EAAO,OAAO,aAAa,MAE7C,IAGKmC,IAAkB,CAACxC,GAAYE,MACvCF,MAAS,kBAAwBK,EAAO,QAAQ,YAChDH,IACCF,MAAS,YACLK,EAAO,QAAQ,UAEhBA,EAAO,QAAQ,iBAEnBL,MAAS,gBACLK,EAAO,QAAQ,WAEhBA,EAAO,QAAQ,OAGVoC,IAAqB,CACjCxC,GACAD,GACAE,GACAQ,GACAgC,GACAvC,MACI;AACJ,MAAIF,MAAS;AACZ,WAAIS,IACIL,EAAO,QAAQ,WACZF,IACHE,EAAO,QAAQ,UAEhBA,EAAO,QAAQ;AAEvB,MAAIqC;AACH,WAAO;AAER,MAAI1C,MAAS;AACZ,WAAOU,IAAWL,EAAO,QAAQ,WAAWA,EAAO,WAAW;AAE/D,MAAIL,MAAS;AACZ,WAAOU,IAAWL,EAAO,QAAQ,WAAWA,EAAO,QAAQ;AAE5D,MAAIL,MAAS,aAAaA,MAAS;AAClC,WAAIE,IACCQ,IACI,6BAEDL,EAAO,QAAQ,UAEnBK,IACIL,EAAO,QAAQ,WAEhBA,EAAO,QAAQ;AACvB,MAAWL,MAAS;AACnB,WAAIE,IACCQ,IACI,6BAEDL,EAAO,QAAQ,iBAEnBK,IACIL,EAAO,QAAQ,WAEhBA,EAAO,QAAQ;AACvB,MAAWL,MAAS;AACnB,WAAIE,IACCQ,IACI,6BAEDL,EAAO,QAAQ,iBAEnBK,IACIL,EAAO,QAAQ,WAEhBA,EAAO,QAAQ;MACZL,MAAS,kBAAkBA,EAAK,WAAW,MAAM;AAC3D,WAAIU,IACIL,EAAO,QAAQ,WAEhBA,EAAO,QAAQ;AAExB;"}
|
|
1
|
+
{"version":3,"file":"themes.js","sources":["../../../../src/components/button/themes.tsx"],"sourcesContent":["import { COLORS } from '@src/constants/Theme';\nimport {\n\tBodyCaption,\n\tBodySecondary,\n\tButtonLarge,\n\tButtonLargeAI,\n\tButtonRegular,\n\tButtonRegularAI,\n} from '../TypographyStyle';\nimport { Size, Type } from './model';\n\nexport const getBackgroundColor = (\n\ttype: Type,\n\tsize: Size,\n\tinverse?: boolean,\n\tdarkMode?: boolean,\n\tbuttonColor?: string,\n): string => {\n\tif (type === 'special') return COLORS.background.brandVeryLight;\n\tif (type === 'secondaryGray') return 'transparent';\n\n\tif (size === 'chip') {\n\t\tif (type === 'text') {\n\t\t\treturn 'transparent';\n\t\t}\n\t\treturn darkMode ? COLORS.surface.hovered : COLORS.surface.subdued;\n\t}\n\tswitch (type) {\n\t\tcase 'primary':\n\t\t\treturn buttonColor\n\t\t\t\t? buttonColor\n\t\t\t\t: inverse\n\t\t\t\t? COLORS.background.warning.vibrant\n\t\t\t\t: COLORS.background.inverseLight;\n\t\tcase 'destructive':\n\t\t\treturn COLORS.background.negative.vibrant;\n\t\tcase 'tertiary':\n\t\t\treturn 'transparent';\n\t\tdefault:\n\t\t\treturn 'transparent';\n\t}\n};\n\nexport const getColor = (\n\ttype: Type,\n\tsize: Size,\n\tinverse?: boolean,\n\tdarkMode?: boolean,\n): string => {\n\tif (type === 'special') return COLORS.background.inverseLight;\n\tif (type === 'secondaryGray') return COLORS.content.secondary;\n\n\tif (size === 'chip') {\n\t\tif (type === 'text') {\n\t\t\treturn inverse ? COLORS.content.inactive : COLORS.content.brand;\n\t\t}\n\t\treturn darkMode ? COLORS.content.primary : COLORS.content.secondary;\n\t}\n\tswitch (type) {\n\t\tcase 'primary':\n\t\t\treturn inverse ? COLORS.content.primary : COLORS.content.primaryInverse;\n\t\tcase 'tertiaryGray':\n\t\t\treturn COLORS.content.secondary;\n\t\tcase 'destructive':\n\t\t\treturn COLORS.content.primaryInverse;\n\t\tcase 'dashBold':\n\t\t\treturn COLORS.content.secondary;\n\t\tcase 'dashRegular':\n\t\t\treturn COLORS.content.secondary;\n\t\tcase 'ai':\n\t\t\treturn COLORS.content.ai;\n\t\tdefault:\n\t\t\treturn inverse ? COLORS.content.primaryInverse : COLORS.stroke.brand;\n\t}\n};\n\nexport const getDisabledTextColor = (inverse?: boolean) => {\n\tif (inverse) {\n\t\treturn 'rgba(255, 255, 255, 0.5)';\n\t}\n\treturn COLORS.content.inactive;\n};\n\nexport const getPadding = (type: Type, size: Size) => {\n\tif (type === 'text') {\n\t\treturn '0px';\n\t} else if (size === 'xs') {\n\t\treturn '4px 6px';\n\t} else if (size === 'chip') {\n\t\treturn '4px 8px';\n\t} else if (size === 'small') {\n\t\tswitch (type) {\n\t\t\tcase 'tertiary':\n\t\t\t\treturn '6px 4px';\n\t\t\tcase 'tertiaryGray':\n\t\t\t\treturn '6px 4px';\n\t\t\tdefault:\n\t\t\t\treturn '6px 12px';\n\t\t}\n\t} else if (size === 'medium') {\n\t\tswitch (type) {\n\t\t\tcase 'tertiary':\n\t\t\t\treturn '10px 4px';\n\t\t\tcase 'tertiaryGray':\n\t\t\t\treturn '10px 4px';\n\t\t\tdefault:\n\t\t\t\treturn '10px 12px';\n\t\t}\n\t} else if (size === 'large') {\n\t\tswitch (type) {\n\t\t\tcase 'tertiary':\n\t\t\t\treturn '14px 4px';\n\t\t\tcase 'tertiaryGray':\n\t\t\t\treturn '14px 4px';\n\t\t\tdefault:\n\t\t\t\treturn '14px 12px';\n\t\t}\n\t}\n};\nexport const GetButtonTextComponent = (\n\tsize: Size,\n\ttype: Type,\n\tdisabled?: boolean,\n) => {\n\tif (!disabled && type === 'ai') {\n\t\tif (size === 'small') {\n\t\t\treturn ButtonRegularAI;\n\t\t} else {\n\t\t\treturn ButtonLargeAI;\n\t\t}\n\t}\n\n\tif (type === 'dashRegular') {\n\t\treturn BodySecondary;\n\t}\n\tif (size === 'chip' || size === 'xs') {\n\t\treturn BodyCaption;\n\t} else if (size === 'small') {\n\t\treturn ButtonRegular;\n\t}\n\treturn ButtonLarge;\n};\n\nexport const getBorderColor = (\n\ttype: Type,\n\tinverse?: boolean,\n\terror?: boolean,\n): string => {\n\tif (error) {\n\t\treturn COLORS.stroke.negative.vibrant;\n\t}\n\n\tif (inverse) {\n\t\treturn COLORS.surface.standard;\n\t}\n\tif (type == 'secondary') {\n\t\treturn COLORS.stroke.brand;\n\t}\n\treturn COLORS.content.placeholder;\n};\n\nexport const strokeStyle = (size: Size, color: string, width = 1): string =>\n\tsize === 'xs'\n\t\t? `box-shadow: inset 0 0 0 ${width}px ${color}; border: none;`\n\t\t: `border: ${width}px solid ${color};`;\n\nexport const getBorder = (\n\tversion: '1.0' | '2.0' | '3.0',\n\ttype: Type,\n\tsize: Size,\n\tinverse?: boolean,\n\terror?: boolean,\n): string => {\n\tif (type == 'text') {\n\t\treturn 'border: none;';\n\t}\n\tif (type === 'special') {\n\t\treturn strokeStyle(size, COLORS.stroke.brandLightAlt);\n\t}\n\tif (type === 'secondaryGray') {\n\t\treturn strokeStyle(size, COLORS.stroke.primary);\n\t}\n\tif (size === 'chip') {\n\t\treturn `border: ${version === '2.0' ? 0.5 : 1}px solid ${\n\t\t\tCOLORS.stroke.primary\n\t\t};`;\n\t}\n\tif (inverse) {\n\t\tif (type === 'secondary') {\n\t\t\treturn strokeStyle(\n\t\t\t\tsize,\n\t\t\t\tgetBorderColor(type, inverse, error),\n\t\t\t\tversion === '2.0' ? 0.5 : 1,\n\t\t\t);\n\t\t}\n\t\treturn 'border: none;';\n\t}\n\n\tif (type === 'secondary') {\n\t\treturn strokeStyle(\n\t\t\tsize,\n\t\t\tgetBorderColor(type, false, error),\n\t\t\tversion === '2.0' ? 0.5 : 1,\n\t\t);\n\t}\n\treturn 'border: none;';\n};\n\nexport const getLinearGradientValue = (size: Size): string => {\n\tif (size === 'medium') {\n\t\treturn `5px,\n\t\ttransparent 5px,\n\t\ttransparent 10px`;\n\t}\n\treturn `6px,\n\t\ttransparent 6px,\n\t\ttransparent 12px`;\n};\n\n/**\n * Adjusts the brightness of a given hex color by a specified percentage.\n * Below function is used to generate a hover effect for button backgrounds.\n *\n * @param {string} color - The hex color code to be adjusted (e.g., \"#ff0000\").\n * @param {number} percent - The percentage by which to darken the color. Positive values darken the color.\n * @returns {string} - The adjusted hex color code.\n *\n * @example\n * // Darken the color #ff0000 (red) by 10%\n * const darkerRed = getHoverButtonBackgroundCustom(\"#ff0000\", 10);\n * console.log(darkerRed); // Output might be \"#e60000\"\n */\n\nexport const getHoverButtonBackgroundCustom = (\n\tcolor: string,\n\tpercent: number,\n) => {\n\tconst num = parseInt(color.replace('#', ''), 16),\n\t\tamt = Math.round(2.55 * percent),\n\t\tR = (num >> 16) - amt,\n\t\tG = ((num >> 8) & 0x00ff) - amt,\n\t\tB = (num & 0x0000ff) - amt;\n\n\treturn `#${(\n\t\t0x1000000 +\n\t\t(Math.max(R, 0) << 16) +\n\t\t(Math.max(G, 0) << 8) +\n\t\tMath.max(B, 0)\n\t)\n\t\t.toString(16)\n\t\t.slice(1)}`;\n};\n\n/**\n * Generates a new color by adjusting the brightness of the given color by a specified percentage.\n *\n * @param color - The original color in hexadecimal format (e.g., \"#RRGGBB\").\n * @param percent - The percentage to adjust the brightness. Positive values will lighten the color, while negative values will darken it.\n * @returns The new color in hexadecimal format after adjusting the brightness.\n *\n * @example\n * // Lighten the color by 20%\n * const newColor = getLoadingButtonBackgroundCustom(\"#ff0000\", 20); // \"#ff3333\"\n *\n * @example\n * // Darken the color by 10%\n * const newColor = getLoadingButtonBackgroundCustom(\"#00ff00\", -10); // \"#00e600\"\n */\nexport const getLoadingButtonBackgroundCustom = (\n\tcolor: string,\n\tpercent: number,\n) => {\n\tconst num = parseInt(color.replace('#', ''), 16),\n\t\tamt = Math.round(2.55 * percent),\n\t\tR = (num >> 16) + amt,\n\t\tG = ((num >> 8) & 0x00ff) + amt,\n\t\tB = (num & 0x0000ff) + amt;\n\n\treturn `#${(\n\t\t0x1000000 +\n\t\t(Math.min(R, 255) << 16) +\n\t\t(Math.min(G, 255) << 8) +\n\t\tMath.min(B, 255)\n\t)\n\t\t.toString(16)\n\t\t.slice(1)}`;\n};\n\nexport const getHoverButtonBackground = (type: Type, inverse?: boolean) => {\n\tif (type === 'ai') {\n\t\treturn `background: ${COLORS.surface.aiLight};`;\n\t}\n\n\tif (type === 'text') {\n\t\treturn `background-color:transparent;`;\n\t}\n\tif (type === 'special' || type === 'secondaryGray') {\n\t\treturn '';\n\t}\n\tif (!inverse && type !== 'primary') {\n\t\treturn `background-color: #000000;\n\t\t\t\topacity: 0.03;`;\n\t}\n\n\treturn ``;\n};\n\nexport const getHoverButtonTextDecorationStyle = (\n\ttype: Type,\n\tdisabled?: boolean,\n) => {\n\tif (disabled) {\n\t\treturn '';\n\t}\n\treturn `text-decoration-line: underline;\n\t\t\ttext-decoration-color: ${COLORS.content.brand};`;\n};\n\nexport const generateInverseHoverBackground = (\n\ttype: Type,\n\tdisabled?: boolean,\n) => {\n\tif (disabled) {\n\t\treturn '';\n\t}\n\tif (type === 'primary') {\n\t\treturn `background-color: ${COLORS.stroke.warning.lightAlt};`;\n\t}\n\treturn `background-color: rgba(255, 255, 255, 0.1)`;\n};\n\nexport const generateDisabledStyling = (\n\ttype: Type,\n\tsize: Size,\n\tinverse?: boolean,\n) => {\n\tif (type === 'special') {\n\t\treturn `background-color: ${COLORS.background.base}; ${strokeStyle(\n\t\t\tsize,\n\t\t\tCOLORS.stroke.primary,\n\t\t)}`;\n\t}\n\tif (type === 'secondaryGray') {\n\t\treturn strokeStyle(size, COLORS.stroke.primary);\n\t}\n\tif (size === 'chip') {\n\t\treturn `background-color: transparent;`;\n\t}\n\tif (type === 'primary' || type === 'destructive') {\n\t\treturn inverse\n\t\t\t? 'background-color: rgba(255,255,255,0.3);'\n\t\t\t: `background-color: ${COLORS.background.inactive};`;\n\t} else if (type === 'secondary') {\n\t\treturn inverse\n\t\t\t? strokeStyle(size, 'rgba(255, 255, 255, 0.5)')\n\t\t\t: strokeStyle(size, COLORS.stroke.primary);\n\t}\n\treturn '';\n};\n\nexport const getDashedBorderStyling = (\n\ttype: Type,\n\tsize: Size,\n\tborderColor: string = getBorderColor(type, false),\n) => {\n\treturn `\n\t.line-top {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\ttop: 0;\n\t\theight: 1px;\n\t\twidth: 100%;\n\t\tbackground: repeating-linear-gradient(\n\t\t\tto right,\n\t\t\t${borderColor},\n\t\t\t${borderColor}\n\t\t\t\t${getLinearGradientValue(size)}\n\t\t);\n\t}\n\t.line-right {\n\t\tposition: absolute;\n\t\tright: 0;\n\t\ttop: 0;\n\t\twidth: 1px;\n\t\theight: 100%;\n\t\tbackground: repeating-linear-gradient(\n\t\t\tto bottom,\n\t\t\t${borderColor},\n\t\t\t${borderColor}\n\t\t\t\t${getLinearGradientValue(size)}\n\t\t);\n\t}\n\t.line-bottom {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tbottom: 0;\n\t\theight: 1px;\n\t\twidth: 100%;\n\t\tbackground: repeating-linear-gradient(\n\t\t\tto right,\n\t\t\t${borderColor},\n\t\t\t${borderColor}\n\t\t\t\t${getLinearGradientValue(size)}\n\t\t);\n\t}\n\t.line-left {\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\ttop: 0;\n\t\twidth: 1px;\n\t\theight: 100%;\n\t\tbackground: repeating-linear-gradient(\n\t\t\tto bottom,\n\t\t\t${borderColor},\n\t\t\t${borderColor}\n\t\t\t\t${getLinearGradientValue(size)}\n\t\t);\n\t}\n\t`;\n};\n\nexport const getClickEffect = (type: Type, size: Size, inverse?: boolean) => {\n\tif (type === 'text') {\n\t\treturn `background-color: ${COLORS.background.brandLight};\n\t\t\ttext-decoration-line: underline;\n\t\t\ttext-decoration-color: ${COLORS.content.brand};`;\n\t}\n\tif (type === 'special') {\n\t\treturn `background-color: ${COLORS.background.brandLight}; ${strokeStyle(\n\t\t\tsize,\n\t\t\tCOLORS.stroke.brandLightAlt,\n\t\t)}`;\n\t}\n\tif (type === 'secondaryGray') {\n\t\treturn `background-color: ${COLORS.surface.hovered}; ${strokeStyle(\n\t\t\tsize,\n\t\t\tCOLORS.stroke.primary,\n\t\t)}`;\n\t}\n\tif (size === 'chip') {\n\t\treturn `border: 1px solid ${COLORS.stroke.brandLightAlt};\n\t\tbackground-color: ${COLORS.background.brandLight};`;\n\t}\n\tif (type === 'primary' || type === 'destructive') {\n\t\tif (inverse) {\n\t\t\treturn `background-color: ${COLORS.background.warning.vibrant} !important;\n\t\t\tbox-shadow: inset 0px 4px 12px rgba(0, 0, 0, 0.35);\n\t\t\t`;\n\t\t}\n\t\treturn 'box-shadow: inset 0px 4px 12px rgba(0, 0, 0, 0.35);';\n\t} else if (\n\t\ttype === 'secondary' ||\n\t\ttype === 'tertiary' ||\n\t\ttype === 'tertiaryGray' ||\n\t\ttype.startsWith('dash')\n\t) {\n\t\treturn inverse\n\t\t\t? `background-color: ${COLORS.background.inverseLight} !important;`\n\t\t\t: `background-color: ${COLORS.background.brandLight};`;\n\t}\n};\nexport const getLoadingBackground = (\n\ttype: Type,\n\tsize: Size,\n\tinverse?: boolean,\n\tbuttonColor?: string,\n) => {\n\tif (type === 'special') {\n\t\treturn `background-color: ${COLORS.background.brandVeryLight};`;\n\t}\n\tif (type === 'secondaryGray') {\n\t\treturn `background-color: ${COLORS.surface.subdued};`;\n\t}\n\tif (size === 'chip') {\n\t\treturn `background-color: ${COLORS.background.base};`;\n\t}\n\tif (type === 'primary') {\n\t\tif (buttonColor) {\n\t\t\treturn `background-color: ${getLoadingButtonBackgroundCustom(\n\t\t\t\tbuttonColor,\n\t\t\t\t50,\n\t\t\t)};`;\n\t\t}\n\t\treturn `background-color: ${\n\t\t\tinverse ? COLORS.background.warning.vibrant : COLORS.background.brandLight\n\t\t};`;\n\t}\n\tif (type === 'destructive') {\n\t\treturn `background-color: ${COLORS.background.negative.light};`;\n\t}\n\treturn 'background-color: transparent;';\n};\n\nexport const getLoadingBorder = (type: Type, size: Size, inverse?: boolean) => {\n\tif (type === 'special') {\n\t\treturn strokeStyle(size, COLORS.stroke.brandLightAlt);\n\t}\n\tif (type === 'secondaryGray') {\n\t\treturn strokeStyle(size, COLORS.stroke.primary);\n\t}\n\tif (size === 'chip') {\n\t\treturn `border: none;`;\n\t}\n\tif (type === 'secondary') {\n\t\treturn inverse\n\t\t\t? strokeStyle(size, COLORS.content.secondary)\n\t\t\t: strokeStyle(size, COLORS.stroke.brandLightAlt);\n\t}\n\treturn '';\n};\n\nexport const SpinnerColorMap = (type: Type, inverse?: boolean) => {\n\tif (type === 'secondaryGray') return COLORS.content.secondary;\n\tif (inverse) {\n\t\tif (type === 'primary') {\n\t\t\treturn COLORS.content.primary;\n\t\t}\n\t\treturn COLORS.content.primaryInverse;\n\t}\n\tif (type === 'destructive') {\n\t\treturn COLORS.content.negative;\n\t}\n\treturn COLORS.content.brand;\n};\n\nexport const getButtonIconColor = (\n\tsize: Size,\n\ttype: Type,\n\tinverse?: boolean,\n\tdisabled?: boolean,\n\tisLoading?: boolean,\n\tdarkMode?: boolean,\n) => {\n\tif (size === 'chip') {\n\t\tif (disabled) {\n\t\t\treturn COLORS.content.inactive;\n\t\t} else if (darkMode) {\n\t\t\treturn COLORS.content.primary;\n\t\t}\n\t\treturn COLORS.content.secondary;\n\t}\n\tif (isLoading) {\n\t\treturn 'transparent';\n\t}\n\tif (type === 'special') {\n\t\treturn disabled ? COLORS.content.inactive : COLORS.background.inverseLight;\n\t}\n\tif (type === 'secondaryGray') {\n\t\treturn disabled ? COLORS.content.inactive : COLORS.content.secondary;\n\t}\n\tif (type === 'primary' || type === 'destructive') {\n\t\tif (inverse) {\n\t\t\tif (disabled) {\n\t\t\t\treturn 'rgba(255, 255, 255, 0.5)';\n\t\t\t}\n\t\t\treturn COLORS.content.primary;\n\t\t}\n\t\tif (disabled) {\n\t\t\treturn COLORS.content.inactive;\n\t\t}\n\t\treturn COLORS.content.primaryInverse;\n\t} else if (type === 'secondary') {\n\t\tif (inverse) {\n\t\t\tif (disabled) {\n\t\t\t\treturn 'rgba(255, 255, 255, 0.5)';\n\t\t\t}\n\t\t\treturn COLORS.content.primaryInverse;\n\t\t}\n\t\tif (disabled) {\n\t\t\treturn COLORS.content.inactive;\n\t\t}\n\t\treturn COLORS.content.brand;\n\t} else if (type === 'tertiary') {\n\t\tif (inverse) {\n\t\t\tif (disabled) {\n\t\t\t\treturn 'rgba(255, 255, 255, 0.5)';\n\t\t\t}\n\t\t\treturn COLORS.content.primaryInverse;\n\t\t}\n\t\tif (disabled) {\n\t\t\treturn COLORS.content.inactive;\n\t\t}\n\t\treturn COLORS.content.brand;\n\t} else if (type === 'tertiaryGray' || type.startsWith('dash')) {\n\t\tif (disabled) {\n\t\t\treturn COLORS.content.inactive;\n\t\t}\n\t\treturn COLORS.content.secondary;\n\t}\n};\n"],"names":["getBackgroundColor","type","size","inverse","darkMode","buttonColor","COLORS","getColor","getDisabledTextColor","getPadding","GetButtonTextComponent","disabled","ButtonRegularAI","ButtonLargeAI","BodySecondary","BodyCaption","ButtonRegular","ButtonLarge","getBorderColor","error","strokeStyle","color","width","getBorder","version","getLinearGradientValue","getHoverButtonBackgroundCustom","percent","num","amt","R","G","B","getLoadingButtonBackgroundCustom","getHoverButtonBackground","getHoverButtonTextDecorationStyle","generateInverseHoverBackground","generateDisabledStyling","getDashedBorderStyling","borderColor","getClickEffect","getLoadingBackground","getLoadingBorder","SpinnerColorMap","getButtonIconColor","isLoading"],"mappings":";;AAWO,MAAMA,IAAqB,CACjCC,GACAC,GACAC,GACAC,GACAC,MACY;AACZ,MAAIJ,MAAS,UAAW,QAAOK,EAAO,WAAW;AACjD,MAAIL,MAAS,gBAAiB,QAAO;AAErC,MAAIC,MAAS;AACZ,WAAID,MAAS,SACL,gBAEDG,IAAWE,EAAO,QAAQ,UAAUA,EAAO,QAAQ;AAE3D,UAAQL,GAAA;AAAA,IACP,KAAK;AACJ,aAAOI,MAEJF,IACAG,EAAO,WAAW,QAAQ,UAC1BA,EAAO,WAAW;AAAA,IACtB,KAAK;AACJ,aAAOA,EAAO,WAAW,SAAS;AAAA,IACnC,KAAK;AACJ,aAAO;AAAA,IACR;AACC,aAAO;AAAA,EAAA;AAEV,GAEaC,IAAW,CACvBN,GACAC,GACAC,GACAC,MACY;AACZ,MAAIH,MA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ER,MAAI5C,MAAS;AACZ,WAAOU,IAAWL,EAAO,QAAQ,WAAWA,EAAO,WAAW;AAE/D,MAAIL,MAAS;AACZ,WAAOU,IAAWL,EAAO,QAAQ,WAAWA,EAAO,QAAQ;AAE5D,MAAIL,MAAS,aAAaA,MAAS;AAClC,WAAIE,IACCQ,IACI,6BAEDL,EAAO,QAAQ,UAEnBK,IACIL,EAAO,QAAQ,WAEhBA,EAAO,QAAQ;AACvB,MAAWL,MAAS;AACnB,WAAIE,IACCQ,IACI,6BAEDL,EAAO,QAAQ,iBAEnBK,IACIL,EAAO,QAAQ,WAEhBA,EAAO,QAAQ;AACvB,MAAWL,MAAS;AACnB,WAAIE,IACCQ,IACI,6BAEDL,EAAO,QAAQ,iBAEnBK,IACIL,EAAO,QAAQ,WAEhBA,EAAO,QAAQ;MACZL,MAAS,kBAAkBA,EAAK,WAAW,MAAM;AAC3D,WAAIU,IACIL,EAAO,QAAQ,WAEhBA,EAAO,QAAQ;AAExB;"}
|
|
@@ -1,36 +1,43 @@
|
|
|
1
1
|
import { jsx as o, jsxs as S } from "react/jsx-runtime";
|
|
2
2
|
import { useState as f } from "react";
|
|
3
|
-
import
|
|
4
|
-
import { FiveStar as
|
|
5
|
-
import { Form as
|
|
6
|
-
import { ZeroState as
|
|
7
|
-
import { Container as
|
|
8
|
-
import { DropShadow as
|
|
3
|
+
import u from "../../assets/icons/cross.svg.js";
|
|
4
|
+
import { FiveStar as v } from "./components/FiveStar.js";
|
|
5
|
+
import { Form as w } from "./components/Form.js";
|
|
6
|
+
import { ZeroState as x } from "./components/ZeroState.js";
|
|
7
|
+
import { Container as C, CrossIconHolder as b } from "./DashboardReviewPopUp.styled.js";
|
|
8
|
+
import { DropShadow as g } from "../dropShadow/DropShadow.js";
|
|
9
9
|
const R = ({
|
|
10
10
|
onClose: s,
|
|
11
11
|
onSubmit: e,
|
|
12
|
-
quickAnswerOptions:
|
|
13
|
-
titleMap:
|
|
14
|
-
feedbackMap:
|
|
12
|
+
quickAnswerOptions: a,
|
|
13
|
+
titleMap: n,
|
|
14
|
+
feedbackMap: m,
|
|
15
15
|
fullStarSubmitText: p,
|
|
16
|
-
onRatingChange:
|
|
17
|
-
initialText:
|
|
16
|
+
onRatingChange: d,
|
|
17
|
+
initialText: c,
|
|
18
18
|
fiveStar: l
|
|
19
19
|
}) => {
|
|
20
20
|
const [r, h] = f(0);
|
|
21
21
|
function t(i) {
|
|
22
|
-
h(i),
|
|
22
|
+
h(i), d?.(i);
|
|
23
23
|
}
|
|
24
|
-
return /* @__PURE__ */ o(
|
|
25
|
-
/* @__PURE__ */ o(
|
|
24
|
+
return /* @__PURE__ */ o(g, { level: "z2", position: "down", children: /* @__PURE__ */ S(C, { children: [
|
|
25
|
+
/* @__PURE__ */ o(b, { onClick: s, children: /* @__PURE__ */ o(
|
|
26
|
+
u,
|
|
27
|
+
{
|
|
28
|
+
"data-testid": "dashboard-review-popup-close",
|
|
29
|
+
width: 24,
|
|
30
|
+
height: 24
|
|
31
|
+
}
|
|
32
|
+
) }),
|
|
26
33
|
r === 0 ? /* @__PURE__ */ o(
|
|
27
|
-
|
|
34
|
+
x,
|
|
28
35
|
{
|
|
29
36
|
handleStarSelection: t,
|
|
30
|
-
initialText:
|
|
37
|
+
initialText: c
|
|
31
38
|
}
|
|
32
39
|
) : r === 5 ? /* @__PURE__ */ o(
|
|
33
|
-
|
|
40
|
+
v,
|
|
34
41
|
{
|
|
35
42
|
fullStarSubmitText: p,
|
|
36
43
|
onSubmit: e,
|
|
@@ -38,14 +45,14 @@ const R = ({
|
|
|
38
45
|
subtext: l?.subText
|
|
39
46
|
}
|
|
40
47
|
) : /* @__PURE__ */ o(
|
|
41
|
-
|
|
48
|
+
w,
|
|
42
49
|
{
|
|
43
|
-
titleMap:
|
|
44
|
-
feedbackMap:
|
|
50
|
+
titleMap: n,
|
|
51
|
+
feedbackMap: m,
|
|
45
52
|
stars: r,
|
|
46
53
|
onStarChange: t,
|
|
47
54
|
onSubmit: e,
|
|
48
|
-
quickAnswerOptions:
|
|
55
|
+
quickAnswerOptions: a
|
|
49
56
|
}
|
|
50
57
|
)
|
|
51
58
|
] }) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardReviewPopUp.js","sources":["../../../../src/components/dashboard-review-popup/DashboardReviewPopUp.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport CrossIcon from '../../assets/icons/cross.svg';\nimport { DropShadow } from '../dropShadow';\nimport { FiveStar } from './components/FiveStar';\nimport { Form } from './components/Form';\nimport { ZeroState } from './components/ZeroState';\nimport { Container, CrossIconHolder } from './DashboardReviewPopUp.styled';\n\nexport const DashboardReviewPopUp: React.FC<{\n\tonSubmit: (\n\t\tstars: number,\n\t\tquickAnswers?: string[],\n\t\treviewText?: string,\n\t) => void;\n\tonClose: () => void;\n\tquickAnswerOptions?: string[];\n\ttitleMap?: { [key: number]: string };\n\tfeedbackMap?: { [key: number]: string };\n\tfullStarSubmitText: string;\n\tonRatingChange?: (stars: number) => void;\n\tinitialText?: string;\n\tfiveStar?: { subText: string };\n}> = ({\n\tonClose,\n\tonSubmit,\n\tquickAnswerOptions,\n\ttitleMap,\n\tfeedbackMap,\n\tfullStarSubmitText,\n\tonRatingChange,\n\tinitialText,\n\tfiveStar,\n}) => {\n\tconst [starsSelected, setStartsSelected] = useState<number>(0);\n\n\tfunction handleStarSelection(stars: number) {\n\t\tsetStartsSelected(stars);\n\t\tonRatingChange?.(stars);\n\t}\n\n\treturn (\n\t\t<DropShadow level={'z2'} position={'down'}>\n\t\t\t<Container>\n\t\t\t\t<CrossIconHolder onClick={onClose}>\n\t\t\t\t\t<CrossIcon
|
|
1
|
+
{"version":3,"file":"DashboardReviewPopUp.js","sources":["../../../../src/components/dashboard-review-popup/DashboardReviewPopUp.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport CrossIcon from '../../assets/icons/cross.svg';\nimport { DropShadow } from '../dropShadow';\nimport { FiveStar } from './components/FiveStar';\nimport { Form } from './components/Form';\nimport { ZeroState } from './components/ZeroState';\nimport { Container, CrossIconHolder } from './DashboardReviewPopUp.styled';\n\nexport const DashboardReviewPopUp: React.FC<{\n\tonSubmit: (\n\t\tstars: number,\n\t\tquickAnswers?: string[],\n\t\treviewText?: string,\n\t) => void;\n\tonClose: () => void;\n\tquickAnswerOptions?: string[];\n\ttitleMap?: { [key: number]: string };\n\tfeedbackMap?: { [key: number]: string };\n\tfullStarSubmitText: string;\n\tonRatingChange?: (stars: number) => void;\n\tinitialText?: string;\n\tfiveStar?: { subText: string };\n}> = ({\n\tonClose,\n\tonSubmit,\n\tquickAnswerOptions,\n\ttitleMap,\n\tfeedbackMap,\n\tfullStarSubmitText,\n\tonRatingChange,\n\tinitialText,\n\tfiveStar,\n}) => {\n\tconst [starsSelected, setStartsSelected] = useState<number>(0);\n\n\tfunction handleStarSelection(stars: number) {\n\t\tsetStartsSelected(stars);\n\t\tonRatingChange?.(stars);\n\t}\n\n\treturn (\n\t\t<DropShadow level={'z2'} position={'down'}>\n\t\t\t<Container>\n\t\t\t\t<CrossIconHolder onClick={onClose}>\n\t\t\t\t\t<CrossIcon\n\t\t\t\t\t\tdata-testid=\"dashboard-review-popup-close\"\n\t\t\t\t\t\twidth={24}\n\t\t\t\t\t\theight={24}\n\t\t\t\t\t/>\n\t\t\t\t</CrossIconHolder>\n\t\t\t\t{starsSelected === 0 ? (\n\t\t\t\t\t<ZeroState\n\t\t\t\t\t\thandleStarSelection={handleStarSelection}\n\t\t\t\t\t\tinitialText={initialText}\n\t\t\t\t\t/>\n\t\t\t\t) : starsSelected === 5 ? (\n\t\t\t\t\t<FiveStar\n\t\t\t\t\t\tfullStarSubmitText={fullStarSubmitText}\n\t\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\t\thandleStarSelection={handleStarSelection}\n\t\t\t\t\t\tsubtext={fiveStar?.subText}\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<Form\n\t\t\t\t\t\ttitleMap={titleMap}\n\t\t\t\t\t\tfeedbackMap={feedbackMap}\n\t\t\t\t\t\tstars={starsSelected}\n\t\t\t\t\t\tonStarChange={handleStarSelection}\n\t\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\t\tquickAnswerOptions={quickAnswerOptions}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Container>\n\t\t</DropShadow>\n\t);\n};\n"],"names":["DashboardReviewPopUp","onClose","onSubmit","quickAnswerOptions","titleMap","feedbackMap","fullStarSubmitText","onRatingChange","initialText","fiveStar","starsSelected","setStartsSelected","useState","handleStarSelection","stars","DropShadow","Container","jsx","CrossIconHolder","CrossIcon","ZeroState","FiveStar","Form"],"mappings":";;;;;;;;AAQO,MAAMA,IAcR,CAAC;AAAA,EACL,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AACD,MAAM;AACL,QAAM,CAACC,GAAeC,CAAiB,IAAIC,EAAiB,CAAC;AAE7D,WAASC,EAAoBC,GAAe;AAC3C,IAAAH,EAAkBG,CAAK,GACvBP,IAAiBO,CAAK;AAAA,EACvB;AAEA,2BACEC,GAAA,EAAW,OAAO,MAAM,UAAU,QAClC,4BAACC,GAAA,EACA,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAgB,SAASjB,GACzB,UAAA,gBAAAgB;AAAA,MAACE;AAAAA,MAAA;AAAA,QACA,eAAY;AAAA,QACZ,OAAO;AAAA,QACP,QAAQ;AAAA,MAAA;AAAA,IAAA,GAEV;AAAA,IACCT,MAAkB,IAClB,gBAAAO;AAAA,MAACG;AAAA,MAAA;AAAA,QACA,qBAAAP;AAAA,QACA,aAAAL;AAAA,MAAA;AAAA,IAAA,IAEEE,MAAkB,IACrB,gBAAAO;AAAA,MAACI;AAAA,MAAA;AAAA,QACA,oBAAAf;AAAA,QACA,UAAAJ;AAAA,QACA,qBAAAW;AAAA,QACA,SAASJ,GAAU;AAAA,MAAA;AAAA,IAAA,IAGpB,gBAAAQ;AAAA,MAACK;AAAA,MAAA;AAAA,QACA,UAAAlB;AAAA,QACA,aAAAC;AAAA,QACA,OAAOK;AAAA,QACP,cAAcG;AAAA,QACd,UAAAX;AAAA,QACA,oBAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACD,EAAA,CAEF,EAAA,CACD;AAEF;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { DropdownPopover as
|
|
2
|
+
import { DropdownPopover as a } from "../dropdown/DropdownPopover/index.js";
|
|
3
3
|
import { SpinnerColorMap as p } from "../button/themes.js";
|
|
4
|
-
import { DropdownButtonStyle as
|
|
4
|
+
import { DropdownButtonStyle as u, LoaderContainer as m } from "./DropdownButton.style.js";
|
|
5
5
|
import { IconButton as l } from "../icon-button/IconButton.js";
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
import { Spinner as
|
|
6
|
+
import { Tooltip as x } from "../tooltips/Tooltip.js";
|
|
7
|
+
import { Spinner as y } from "../spinner/Spinner.js";
|
|
8
8
|
import { Button as b } from "../button/Button.js";
|
|
9
9
|
const S = (o) => {
|
|
10
10
|
const e = !!o.iconButtonProps, r = e ? o.iconButtonProps?.disabled : o.buttonProps?.disabled;
|
|
@@ -21,7 +21,7 @@ const S = (o) => {
|
|
|
21
21
|
}
|
|
22
22
|
);
|
|
23
23
|
return /* @__PURE__ */ s(
|
|
24
|
-
|
|
24
|
+
u,
|
|
25
25
|
{
|
|
26
26
|
type: void 0,
|
|
27
27
|
disabled: r,
|
|
@@ -30,7 +30,7 @@ const S = (o) => {
|
|
|
30
30
|
iconButtonSize: n?.size ?? "default",
|
|
31
31
|
children: [
|
|
32
32
|
i ? /* @__PURE__ */ t(
|
|
33
|
-
|
|
33
|
+
x,
|
|
34
34
|
{
|
|
35
35
|
body: i.body,
|
|
36
36
|
tooltipContent: i.tooltipContent,
|
|
@@ -39,7 +39,7 @@ const S = (o) => {
|
|
|
39
39
|
}
|
|
40
40
|
) : d,
|
|
41
41
|
/* @__PURE__ */ t("div", { className: "dd-button-divider" }),
|
|
42
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ t(
|
|
42
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ t(a, { ...o.dropdownProps, isChildLoading: !1, children: /* @__PURE__ */ t(
|
|
43
43
|
l,
|
|
44
44
|
{
|
|
45
45
|
Icon: o.iconProps,
|
|
@@ -63,18 +63,18 @@ const S = (o) => {
|
|
|
63
63
|
LeadingIcon: B,
|
|
64
64
|
LeadingIconStyles: f,
|
|
65
65
|
IconComponent: R,
|
|
66
|
-
TrailingIcon:
|
|
66
|
+
TrailingIcon: h,
|
|
67
67
|
...c
|
|
68
68
|
} = o.buttonProps;
|
|
69
69
|
return /* @__PURE__ */ s(
|
|
70
|
-
|
|
70
|
+
u,
|
|
71
71
|
{
|
|
72
72
|
type: o.buttonProps.buttonType,
|
|
73
73
|
disabled: o.buttonProps.disabled,
|
|
74
74
|
size: o.buttonProps.size,
|
|
75
75
|
children: [
|
|
76
76
|
o.buttonProps?.isLoading && /* @__PURE__ */ t(m, { type: o.buttonProps.buttonType, children: /* @__PURE__ */ t(
|
|
77
|
-
|
|
77
|
+
y,
|
|
78
78
|
{
|
|
79
79
|
className: "spinner",
|
|
80
80
|
size: "small",
|
|
@@ -94,13 +94,13 @@ const S = (o) => {
|
|
|
94
94
|
borderTopLeftRadius: "4px",
|
|
95
95
|
borderBottomLeftRadius: "4px",
|
|
96
96
|
borderRight: "0px",
|
|
97
|
-
...o.buttonProps?.size === "xs" ? { border: "none", borderRadius: "0px" } : {}
|
|
97
|
+
...o.buttonProps?.size === "xs" ? { border: "none", boxShadow: "none", borderRadius: "0px" } : {}
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
),
|
|
101
101
|
/* @__PURE__ */ t("div", { className: "dd-button-divider" }),
|
|
102
102
|
/* @__PURE__ */ t(
|
|
103
|
-
|
|
103
|
+
a,
|
|
104
104
|
{
|
|
105
105
|
...o.dropdownProps,
|
|
106
106
|
isChildLoading: o.buttonProps?.isLoading,
|
|
@@ -115,7 +115,7 @@ const S = (o) => {
|
|
|
115
115
|
borderRadius: "0px",
|
|
116
116
|
borderTopRightRadius: "4px",
|
|
117
117
|
borderBottomRightRadius: "4px",
|
|
118
|
-
...o.buttonProps?.size === "xs" ? { border: "none", borderRadius: "0px" } : {}
|
|
118
|
+
...o.buttonProps?.size === "xs" ? { border: "none", boxShadow: "none", borderRadius: "0px" } : {}
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownButton.js","sources":["../../../../src/components/dropdown-button/DropdownButton.tsx"],"sourcesContent":["import React from 'react';\nimport { DropdownPopover, DropdownProps } from '@src/components/dropdown';\nimport { Button } from '../button';\nimport { ButtonProps } from '../button/model';\nimport { SpinnerColorMap } from '../button/themes';\nimport { IconButton } from '../icon-button';\nimport { IconButtonProps } from '../icon-button/model';\nimport { Spinner } from '../spinner';\nimport { Placement, Tooltip } from '../tooltips';\nimport { DropdownButtonStyle, LoaderContainer } from './DropdownButton.style';\n\nexport interface DropdownButtonProps {\n\tdropdownProps: DropdownProps;\n\ticonProps: React.FunctionComponent<React.SVGAttributes<SVGElement>>;\n\tbuttonProps?: ButtonProps;\n\ticonButtonProps?: IconButtonProps;\n\t/**\n\t * Optional tooltip shown only on the main icon button (icon mode),\n\t * not on the dropdown/chevron trigger.\n\t */\n\ticonButtonTooltip?: {\n\t\tbody?: string;\n\t\ttooltipContent?: JSX.Element;\n\t\tplacement?: Placement;\n\t};\n}\n\nexport const DropdownButton: React.FC<DropdownButtonProps> = (props) => {\n\tconst isIconMode = !!props.iconButtonProps;\n\tconst disabled = isIconMode\n\t\t? props.iconButtonProps?.disabled\n\t\t: props.buttonProps?.disabled;\n\n\tif (isIconMode) {\n\t\tconst { iconButtonProps, iconButtonTooltip } = props;\n\t\tconst iconButton = (\n\t\t\t<IconButton\n\t\t\t\t{...iconButtonProps!}\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\tborderTopLeftRadius: '4px',\n\t\t\t\t\tborderBottomLeftRadius: '4px',\n\t\t\t\t}}\n\t\t\t/>\n\t\t);\n\t\treturn (\n\t\t\t<DropdownButtonStyle\n\t\t\t\ttype={undefined}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisIconButton\n\t\t\t\ticonButtonType={iconButtonProps?.iconButtonType ?? 'primary'}\n\t\t\t\ticonButtonSize={iconButtonProps?.size ?? 'default'}\n\t\t\t>\n\t\t\t\t{iconButtonTooltip ? (\n\t\t\t\t\t<Tooltip\n\t\t\t\t\t\tbody={iconButtonTooltip.body}\n\t\t\t\t\t\ttooltipContent={iconButtonTooltip.tooltipContent}\n\t\t\t\t\t\tplacement={iconButtonTooltip.placement}\n\t\t\t\t\t>\n\t\t\t\t\t\t{iconButton}\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) : (\n\t\t\t\t\ticonButton\n\t\t\t\t)}\n\t\t\t\t<div className=\"dd-button-divider\"></div>\n\t\t\t\t<div style={{ display: 'flex', alignItems: 'center' }}>\n\t\t\t\t\t<DropdownPopover {...props.dropdownProps} isChildLoading={false}>\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\tIcon={props.iconProps}\n\t\t\t\t\t\t\ticonButtonType={iconButtonProps?.iconButtonType ?? 'primary'}\n\t\t\t\t\t\t\tsize={iconButtonProps?.size}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\t\t\t\tborderTopRightRadius: '4px',\n\t\t\t\t\t\t\t\tborderBottomRightRadius: '4px',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</DropdownPopover>\n\t\t\t\t</div>\n\t\t\t</DropdownButtonStyle>\n\t\t);\n\t}\n\n\tconst {\n\t\tonClick,\n\t\tLeadingIcon,\n\t\tLeadingIconStyles,\n\t\tIconComponent,\n\t\tTrailingIcon,\n\t\t...childButtonProps\n\t} = props.buttonProps!;\n\n\treturn (\n\t\t<DropdownButtonStyle\n\t\t\ttype={props.buttonProps!.buttonType}\n\t\t\tdisabled={props.buttonProps!.disabled}\n\t\t\tsize={props.buttonProps!.size}\n\t\t>\n\t\t\t{props.buttonProps?.isLoading && (\n\t\t\t\t<LoaderContainer type={props.buttonProps.buttonType}>\n\t\t\t\t\t<Spinner\n\t\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tcolor={SpinnerColorMap(\n\t\t\t\t\t\t\tprops.buttonProps.buttonType || 'primary',\n\t\t\t\t\t\t\tprops.buttonProps.inverse,\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t</LoaderContainer>\n\t\t\t)}\n\n\t\t\t<Button\n\t\t\t\t{...props.buttonProps!}\n\t\t\t\tisLoading={false}\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\tborderTopLeftRadius: '4px',\n\t\t\t\t\tborderBottomLeftRadius: '4px',\n\t\t\t\t\tborderRight: '0px',\n\t\t\t\t\t...(props.buttonProps?.size === 'xs'\n\t\t\t\t\t\t? { border: 'none', borderRadius: '0px' }\n\t\t\t\t\t\t: {}),\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t<div className=\"dd-button-divider\"></div>\n\t\t\t<DropdownPopover\n\t\t\t\t{...props.dropdownProps}\n\t\t\t\tisChildLoading={props.buttonProps?.isLoading}\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\t{...childButtonProps}\n\t\t\t\t\tisLoading={false}\n\t\t\t\t\tbuttonText={''}\n\t\t\t\t\tTrailingIcon={props.iconProps}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\t\tborderTopRightRadius: '4px',\n\t\t\t\t\t\tborderBottomRightRadius: '4px',\n\t\t\t\t\t\t...(props.buttonProps?.size === 'xs'\n\t\t\t\t\t\t\t? { border: 'none', borderRadius: '0px' }\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</DropdownPopover>\n\t\t</DropdownButtonStyle>\n\t);\n};\n"],"names":["DropdownButton","props","isIconMode","disabled","iconButtonProps","iconButtonTooltip","iconButton","jsx","IconButton","jsxs","DropdownButtonStyle","Tooltip","DropdownPopover","onClick","LeadingIcon","LeadingIconStyles","IconComponent","TrailingIcon","childButtonProps","LoaderContainer","Spinner","SpinnerColorMap","Button"],"mappings":";;;;;;;;AA2BO,MAAMA,IAAgD,CAACC,MAAU;AACvE,QAAMC,IAAa,CAAC,CAACD,EAAM,iBACrBE,IAAWD,IACdD,EAAM,iBAAiB,WACvBA,EAAM,aAAa;AAEtB,MAAIC,GAAY;AACf,UAAM,EAAE,iBAAAE,GAAiB,mBAAAC,EAAA,IAAsBJ,GACzCK,IACL,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,GAAGJ;AAAA,QACJ,OAAO;AAAA,UACN,cAAc;AAAA,UACd,qBAAqB;AAAA,UACrB,wBAAwB;AAAA,QAAA;AAAA,MACzB;AAAA,IAAA;AAGF,WACC,gBAAAK;AAAA,MAACC;AAAA,MAAA;AAAA,QACA,MAAM;AAAA,QACN,UAAAP;AAAA,QACA,cAAY;AAAA,QACZ,gBAAgBC,GAAiB,kBAAkB;AAAA,QACnD,gBAAgBA,GAAiB,QAAQ;AAAA,QAExC,UAAA;AAAA,UAAAC,IACA,gBAAAE;AAAA,YAACI;AAAA,YAAA;AAAA,cACA,MAAMN,EAAkB;AAAA,cACxB,g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ACe;AAAA,UAAA;AAAA,YACC,GAAGrB,EAAM;AAAA,YACV,WAAW;AAAA,YACX,OAAO;AAAA,cACN,cAAc;AAAA,cACd,qBAAqB;AAAA,cACrB,wBAAwB;AAAA,cACxB,aAAa;AAAA,cACb,GAAIA,EAAM,aAAa,SAAS,OAC7B,EAAE,QAAQ,QAAQ,cAAc,
|
|
1
|
+
{"version":3,"file":"DropdownButton.js","sources":["../../../../src/components/dropdown-button/DropdownButton.tsx"],"sourcesContent":["import React from 'react';\nimport { DropdownPopover, DropdownProps } from '@src/components/dropdown';\nimport { Button } from '../button';\nimport { ButtonProps } from '../button/model';\nimport { SpinnerColorMap } from '../button/themes';\nimport { IconButton } from '../icon-button';\nimport { IconButtonProps } from '../icon-button/model';\nimport { Spinner } from '../spinner';\nimport { Placement, Tooltip } from '../tooltips';\nimport { DropdownButtonStyle, LoaderContainer } from './DropdownButton.style';\n\nexport interface DropdownButtonProps {\n\tdropdownProps: DropdownProps;\n\ticonProps: React.FunctionComponent<React.SVGAttributes<SVGElement>>;\n\tbuttonProps?: ButtonProps;\n\ticonButtonProps?: IconButtonProps;\n\t/**\n\t * Optional tooltip shown only on the main icon button (icon mode),\n\t * not on the dropdown/chevron trigger.\n\t */\n\ticonButtonTooltip?: {\n\t\tbody?: string;\n\t\ttooltipContent?: JSX.Element;\n\t\tplacement?: Placement;\n\t};\n}\n\nexport const DropdownButton: React.FC<DropdownButtonProps> = (props) => {\n\tconst isIconMode = !!props.iconButtonProps;\n\tconst disabled = isIconMode\n\t\t? props.iconButtonProps?.disabled\n\t\t: props.buttonProps?.disabled;\n\n\tif (isIconMode) {\n\t\tconst { iconButtonProps, iconButtonTooltip } = props;\n\t\tconst iconButton = (\n\t\t\t<IconButton\n\t\t\t\t{...iconButtonProps!}\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\tborderTopLeftRadius: '4px',\n\t\t\t\t\tborderBottomLeftRadius: '4px',\n\t\t\t\t}}\n\t\t\t/>\n\t\t);\n\t\treturn (\n\t\t\t<DropdownButtonStyle\n\t\t\t\ttype={undefined}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisIconButton\n\t\t\t\ticonButtonType={iconButtonProps?.iconButtonType ?? 'primary'}\n\t\t\t\ticonButtonSize={iconButtonProps?.size ?? 'default'}\n\t\t\t>\n\t\t\t\t{iconButtonTooltip ? (\n\t\t\t\t\t<Tooltip\n\t\t\t\t\t\tbody={iconButtonTooltip.body}\n\t\t\t\t\t\ttooltipContent={iconButtonTooltip.tooltipContent}\n\t\t\t\t\t\tplacement={iconButtonTooltip.placement}\n\t\t\t\t\t>\n\t\t\t\t\t\t{iconButton}\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) : (\n\t\t\t\t\ticonButton\n\t\t\t\t)}\n\t\t\t\t<div className=\"dd-button-divider\"></div>\n\t\t\t\t<div style={{ display: 'flex', alignItems: 'center' }}>\n\t\t\t\t\t<DropdownPopover {...props.dropdownProps} isChildLoading={false}>\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\tIcon={props.iconProps}\n\t\t\t\t\t\t\ticonButtonType={iconButtonProps?.iconButtonType ?? 'primary'}\n\t\t\t\t\t\t\tsize={iconButtonProps?.size}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\t\t\t\tborderTopRightRadius: '4px',\n\t\t\t\t\t\t\t\tborderBottomRightRadius: '4px',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</DropdownPopover>\n\t\t\t\t</div>\n\t\t\t</DropdownButtonStyle>\n\t\t);\n\t}\n\n\tconst {\n\t\tonClick,\n\t\tLeadingIcon,\n\t\tLeadingIconStyles,\n\t\tIconComponent,\n\t\tTrailingIcon,\n\t\t...childButtonProps\n\t} = props.buttonProps!;\n\n\treturn (\n\t\t<DropdownButtonStyle\n\t\t\ttype={props.buttonProps!.buttonType}\n\t\t\tdisabled={props.buttonProps!.disabled}\n\t\t\tsize={props.buttonProps!.size}\n\t\t>\n\t\t\t{props.buttonProps?.isLoading && (\n\t\t\t\t<LoaderContainer type={props.buttonProps.buttonType}>\n\t\t\t\t\t<Spinner\n\t\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tcolor={SpinnerColorMap(\n\t\t\t\t\t\t\tprops.buttonProps.buttonType || 'primary',\n\t\t\t\t\t\t\tprops.buttonProps.inverse,\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t</LoaderContainer>\n\t\t\t)}\n\n\t\t\t<Button\n\t\t\t\t{...props.buttonProps!}\n\t\t\t\tisLoading={false}\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\tborderTopLeftRadius: '4px',\n\t\t\t\t\tborderBottomLeftRadius: '4px',\n\t\t\t\t\tborderRight: '0px',\n\t\t\t\t\t...(props.buttonProps?.size === 'xs'\n\t\t\t\t\t\t? { border: 'none', boxShadow: 'none', borderRadius: '0px' }\n\t\t\t\t\t\t: {}),\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t<div className=\"dd-button-divider\"></div>\n\t\t\t<DropdownPopover\n\t\t\t\t{...props.dropdownProps}\n\t\t\t\tisChildLoading={props.buttonProps?.isLoading}\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\t{...childButtonProps}\n\t\t\t\t\tisLoading={false}\n\t\t\t\t\tbuttonText={''}\n\t\t\t\t\tTrailingIcon={props.iconProps}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\t\tborderTopRightRadius: '4px',\n\t\t\t\t\t\tborderBottomRightRadius: '4px',\n\t\t\t\t\t\t...(props.buttonProps?.size === 'xs'\n\t\t\t\t\t\t\t? { border: 'none', boxShadow: 'none', borderRadius: '0px' }\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</DropdownPopover>\n\t\t</DropdownButtonStyle>\n\t);\n};\n"],"names":["DropdownButton","props","isIconMode","disabled","iconButtonProps","iconButtonTooltip","iconButton","jsx","IconButton","jsxs","DropdownButtonStyle","Tooltip","DropdownPopover","onClick","LeadingIcon","LeadingIconStyles","IconComponent","TrailingIcon","childButtonProps","LoaderContainer","Spinner","SpinnerColorMap","Button"],"mappings":";;;;;;;;AA2BO,MAAMA,IAAgD,CAACC,MAAU;AACvE,QAAMC,IAAa,CAAC,CAACD,EAAM,iBACrBE,IAAWD,IACdD,EAAM,iBAAiB,WACvBA,EAAM,aAAa;AAEtB,MAAIC,GAAY;AACf,UAAM,EAAE,iBAAAE,GAAiB,mBAAAC,EAAA,IAAsBJ,GACzCK,IACL,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,GAAGJ;AAAA,QACJ,OAAO;AAAA,UACN,cAAc;AAAA,UACd,qBAAqB;AAAA,UACrB,wBAAwB;AAAA,QAAA;AAAA,MACzB;AAAA,IAAA;AAGF,WACC,gBAAAK;AAAA,MAACC;AAAA,MAAA;AAAA,QACA,MAAM;AAAA,QACN,UAAAP;AAAA,QACA,cAAY;AAAA,QACZ,gBAAgBC,GAAiB,kBAAkB;AAAA,QACnD,gBAAgBA,GAAiB,QAAQ;AAAA,QAExC,UAAA;AAAA,UAAAC,IACA,gBAAAE;AAAA,YAACI;AAAA,YAAA;AAAA,cACA,MAAMN,EAAkB;AAAA,cACxB,gBAAgBA,EAAkB;AAAA,cAClC,WAAWA,EAAkB;AAAA,cAE5B,UAAAC;AAAA,YAAA;AAAA,UAAA,IAGFA;AAAA,UAED,gBAAAC,EAAC,OAAA,EAAI,WAAU,oBAAA,CAAoB;AAAA,UACnC,gBAAAA,EAAC,OAAA,EAAI,OAAO,EAAE,SAAS,QAAQ,YAAY,SAAA,GAC1C,4BAACK,GAAA,EAAiB,GAAGX,EAAM,eAAe,gB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