@bikdotai/bik-component-library 0.0.835 → 0.0.836-beta.0
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/button/Button.styled.js +8 -0
- package/dist/cjs/components/button/Button.styled.js.map +1 -1
- package/dist/cjs/components/button/themes.js +3 -3
- package/dist/cjs/components/button/themes.js.map +1 -1
- package/dist/cjs/components/checkBox/CheckBox.js +1 -1
- package/dist/cjs/components/checkBox/CheckBox.js.map +1 -1
- package/dist/cjs/components/checkBox/CheckBox.styled.js +10 -10
- package/dist/cjs/components/checkBox/CheckBox.styled.js.map +1 -1
- package/dist/cjs/components/whats-new/WhatsNew.js +1 -1
- package/dist/cjs/components/whats-new/WhatsNew.js.map +1 -1
- package/dist/cjs/components/whats-new/WhatsNewButton.js +2 -2
- package/dist/cjs/components/whats-new/WhatsNewButton.js.map +1 -1
- package/dist/esm/components/button/Button.styled.js +18 -10
- package/dist/esm/components/button/Button.styled.js.map +1 -1
- package/dist/esm/components/button/themes.d.ts +1 -1
- package/dist/esm/components/button/themes.js +1 -1
- package/dist/esm/components/button/themes.js.map +1 -1
- package/dist/esm/components/checkBox/CheckBox.js +17 -16
- package/dist/esm/components/checkBox/CheckBox.js.map +1 -1
- package/dist/esm/components/checkBox/CheckBox.styled.d.ts +1 -0
- package/dist/esm/components/checkBox/CheckBox.styled.js +9 -9
- package/dist/esm/components/checkBox/CheckBox.styled.js.map +1 -1
- package/dist/esm/components/whats-new/WhatsNew.d.ts +2 -0
- package/dist/esm/components/whats-new/WhatsNew.js +19 -17
- package/dist/esm/components/whats-new/WhatsNew.js.map +1 -1
- package/dist/esm/components/whats-new/WhatsNew.types.d.ts +2 -0
- package/dist/esm/components/whats-new/WhatsNewButton.js +37 -32
- package/dist/esm/components/whats-new/WhatsNewButton.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { COLORS as
|
|
3
|
-
import { WhatsNewIconContainer as
|
|
4
|
-
import { Tooltip as
|
|
5
|
-
import { IconButton as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
onClick:
|
|
1
|
+
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { COLORS as a } from "../../constants/Theme.js";
|
|
3
|
+
import { WhatsNewIconContainer as x } from "./WhatsNew.styles.js";
|
|
4
|
+
import { Tooltip as y } from "../tooltips/Tooltip.js";
|
|
5
|
+
import { IconButton as u } from "../icon-button/IconButton.js";
|
|
6
|
+
import w from "../../icons/Legacy - Bikayi specific/Services/Marketing.js";
|
|
7
|
+
const j = ({
|
|
8
|
+
onClick: d,
|
|
9
9
|
newContentCount: i = 0,
|
|
10
10
|
isOpen: o = !1,
|
|
11
|
-
isLoading:
|
|
12
|
-
tooltip:
|
|
13
|
-
testId:
|
|
14
|
-
iconWidth:
|
|
15
|
-
iconHeight:
|
|
16
|
-
iconColor:
|
|
17
|
-
iconPadding:
|
|
18
|
-
|
|
11
|
+
isLoading: c = !1,
|
|
12
|
+
tooltip: h = "What's new",
|
|
13
|
+
testId: l = "whats-new-button",
|
|
14
|
+
iconWidth: m = 24,
|
|
15
|
+
iconHeight: f = 24,
|
|
16
|
+
iconColor: p,
|
|
17
|
+
iconPadding: g,
|
|
18
|
+
buttonSize: r = 24,
|
|
19
|
+
customIcon: b
|
|
19
20
|
}) => {
|
|
20
|
-
if (
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
if (c)
|
|
22
|
+
return /* @__PURE__ */ s("div", { style: { margin: "0px 8px" }, children: [
|
|
22
23
|
/* @__PURE__ */ t(
|
|
23
24
|
"div",
|
|
24
25
|
{
|
|
@@ -39,33 +40,37 @@ const W = ({
|
|
|
39
40
|
}
|
|
40
41
|
` })
|
|
41
42
|
] });
|
|
42
|
-
const e = i > 99 ? "99+" : String(i),
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */ t(
|
|
45
|
-
|
|
43
|
+
const e = i > 99 ? "99+" : String(i), n = e.length >= 3 ? 20 : e.length === 2 ? 16 : 12;
|
|
44
|
+
return /* @__PURE__ */ s(x, { count: i, children: [
|
|
45
|
+
/* @__PURE__ */ t(y, { body: h, placement: "bottom", children: /* @__PURE__ */ t(
|
|
46
|
+
u,
|
|
46
47
|
{
|
|
47
|
-
Icon:
|
|
48
|
-
width:
|
|
49
|
-
height:
|
|
50
|
-
iconPadding:
|
|
48
|
+
Icon: b ?? w,
|
|
49
|
+
width: m,
|
|
50
|
+
height: f,
|
|
51
|
+
iconPadding: g,
|
|
51
52
|
isSelected: o,
|
|
52
|
-
iconColor:
|
|
53
|
-
onClick:
|
|
54
|
-
"data-testid":
|
|
55
|
-
style: {
|
|
53
|
+
iconColor: p ?? (o ? a.content.brand : a.content.primary),
|
|
54
|
+
onClick: d,
|
|
55
|
+
"data-testid": l,
|
|
56
|
+
style: {
|
|
57
|
+
width: r,
|
|
58
|
+
height: r,
|
|
59
|
+
boxSizing: "border-box"
|
|
60
|
+
}
|
|
56
61
|
}
|
|
57
62
|
) }),
|
|
58
63
|
i > 0 && /* @__PURE__ */ t(
|
|
59
64
|
"div",
|
|
60
65
|
{
|
|
61
66
|
className: "notification--count",
|
|
62
|
-
style: { width:
|
|
67
|
+
style: { width: n, height: n },
|
|
63
68
|
children: /* @__PURE__ */ t("div", { className: "count--text", children: e })
|
|
64
69
|
}
|
|
65
70
|
)
|
|
66
71
|
] });
|
|
67
72
|
};
|
|
68
73
|
export {
|
|
69
|
-
|
|
74
|
+
j as WhatsNewButton
|
|
70
75
|
};
|
|
71
76
|
//# sourceMappingURL=WhatsNewButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WhatsNewButton.js","sources":["../../../../src/components/whats-new/WhatsNewButton.tsx"],"sourcesContent":["import React from 'react';\nimport { COLORS } from '../../constants/Theme';\nimport { Marketing } from '../../icons';\nimport { IconButton } from '../icon-button';\nimport { Tooltip } from '../tooltips';\nimport { WhatsNewIconContainer } from './WhatsNew.styles';\nimport { WhatsNewButtonProps } from './WhatsNew.types';\n\nexport const WhatsNewButton: React.FC<WhatsNewButtonProps> = ({\n\tonClick,\n\tnewContentCount = 0,\n\tisOpen = false,\n\tisLoading = false,\n\ttooltip = \"What's new\",\n\ttestId = 'whats-new-button',\n\ticonWidth = 24,\n\ticonHeight = 24,\n\ticonColor,\n\ticonPadding,\n\tcustomIcon: CustomIcon,\n}) => {\n\tif (isLoading) {\n\t\treturn (\n\t\t\t<div style={{ margin: '0px 8px' }}>\n\t\t\t\t{/* Simple loading spinner */}\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\twidth: 16,\n\t\t\t\t\t\theight: 16,\n\t\t\t\t\t\tborder: '2px solid #f3f3f3',\n\t\t\t\t\t\tborderTop: '2px solid #731DCF',\n\t\t\t\t\t\tborderRadius: '50%',\n\t\t\t\t\t\tanimation: 'spin 1s linear infinite',\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<style>\n\t\t\t\t\t{`\n\t\t\t\t\t\t@keyframes spin {\n\t\t\t\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t\t\t\t}\n\t\t\t\t\t`}\n\t\t\t\t</style>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst badgeText = newContentCount > 99 ? '99+' : String(newContentCount);\n\t// diameter grows with digit count so the badge stays a perfect circle\n\tconst badgeSize =\n\t\tbadgeText.length >= 3 ? 20 : badgeText.length === 2 ? 16 : 12;\n\n\treturn (\n\t\t<WhatsNewIconContainer count={newContentCount}>\n\t\t\t<Tooltip body={tooltip} placement={'bottom'}>\n\t\t\t\t<IconButton\n\t\t\t\t\tIcon={\n\t\t\t\t\t\t(CustomIcon ?? Marketing) as React.FC<\n\t\t\t\t\t\t\tReact.SVGAttributes<SVGElement>\n\t\t\t\t\t\t>\n\t\t\t\t\t}\n\t\t\t\t\twidth={iconWidth}\n\t\t\t\t\theight={iconHeight}\n\t\t\t\t\ticonPadding={iconPadding}\n\t\t\t\t\tisSelected={isOpen}\n\t\t\t\t\ticonColor={\n\t\t\t\t\t\ticonColor ??\n\t\t\t\t\t\t(isOpen ? COLORS.content.brand : COLORS.content.primary)\n\t\t\t\t\t}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tdata-testid={testId}\n\t\t\t\t\tstyle={{
|
|
1
|
+
{"version":3,"file":"WhatsNewButton.js","sources":["../../../../src/components/whats-new/WhatsNewButton.tsx"],"sourcesContent":["import React from 'react';\nimport { COLORS } from '../../constants/Theme';\nimport { Marketing } from '../../icons';\nimport { IconButton } from '../icon-button';\nimport { Tooltip } from '../tooltips';\nimport { WhatsNewIconContainer } from './WhatsNew.styles';\nimport { WhatsNewButtonProps } from './WhatsNew.types';\n\nexport const WhatsNewButton: React.FC<WhatsNewButtonProps> = ({\n\tonClick,\n\tnewContentCount = 0,\n\tisOpen = false,\n\tisLoading = false,\n\ttooltip = \"What's new\",\n\ttestId = 'whats-new-button',\n\ticonWidth = 24,\n\ticonHeight = 24,\n\ticonColor,\n\ticonPadding,\n\tbuttonSize = 24,\n\tcustomIcon: CustomIcon,\n}) => {\n\tif (isLoading) {\n\t\treturn (\n\t\t\t<div style={{ margin: '0px 8px' }}>\n\t\t\t\t{/* Simple loading spinner */}\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\twidth: 16,\n\t\t\t\t\t\theight: 16,\n\t\t\t\t\t\tborder: '2px solid #f3f3f3',\n\t\t\t\t\t\tborderTop: '2px solid #731DCF',\n\t\t\t\t\t\tborderRadius: '50%',\n\t\t\t\t\t\tanimation: 'spin 1s linear infinite',\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<style>\n\t\t\t\t\t{`\n\t\t\t\t\t\t@keyframes spin {\n\t\t\t\t\t\t\t0% { transform: rotate(0deg); }\n\t\t\t\t\t\t\t100% { transform: rotate(360deg); }\n\t\t\t\t\t\t}\n\t\t\t\t\t`}\n\t\t\t\t</style>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst badgeText = newContentCount > 99 ? '99+' : String(newContentCount);\n\t// diameter grows with digit count so the badge stays a perfect circle\n\tconst badgeSize =\n\t\tbadgeText.length >= 3 ? 20 : badgeText.length === 2 ? 16 : 12;\n\n\treturn (\n\t\t<WhatsNewIconContainer count={newContentCount}>\n\t\t\t<Tooltip body={tooltip} placement={'bottom'}>\n\t\t\t\t<IconButton\n\t\t\t\t\tIcon={\n\t\t\t\t\t\t(CustomIcon ?? Marketing) as React.FC<\n\t\t\t\t\t\t\tReact.SVGAttributes<SVGElement>\n\t\t\t\t\t\t>\n\t\t\t\t\t}\n\t\t\t\t\twidth={iconWidth}\n\t\t\t\t\theight={iconHeight}\n\t\t\t\t\ticonPadding={iconPadding}\n\t\t\t\t\tisSelected={isOpen}\n\t\t\t\t\ticonColor={\n\t\t\t\t\t\ticonColor ??\n\t\t\t\t\t\t(isOpen ? COLORS.content.brand : COLORS.content.primary)\n\t\t\t\t\t}\n\t\t\t\t\tonClick={onClick}\n\t\t\t\t\tdata-testid={testId}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\twidth: buttonSize,\n\t\t\t\t\t\theight: buttonSize,\n\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t\t{newContentCount > 0 && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"notification--count\"\n\t\t\t\t\tstyle={{ width: badgeSize, height: badgeSize }}\n\t\t\t\t>\n\t\t\t\t\t<div className=\"count--text\">{badgeText}</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</WhatsNewIconContainer>\n\t);\n};\n"],"names":["WhatsNewButton","onClick","newContentCount","isOpen","isLoading","tooltip","testId","iconWidth","iconHeight","iconColor","iconPadding","buttonSize","CustomIcon","jsx","badgeText","badgeSize","jsxs","WhatsNewIconContainer","Toolt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