@bikdotai/bik-component-library 0.0.867-beta.0 → 0.0.868-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/agent-builder/utils/mentionSerialization.js +4 -4
- package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/cjs/components/button/Button.js +1 -1
- package/dist/cjs/components/button/Button.js.map +1 -1
- package/dist/cjs/components/button/Button.styled.js +2 -2
- package/dist/cjs/components/button/Button.styled.js.map +1 -1
- package/dist/cjs/components/chip-selector/ChipSelector.js +2 -0
- package/dist/cjs/components/chip-selector/ChipSelector.js.map +1 -0
- package/dist/cjs/components/chip-selector/ChipSelector.styled.js +36 -0
- package/dist/cjs/components/chip-selector/ChipSelector.styled.js.map +1 -0
- package/dist/cjs/components/chip-selector/ChipSelectorGroup.js +2 -0
- package/dist/cjs/components/chip-selector/ChipSelectorGroup.js.map +1 -0
- package/dist/cjs/components/combo-box/ComboBox.js +2 -0
- package/dist/cjs/components/combo-box/ComboBox.js.map +1 -0
- package/dist/cjs/components/combo-box/ComboBox.styled.js +33 -0
- package/dist/cjs/components/combo-box/ComboBox.styled.js.map +1 -0
- package/dist/cjs/components/datePicker/DatePickerWrapper.js +1 -1
- package/dist/cjs/components/datePicker/DatePickerWrapper.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/schedule-builder/RefreshSegmentToggle.js +2 -0
- package/dist/cjs/components/schedule-builder/RefreshSegmentToggle.js.map +1 -0
- package/dist/cjs/components/schedule-builder/ScheduleBuilder.js +2 -0
- package/dist/cjs/components/schedule-builder/ScheduleBuilder.js.map +1 -0
- package/dist/cjs/components/schedule-builder/ScheduleBuilder.styled.js +138 -0
- package/dist/cjs/components/schedule-builder/ScheduleBuilder.styled.js.map +1 -0
- package/dist/cjs/components/schedule-builder/ScheduleEndPicker.js +2 -0
- package/dist/cjs/components/schedule-builder/ScheduleEndPicker.js.map +1 -0
- package/dist/cjs/components/schedule-builder/ScheduleFrequencyPicker.js +2 -0
- package/dist/cjs/components/schedule-builder/ScheduleFrequencyPicker.js.map +1 -0
- package/dist/cjs/components/schedule-builder/ScheduleHelper.js +2 -0
- package/dist/cjs/components/schedule-builder/ScheduleHelper.js.map +1 -0
- package/dist/cjs/components/schedule-builder/SendModeSelector.js +2 -0
- package/dist/cjs/components/schedule-builder/SendModeSelector.js.map +1 -0
- package/dist/cjs/components/schedule-builder/StartDateTimePicker.js +2 -0
- package/dist/cjs/components/schedule-builder/StartDateTimePicker.js.map +1 -0
- package/dist/cjs/components/schedule-builder/UpcomingRunsPreview.js +2 -0
- package/dist/cjs/components/schedule-builder/UpcomingRunsPreview.js.map +1 -0
- package/dist/cjs/components/schedule-builder/model.js +2 -0
- package/dist/cjs/components/schedule-builder/model.js.map +1 -0
- package/dist/cjs/components/tag/Tag.js +1 -1
- package/dist/cjs/components/tag/Tag.js.map +1 -1
- package/dist/cjs/components/tag/Tag.styled.js +4 -4
- package/dist/cjs/components/tag/Tag.styled.js.map +1 -1
- package/dist/cjs/components/tag/model.js.map +1 -1
- package/dist/cjs/editor/extensions/buildExtensions.js +2 -2
- package/dist/cjs/editor/extensions/buildExtensions.js.map +1 -1
- package/dist/cjs/icons/BIK AI specific/WandSparkles.js +1 -1
- package/dist/cjs/icons/BIK AI specific/WandSparkles.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/agent-builder/utils/mentionSerialization.d.ts +3 -1
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js +31 -23
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/esm/components/button/Button.js +19 -21
- package/dist/esm/components/button/Button.js.map +1 -1
- package/dist/esm/components/button/Button.styled.d.ts +0 -1
- package/dist/esm/components/button/Button.styled.js +5 -5
- package/dist/esm/components/button/Button.styled.js.map +1 -1
- package/dist/esm/components/button/model.d.ts +0 -5
- package/dist/esm/components/chip-selector/ChipSelector.d.ts +9 -0
- package/dist/esm/components/chip-selector/ChipSelector.js +27 -0
- package/dist/esm/components/chip-selector/ChipSelector.js.map +1 -0
- package/dist/esm/components/chip-selector/ChipSelector.styled.d.ts +10 -0
- package/dist/esm/components/chip-selector/ChipSelector.styled.js +48 -0
- package/dist/esm/components/chip-selector/ChipSelector.styled.js.map +1 -0
- package/dist/esm/components/chip-selector/ChipSelectorGroup.d.ts +10 -0
- package/dist/esm/components/chip-selector/ChipSelectorGroup.js +48 -0
- package/dist/esm/components/chip-selector/ChipSelectorGroup.js.map +1 -0
- package/dist/esm/components/chip-selector/index.d.ts +4 -0
- package/dist/esm/components/chip-selector/model.d.ts +106 -0
- package/dist/esm/components/combo-box/ComboBox.d.ts +15 -0
- package/dist/esm/components/combo-box/ComboBox.js +118 -0
- package/dist/esm/components/combo-box/ComboBox.js.map +1 -0
- package/dist/esm/components/combo-box/ComboBox.styled.d.ts +12 -0
- package/dist/esm/components/combo-box/ComboBox.styled.js +40 -0
- package/dist/esm/components/combo-box/ComboBox.styled.js.map +1 -0
- package/dist/esm/components/combo-box/index.d.ts +3 -0
- package/dist/esm/components/combo-box/model.d.ts +55 -0
- package/dist/esm/components/datePicker/DatePickerWrapper.d.ts +7 -0
- package/dist/esm/components/datePicker/DatePickerWrapper.js +66 -64
- package/dist/esm/components/datePicker/DatePickerWrapper.js.map +1 -1
- package/dist/esm/components/datePicker/index.d.ts +1 -0
- package/dist/esm/components/dropdown-button/DropdownButton.d.ts +0 -5
- package/dist/esm/components/dropdown-button/DropdownButton.js +3 -4
- package/dist/esm/components/dropdown-button/DropdownButton.js.map +1 -1
- package/dist/esm/components/schedule-builder/RefreshSegmentToggle.d.ts +22 -0
- package/dist/esm/components/schedule-builder/RefreshSegmentToggle.js +31 -0
- package/dist/esm/components/schedule-builder/RefreshSegmentToggle.js.map +1 -0
- package/dist/esm/components/schedule-builder/ScheduleBuilder.d.ts +88 -0
- package/dist/esm/components/schedule-builder/ScheduleBuilder.js +105 -0
- package/dist/esm/components/schedule-builder/ScheduleBuilder.js.map +1 -0
- package/dist/esm/components/schedule-builder/ScheduleBuilder.styled.d.ts +81 -0
- package/dist/esm/components/schedule-builder/ScheduleBuilder.styled.js +168 -0
- package/dist/esm/components/schedule-builder/ScheduleBuilder.styled.js.map +1 -0
- package/dist/esm/components/schedule-builder/ScheduleEndPicker.d.ts +17 -0
- package/dist/esm/components/schedule-builder/ScheduleEndPicker.js +105 -0
- package/dist/esm/components/schedule-builder/ScheduleEndPicker.js.map +1 -0
- package/dist/esm/components/schedule-builder/ScheduleFrequencyPicker.d.ts +21 -0
- package/dist/esm/components/schedule-builder/ScheduleFrequencyPicker.js +136 -0
- package/dist/esm/components/schedule-builder/ScheduleFrequencyPicker.js.map +1 -0
- package/dist/esm/components/schedule-builder/ScheduleHelper.d.ts +110 -0
- package/dist/esm/components/schedule-builder/ScheduleHelper.js +196 -0
- package/dist/esm/components/schedule-builder/ScheduleHelper.js.map +1 -0
- package/dist/esm/components/schedule-builder/SendModeSelector.d.ts +29 -0
- package/dist/esm/components/schedule-builder/SendModeSelector.js +41 -0
- package/dist/esm/components/schedule-builder/SendModeSelector.js.map +1 -0
- package/dist/esm/components/schedule-builder/StartDateTimePicker.d.ts +44 -0
- package/dist/esm/components/schedule-builder/StartDateTimePicker.js +119 -0
- package/dist/esm/components/schedule-builder/StartDateTimePicker.js.map +1 -0
- package/dist/esm/components/schedule-builder/UpcomingRunsPreview.d.ts +19 -0
- package/dist/esm/components/schedule-builder/UpcomingRunsPreview.js +44 -0
- package/dist/esm/components/schedule-builder/UpcomingRunsPreview.js.map +1 -0
- package/dist/esm/components/schedule-builder/index.d.ts +17 -0
- package/dist/esm/components/schedule-builder/model.d.ts +69 -0
- package/dist/esm/components/schedule-builder/model.js +8 -0
- package/dist/esm/components/schedule-builder/model.js.map +1 -0
- package/dist/esm/components/tag/Tag.d.ts +1 -1
- package/dist/esm/components/tag/Tag.js +41 -48
- package/dist/esm/components/tag/Tag.js.map +1 -1
- package/dist/esm/components/tag/Tag.styled.d.ts +0 -3
- package/dist/esm/components/tag/Tag.styled.js +9 -6
- package/dist/esm/components/tag/Tag.styled.js.map +1 -1
- package/dist/esm/components/tag/model.d.ts +0 -11
- package/dist/esm/components/tag/model.js.map +1 -1
- package/dist/esm/editor/extensions/buildExtensions.d.ts +1 -1
- package/dist/esm/editor/extensions/buildExtensions.js +43 -49
- package/dist/esm/editor/extensions/buildExtensions.js.map +1 -1
- package/dist/esm/icons/BIK AI specific/WandSparkles.js +1 -1
- package/dist/esm/icons/BIK AI specific/WandSparkles.js.map +1 -1
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +716 -675
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -2
- package/dist/cjs/editor/extensions/emailLayout/EmailLayoutExtensions.js +0 -2
- package/dist/cjs/editor/extensions/emailLayout/EmailLayoutExtensions.js.map +0 -1
- package/dist/esm/editor/extensions/emailLayout/EmailLayoutExtensions.d.ts +0 -19
- package/dist/esm/editor/extensions/emailLayout/EmailLayoutExtensions.js +0 -110
- package/dist/esm/editor/extensions/emailLayout/EmailLayoutExtensions.js.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
1
|
+
import { jsx as l, jsxs as J } from "react/jsx-runtime";
|
|
2
2
|
import m from "react";
|
|
3
|
-
import { Tooltip as
|
|
4
|
-
import { AiBodyTiny as
|
|
5
|
-
import { ValidTagTypeMap as
|
|
6
|
-
import { Tag as
|
|
7
|
-
import { getTagIconColor as
|
|
8
|
-
const
|
|
3
|
+
import { Tooltip as $ } from "../tooltips/Tooltip.js";
|
|
4
|
+
import { AiBodyTiny as u, AiBodyCaption as B, BodyTiny as E, BodyCaption as T } from "../TypographyStyle.js";
|
|
5
|
+
import { ValidTagTypeMap as K } from "./model.js";
|
|
6
|
+
import { Tag as Q } from "./Tag.styled.js";
|
|
7
|
+
import { getTagIconColor as S } from "./themes.js";
|
|
8
|
+
const U = ({
|
|
9
9
|
tagText: k,
|
|
10
10
|
LeadingIcon: h,
|
|
11
11
|
TrailingIcon: n,
|
|
12
|
-
onLeadingIconClicked:
|
|
13
|
-
leadingIconId:
|
|
12
|
+
onLeadingIconClicked: N = void 0,
|
|
13
|
+
leadingIconId: a,
|
|
14
14
|
trailingIconId: p,
|
|
15
|
-
onTrailingIconClicked:
|
|
15
|
+
onTrailingIconClicked: w = void 0,
|
|
16
16
|
theme: d = "light",
|
|
17
17
|
type: t = "neutral",
|
|
18
18
|
variant: c = "regular",
|
|
@@ -25,33 +25,30 @@ const Y = ({
|
|
|
25
25
|
padding: P,
|
|
26
26
|
height: R,
|
|
27
27
|
leadingIconTooltip: g,
|
|
28
|
-
trailingIconTooltip:
|
|
29
|
-
tagColor:
|
|
28
|
+
trailingIconTooltip: f,
|
|
29
|
+
tagColor: C,
|
|
30
30
|
numberOfLines: r,
|
|
31
31
|
backgroundColor: V,
|
|
32
32
|
borderRadius: q,
|
|
33
|
-
size:
|
|
34
|
-
|
|
35
|
-
gap: F,
|
|
36
|
-
hoverBackgroundColor: G,
|
|
37
|
-
...J
|
|
33
|
+
size: o = "regular",
|
|
34
|
+
hoverBackgroundColor: D
|
|
38
35
|
}) => {
|
|
39
36
|
let i = k;
|
|
40
|
-
const
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
const
|
|
37
|
+
const F = d;
|
|
38
|
+
let y = t;
|
|
39
|
+
K[c][t] || (y = "neutral"), c === "circle" && typeof i == "number" && i > 99 && (i = "99+");
|
|
40
|
+
const G = S(d, y), s = {
|
|
44
41
|
height: c === "compressed" ? 12 : 16,
|
|
45
42
|
width: c === "compressed" ? 12 : 16,
|
|
46
|
-
color:
|
|
43
|
+
color: G,
|
|
47
44
|
style: { display: "block" }
|
|
48
45
|
};
|
|
49
46
|
return /* @__PURE__ */ l(
|
|
50
|
-
|
|
47
|
+
Q,
|
|
51
48
|
{
|
|
52
49
|
cursor: j,
|
|
53
|
-
theme:
|
|
54
|
-
type:
|
|
50
|
+
theme: F,
|
|
51
|
+
type: y,
|
|
55
52
|
variant: c,
|
|
56
53
|
version: x,
|
|
57
54
|
alignIcon: A,
|
|
@@ -61,42 +58,38 @@ const Y = ({
|
|
|
61
58
|
height: R,
|
|
62
59
|
backgroundColor: V,
|
|
63
60
|
borderRadius: q,
|
|
64
|
-
size:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
hoverBackgroundColor: G,
|
|
69
|
-
...J,
|
|
70
|
-
children: /* @__PURE__ */ S("div", { className: "container", children: [
|
|
71
|
-
h && (g ? /* @__PURE__ */ l(u, { ...g, children: /* @__PURE__ */ l(
|
|
61
|
+
size: o,
|
|
62
|
+
hoverBackgroundColor: D,
|
|
63
|
+
children: /* @__PURE__ */ J("div", { className: "container", children: [
|
|
64
|
+
h && (g ? /* @__PURE__ */ l($, { ...g, children: /* @__PURE__ */ l(
|
|
72
65
|
"button",
|
|
73
66
|
{
|
|
74
67
|
className: "icon-leading",
|
|
75
|
-
onClick:
|
|
76
|
-
id: `${
|
|
68
|
+
onClick: N,
|
|
69
|
+
id: `${a}-wrapper` || "leading-icon-wrapper",
|
|
77
70
|
children: m.createElement(h, {
|
|
78
71
|
...s,
|
|
79
|
-
id:
|
|
72
|
+
id: a || "leading-icon"
|
|
80
73
|
})
|
|
81
74
|
}
|
|
82
75
|
) }) : /* @__PURE__ */ l(
|
|
83
76
|
"button",
|
|
84
77
|
{
|
|
85
78
|
className: "icon-leading",
|
|
86
|
-
onClick:
|
|
87
|
-
id: `${
|
|
79
|
+
onClick: N,
|
|
80
|
+
id: `${a}-wrapper` || "leading-icon-wrapper",
|
|
88
81
|
children: m.createElement(h, {
|
|
89
82
|
...s,
|
|
90
|
-
id:
|
|
83
|
+
id: a || "leading-icon"
|
|
91
84
|
})
|
|
92
85
|
}
|
|
93
86
|
)),
|
|
94
|
-
e && (t === "ai" && d === "light" ?
|
|
95
|
-
!e && i !== "" && (t === "ai" && d === "light" ?
|
|
87
|
+
e && (t === "ai" && d === "light" ? o === "small" ? /* @__PURE__ */ l(u, { numberOfLines: r, children: e }) : /* @__PURE__ */ l(B, { numberOfLines: r, children: e }) : o === "small" ? /* @__PURE__ */ l(E, { className: "text", numberOfLines: r, children: e }) : /* @__PURE__ */ l(T, { className: "text", numberOfLines: r, children: e })),
|
|
88
|
+
!e && i !== "" && (t === "ai" && d === "light" ? o === "small" ? /* @__PURE__ */ l(u, { numberOfLines: r, children: i }) : /* @__PURE__ */ l(B, { numberOfLines: r, children: i }) : o === "small" ? /* @__PURE__ */ l(
|
|
96
89
|
E,
|
|
97
90
|
{
|
|
98
91
|
className: "text",
|
|
99
|
-
color:
|
|
92
|
+
color: C,
|
|
100
93
|
numberOfLines: r,
|
|
101
94
|
children: i
|
|
102
95
|
}
|
|
@@ -104,16 +97,16 @@ const Y = ({
|
|
|
104
97
|
T,
|
|
105
98
|
{
|
|
106
99
|
className: "text",
|
|
107
|
-
color:
|
|
100
|
+
color: C,
|
|
108
101
|
numberOfLines: r,
|
|
109
102
|
children: i
|
|
110
103
|
}
|
|
111
104
|
)),
|
|
112
|
-
n && (
|
|
105
|
+
n && (f ? /* @__PURE__ */ l($, { ...f, children: /* @__PURE__ */ l(
|
|
113
106
|
"button",
|
|
114
107
|
{
|
|
115
108
|
className: "icon-trailing",
|
|
116
|
-
onClick:
|
|
109
|
+
onClick: w,
|
|
117
110
|
id: `${p}-wrapper` || "trailing-icon-wrapper",
|
|
118
111
|
children: m.createElement(n, {
|
|
119
112
|
...s,
|
|
@@ -124,7 +117,7 @@ const Y = ({
|
|
|
124
117
|
"button",
|
|
125
118
|
{
|
|
126
119
|
className: "icon-trailing",
|
|
127
|
-
onClick:
|
|
120
|
+
onClick: w,
|
|
128
121
|
id: `${p}-wrapper` || "trailing-icon-wrapper",
|
|
129
122
|
children: m.createElement(n, {
|
|
130
123
|
...s,
|
|
@@ -136,8 +129,8 @@ const Y = ({
|
|
|
136
129
|
}
|
|
137
130
|
);
|
|
138
131
|
};
|
|
139
|
-
|
|
132
|
+
U.displayName = "Tag";
|
|
140
133
|
export {
|
|
141
|
-
|
|
134
|
+
U as Tag
|
|
142
135
|
};
|
|
143
136
|
//# sourceMappingURL=Tag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","sources":["../../../../src/components/tag/Tag.tsx"],"sourcesContent":["import React from 'react';\nimport { Tooltip } from '../tooltips/Tooltip';\nimport {\n\tAiBodyCaption,\n\tAiBodyTiny,\n\tBodyCaption,\n\tBodyTiny,\n} from '../TypographyStyle';\nimport { TagProps, ValidTagTypeMap } from './model';\nimport * as Sc from './Tag.styled';\nimport { getTagIconColor } from './themes';\n\nexport const Tag = ({\n\ttagText,\n\tLeadingIcon,\n\tTrailingIcon,\n\tonLeadingIconClicked = undefined,\n\tleadingIconId,\n\ttrailingIconId,\n\tonTrailingIconClicked = undefined,\n\ttheme = 'light',\n\ttype = 'neutral',\n\tvariant = 'regular',\n\tversion,\n\tcursor,\n\talignIcon,\n\tnoBorder,\n\ttagHtmlText,\n\tcontentPadding,\n\tpadding,\n\theight,\n\tleadingIconTooltip,\n\ttrailingIconTooltip,\n\ttagColor,\n\tnumberOfLines,\n\tbackgroundColor,\n\tborderRadius,\n\tsize = 'regular',\n\
|
|
1
|
+
{"version":3,"file":"Tag.js","sources":["../../../../src/components/tag/Tag.tsx"],"sourcesContent":["import React from 'react';\nimport { Tooltip } from '../tooltips/Tooltip';\nimport {\n\tAiBodyCaption,\n\tAiBodyTiny,\n\tBodyCaption,\n\tBodyTiny,\n} from '../TypographyStyle';\nimport { TagProps, ValidTagTypeMap } from './model';\nimport * as Sc from './Tag.styled';\nimport { getTagIconColor } from './themes';\n\nexport const Tag = ({\n\ttagText,\n\tLeadingIcon,\n\tTrailingIcon,\n\tonLeadingIconClicked = undefined,\n\tleadingIconId,\n\ttrailingIconId,\n\tonTrailingIconClicked = undefined,\n\ttheme = 'light',\n\ttype = 'neutral',\n\tvariant = 'regular',\n\tversion,\n\tcursor,\n\talignIcon,\n\tnoBorder,\n\ttagHtmlText,\n\tcontentPadding,\n\tpadding,\n\theight,\n\tleadingIconTooltip,\n\ttrailingIconTooltip,\n\ttagColor,\n\tnumberOfLines,\n\tbackgroundColor,\n\tborderRadius,\n\tsize = 'regular',\n\thoverBackgroundColor,\n}: TagProps) => {\n\tlet displayTagText = tagText;\n\tconst displayTheme = theme;\n\tlet displayType = type;\n\n\tif (!ValidTagTypeMap[variant][type]) {\n\t\tdisplayType = 'neutral';\n\t}\n\n\tif (variant === 'circle') {\n\t\tif (typeof displayTagText === 'number' && displayTagText > 99) {\n\t\t\tdisplayTagText = '99+';\n\t\t}\n\t}\n\n\tconst iconColor = getTagIconColor(theme, displayType);\n\tconst iconProps = {\n\t\theight: variant === 'compressed' ? 12 : 16,\n\t\twidth: variant === 'compressed' ? 12 : 16,\n\t\tcolor: iconColor,\n\t\tstyle: { display: 'block' },\n\t};\n\n\treturn (\n\t\t<Sc.Tag\n\t\t\tcursor={cursor}\n\t\t\ttheme={displayTheme}\n\t\t\ttype={displayType}\n\t\t\tvariant={variant}\n\t\t\tversion={version}\n\t\t\talignIcon={alignIcon}\n\t\t\tnoBorder={noBorder}\n\t\t\tcontentPadding={contentPadding}\n\t\t\tpadding={padding}\n\t\t\theight={height}\n\t\t\tbackgroundColor={backgroundColor}\n\t\t\tborderRadius={borderRadius}\n\t\t\tsize={size}\n\t\t\thoverBackgroundColor={hoverBackgroundColor}\n\t\t>\n\t\t\t<div className=\"container\">\n\t\t\t\t{LeadingIcon &&\n\t\t\t\t\t(leadingIconTooltip ? (\n\t\t\t\t\t\t<Tooltip {...leadingIconTooltip}>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tclassName=\"icon-leading\"\n\t\t\t\t\t\t\t\tonClick={onLeadingIconClicked}\n\t\t\t\t\t\t\t\tid={`${leadingIconId}-wrapper` || 'leading-icon-wrapper'}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{React.createElement(LeadingIcon, {\n\t\t\t\t\t\t\t\t\t...iconProps,\n\t\t\t\t\t\t\t\t\tid: leadingIconId || 'leading-icon',\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tclassName=\"icon-leading\"\n\t\t\t\t\t\t\tonClick={onLeadingIconClicked}\n\t\t\t\t\t\t\tid={`${leadingIconId}-wrapper` || 'leading-icon-wrapper'}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{React.createElement(LeadingIcon, {\n\t\t\t\t\t\t\t\t...iconProps,\n\t\t\t\t\t\t\t\tid: leadingIconId || 'leading-icon',\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t))}\n\n\t\t\t\t{tagHtmlText &&\n\t\t\t\t\t(type === 'ai' && theme === 'light' ? (\n\t\t\t\t\t\tsize === 'small' ? (\n\t\t\t\t\t\t\t<AiBodyTiny numberOfLines={numberOfLines}>\n\t\t\t\t\t\t\t\t{tagHtmlText}\n\t\t\t\t\t\t\t</AiBodyTiny>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<AiBodyCaption numberOfLines={numberOfLines}>\n\t\t\t\t\t\t\t\t{tagHtmlText}\n\t\t\t\t\t\t\t</AiBodyCaption>\n\t\t\t\t\t\t)\n\t\t\t\t\t) : size === 'small' ? (\n\t\t\t\t\t\t<BodyTiny className=\"text\" numberOfLines={numberOfLines}>\n\t\t\t\t\t\t\t{tagHtmlText}\n\t\t\t\t\t\t</BodyTiny>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<BodyCaption className=\"text\" numberOfLines={numberOfLines}>\n\t\t\t\t\t\t\t{tagHtmlText}\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t))}\n\n\t\t\t\t{!tagHtmlText &&\n\t\t\t\t\tdisplayTagText !== '' &&\n\t\t\t\t\t(type === 'ai' && theme === 'light' ? (\n\t\t\t\t\t\tsize === 'small' ? (\n\t\t\t\t\t\t\t<AiBodyTiny numberOfLines={numberOfLines}>\n\t\t\t\t\t\t\t\t{displayTagText}\n\t\t\t\t\t\t\t</AiBodyTiny>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<AiBodyCaption numberOfLines={numberOfLines}>\n\t\t\t\t\t\t\t\t{displayTagText}\n\t\t\t\t\t\t\t</AiBodyCaption>\n\t\t\t\t\t\t)\n\t\t\t\t\t) : size === 'small' ? (\n\t\t\t\t\t\t<BodyTiny\n\t\t\t\t\t\t\tclassName=\"text\"\n\t\t\t\t\t\t\tcolor={tagColor}\n\t\t\t\t\t\t\tnumberOfLines={numberOfLines}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{displayTagText}\n\t\t\t\t\t\t</BodyTiny>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<BodyCaption\n\t\t\t\t\t\t\tclassName=\"text\"\n\t\t\t\t\t\t\tcolor={tagColor}\n\t\t\t\t\t\t\tnumberOfLines={numberOfLines}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{displayTagText}\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t))}\n\n\t\t\t\t{TrailingIcon &&\n\t\t\t\t\t(trailingIconTooltip ? (\n\t\t\t\t\t\t<Tooltip {...trailingIconTooltip}>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\tclassName=\"icon-trailing\"\n\t\t\t\t\t\t\t\tonClick={onTrailingIconClicked}\n\t\t\t\t\t\t\t\tid={`${trailingIconId}-wrapper` || 'trailing-icon-wrapper'}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{React.createElement(TrailingIcon, {\n\t\t\t\t\t\t\t\t\t...iconProps,\n\t\t\t\t\t\t\t\t\tid: trailingIconId || 'trailing-icon',\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tclassName=\"icon-trailing\"\n\t\t\t\t\t\t\tonClick={onTrailingIconClicked}\n\t\t\t\t\t\t\tid={`${trailingIconId}-wrapper` || 'trailing-icon-wrapper'}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{React.createElement(TrailingIcon, {\n\t\t\t\t\t\t\t\t...iconProps,\n\t\t\t\t\t\t\t\tid: trailingIconId || 'trailing-icon',\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t))}\n\t\t\t</div>\n\t\t</Sc.Tag>\n\t);\n};\n\nTag.displayName = 'Tag';\n"],"names":["Tag","tagText","LeadingIcon","TrailingIcon","onLeadingIconClicked","leadingIconId","trailingIconId","onTrailingIconClicked","theme","type","variant","version","cursor","alignIcon","noBorder","tagHtmlText","contentPadding","padding","height","leadingIconTooltip","trailingIconTooltip","tagColor","numberOfLines","backgroundColor","borderRadius","size","hoverBackgroundColor","displayTagText","displayTheme","displayType","ValidTagTypeMap","iconColor","getTagIconColor","iconProps","jsx","Sc.Tag","jsxs","Tooltip","React","AiBodyTiny","AiBodyCaption","BodyTiny","BodyCaption"],"mappings":"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"}
|
|
@@ -13,8 +13,5 @@ export declare const Tag: import('styled-components').StyledComponent<"div", any
|
|
|
13
13
|
backgroundColor?: string | undefined;
|
|
14
14
|
borderRadius?: string | number | undefined;
|
|
15
15
|
size?: "small" | "regular" | undefined;
|
|
16
|
-
borderStyle?: "dashed" | "solid" | undefined;
|
|
17
|
-
gap?: number | undefined;
|
|
18
|
-
tagColor?: string | undefined;
|
|
19
16
|
hoverBackgroundColor?: string | undefined;
|
|
20
17
|
}, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import i from "styled-components";
|
|
2
|
-
import { getPadding as a, getBackgroundColor as d, generateBorder as
|
|
3
|
-
const
|
|
2
|
+
import { getPadding as a, getBackgroundColor as d, generateBorder as n, getTextColor as t } from "./themes.js";
|
|
3
|
+
const o = i.div`
|
|
4
4
|
cursor: ${(e) => e.cursor ?? "default"};
|
|
5
5
|
${(e) => e.size !== "small" && (e.variant === "regular" ? `display: block;
|
|
6
6
|
min-height: 26px;
|
|
@@ -8,17 +8,20 @@ const g = i.div`
|
|
|
8
8
|
.container {
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: ${(e) => e.alignIcon ? e.alignIcon : "center"};
|
|
11
|
-
gap:
|
|
11
|
+
gap: 6px;
|
|
12
12
|
${(e) => e.height ? `height: ${e.height}px; box-sizing: border-box;` : e.size === "small" ? "height: 16px; box-sizing: border-box;" : ""}
|
|
13
13
|
padding: ${(e) => e.padding ? e.padding : e.size === "small" ? "2px 6px" : e.contentPadding ? `${e.contentPadding}px` : a(e.variant)};
|
|
14
14
|
background: ${(e) => e.backgroundColor ?? d(e.theme, e.type)};
|
|
15
15
|
|
|
16
16
|
border-radius: ${(e) => e.borderRadius !== void 0 ? typeof e.borderRadius == "number" ? `${e.borderRadius}px` : e.borderRadius : e.variant === "regular" ? "4px" : "12px"};
|
|
17
17
|
|
|
18
|
-
${(e) => !e.noBorder && e.theme === "light" && `border: ${e.version === "2.0" ? 0.5 : 1}px
|
|
18
|
+
${(e) => !e.noBorder && e.theme === "light" && `border: ${e.version === "2.0" ? 0.5 : 1}px solid ${n(
|
|
19
|
+
e.type,
|
|
20
|
+
e.theme
|
|
21
|
+
)};`}
|
|
19
22
|
|
|
20
23
|
.text {
|
|
21
|
-
color: ${(e) =>
|
|
24
|
+
color: ${(e) => t(e.theme, e.type)};
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
.icon-trailing {
|
|
@@ -37,6 +40,6 @@ const g = i.div`
|
|
|
37
40
|
}
|
|
38
41
|
`;
|
|
39
42
|
export {
|
|
40
|
-
|
|
43
|
+
o as Tag
|
|
41
44
|
};
|
|
42
45
|
//# sourceMappingURL=Tag.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.styled.js","sources":["../../../../src/components/tag/Tag.styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { TagTheme, TagType, TagVariant } from './model';\nimport {\n\tgenerateBorder,\n\tgetBackgroundColor,\n\tgetPadding,\n\tgetTextColor,\n} from './themes';\n\nexport const Tag = styled.div<{\n\ttheme: TagTheme;\n\ttype: TagType;\n\tvariant: TagVariant;\n\tversion?: '1.0' | '2.0' | '3.0';\n\tcursor?: string;\n\talignIcon?: string;\n\tnoBorder?: boolean;\n\tcontentPadding?: number;\n\tpadding?: string;\n\theight?: number;\n\tbackgroundColor?: string;\n\tborderRadius?: string | number;\n\tsize?: 'regular' | 'small';\n\
|
|
1
|
+
{"version":3,"file":"Tag.styled.js","sources":["../../../../src/components/tag/Tag.styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport { TagTheme, TagType, TagVariant } from './model';\nimport {\n\tgenerateBorder,\n\tgetBackgroundColor,\n\tgetPadding,\n\tgetTextColor,\n} from './themes';\n\nexport const Tag = styled.div<{\n\ttheme: TagTheme;\n\ttype: TagType;\n\tvariant: TagVariant;\n\tversion?: '1.0' | '2.0' | '3.0';\n\tcursor?: string;\n\talignIcon?: string;\n\tnoBorder?: boolean;\n\tcontentPadding?: number;\n\tpadding?: string;\n\theight?: number;\n\tbackgroundColor?: string;\n\tborderRadius?: string | number;\n\tsize?: 'regular' | 'small';\n\thoverBackgroundColor?: string;\n}>`\n\tcursor: ${(props) => props.cursor ?? 'default'};\n\t${(props) =>\n\t\tprops.size !== 'small' &&\n\t\t(props.variant === 'regular'\n\t\t\t? `display: block;\n\t\t min-height: 26px;\n\t\t`\n\t\t\t: `min-height: 20px;`)}\n\t.container {\n\t\tdisplay: flex;\n\t\talign-items: ${(props) => (props.alignIcon ? props.alignIcon : 'center')};\n\t\tgap: 6px;\n\t\t${(props) =>\n\t\t\tprops.height\n\t\t\t\t? `height: ${props.height}px; box-sizing: border-box;`\n\t\t\t\t: props.size === 'small'\n\t\t\t\t? 'height: 16px; box-sizing: border-box;'\n\t\t\t\t: ''}\n\t\tpadding: ${(props) =>\n\t\t\tprops.padding\n\t\t\t\t? props.padding\n\t\t\t\t: props.size === 'small'\n\t\t\t\t? '2px 6px'\n\t\t\t\t: props.contentPadding\n\t\t\t\t? `${props.contentPadding}px`\n\t\t\t\t: getPadding(props.variant)};\n\t\tbackground: ${(props) =>\n\t\t\tprops.backgroundColor ?? getBackgroundColor(props.theme, props.type)};\n\n\t\tborder-radius: ${(props) =>\n\t\t\tprops.borderRadius !== undefined\n\t\t\t\t? typeof props.borderRadius === 'number'\n\t\t\t\t\t? `${props.borderRadius}px`\n\t\t\t\t\t: props.borderRadius\n\t\t\t\t: props.variant === 'regular'\n\t\t\t\t? '4px'\n\t\t\t\t: '12px'};\n\n\t\t${(props) =>\n\t\t\t!props.noBorder &&\n\t\t\tprops.theme === 'light' &&\n\t\t\t`border: ${props.version === '2.0' ? 0.5 : 1}px solid ${generateBorder(\n\t\t\t\tprops.type,\n\t\t\t\tprops.theme,\n\t\t\t)};`}\n\n\t\t.text {\n\t\t\tcolor: ${(props) => getTextColor(props.theme, props.type)};\n\t\t}\n\n\t\t.icon-trailing {\n\t\t\tall: unset;\n\t\t\tdisplay: flex;\n\t\t}\n\n\t\t.icon-leading {\n\t\t\tall: unset;\n\t\t\tdisplay: flex;\n\t\t}\n\n\t\t${(props) =>\n\t\t\tprops.hoverBackgroundColor &&\n\t\t\t`&:hover {\n\t\t\t\tbackground: ${props.hoverBackgroundColor};\n\t\t\t}`}\n\t}\n`;\n"],"names":["Tag","styled","props","getPadding","getBackgroundColor","generateBorder","getTextColor"],"mappings":";;AASO,MAAMA,IAAMC,EAAO;AAAA,WAgBf,CAACC,MAAUA,EAAM,UAAU,SAAS;AAAA,GAC5C,CAACA,MACFA,EAAM,SAAS,YACdA,EAAM,YAAY,YAChB;AAAA;AAAA,MAGA,oBAAoB;AAAA;AAAA;AAAA,iBAGR,CAACA,MAAWA,EAAM,YAAYA,EAAM,YAAY,QAAS;AAAA;AAAA,IAEtE,CAACA,MACFA,EAAM,SACH,WAAWA,EAAM,MAAM,gCACvBA,EAAM,SAAS,UACf,0CACA,EAAE;AAAA,aACK,CAACA,MACXA,EAAM,UACHA,EAAM,UACNA,EAAM,SAAS,UACf,YACAA,EAAM,iBACN,GAAGA,EAAM,cAAc,OACvBC,EAAWD,EAAM,OAAO,CAAC;AAAA,gBACf,CAACA,MACdA,EAAM,mBAAmBE,EAAmBF,EAAM,OAAOA,EAAM,IAAI,CAAC;AAAA;AAAA,mBAEpD,CAACA,MACjBA,EAAM,iBAAiB,SACpB,OAAOA,EAAM,gBAAiB,WAC7B,GAAGA,EAAM,YAAY,OACrBA,EAAM,eACPA,EAAM,YAAY,YAClB,QACA,MAAM;AAAA;AAAA,IAER,CAACA,MACF,CAACA,EAAM,YACPA,EAAM,UAAU,WAChB,WAAWA,EAAM,YAAY,QAAQ,MAAM,CAAC,YAAYG;AAAA,EACvDH,EAAM;AAAA,EACNA,EAAM;AACP,CAAC,GAAG;AAAA;AAAA;AAAA,YAGK,CAACA,MAAUI,EAAaJ,EAAM,OAAOA,EAAM,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaxD,CAACA,MACFA,EAAM,wBACN;AAAA,kBACeA,EAAM,oBAAoB;AAAA,KACvC;AAAA;AAAA;"}
|
|
@@ -118,17 +118,6 @@ export interface TagProps extends React.BaseHTMLAttributes<HTMLDivElement> {
|
|
|
118
118
|
* @default 'regular'
|
|
119
119
|
*/
|
|
120
120
|
size?: 'regular' | 'small';
|
|
121
|
-
/**
|
|
122
|
-
* Border style of the tag container. 'dashed' marks an action that is not
|
|
123
|
-
* configured yet, e.g. an "Add custom" affordance.
|
|
124
|
-
* @default 'solid'
|
|
125
|
-
*/
|
|
126
|
-
borderStyle?: 'solid' | 'dashed';
|
|
127
|
-
/**
|
|
128
|
-
* Gap in px between the leading icon, text and trailing icon.
|
|
129
|
-
* @default 6
|
|
130
|
-
*/
|
|
131
|
-
gap?: number;
|
|
132
121
|
/**
|
|
133
122
|
* Background color on hover.
|
|
134
123
|
* @default undefined (no hover effect)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sources":["../../../../src/components/tag/model.ts"],"sourcesContent":["import React from 'react';\nimport { MouseEventHandler } from 'react';\nimport { TooltipProps } from '../tooltips/Tooltip';\n\nexport type TagTheme = 'light' | 'dark';\n\nexport type TagVariant = 'regular' | 'circle' | 'compressed';\n\nexport type TagType =\n\t| 'negative'\n\t| 'warning'\n\t| 'positive'\n\t| 'neutral'\n\t| 'white'\n\t| 'purple'\n\t| 'blue'\n\t| 'grey'\n\t| 'ai';\n\nexport const ValidTagTypeMap = {\n\tregular: {\n\t\tnegative: true,\n\t\twarning: true,\n\t\tpositive: true,\n\t\tneutral: true,\n\t\twhite: true,\n\t\tpurple: true,\n\t\tblue: true,\n\t\tai: true,\n\t},\n\tcircle: {\n\t\tnegative: true,\n\t\twarning: true,\n\t\tpositive: true,\n\t\tneutral: true,\n\t\tblue: true,\n\t\tgrey: true,\n\t\tai: true,\n\t},\n\tcompressed: {\n\t\tnegative: true,\n\t\twarning: true,\n\t\tpositive: true,\n\t\tneutral: true,\n\t\twhite: true,\n\t\tpurple: true,\n\t\tblue: true,\n\t\tai: true,\n\t},\n};\n\nexport interface TagProps extends React.BaseHTMLAttributes<HTMLDivElement> {\n\t/**\n\t * Set the theme of the Tag\n\t * @default default light\n\t */\n\ttheme?: TagTheme;\n\n\t/**\n\t * Set the color of the Tag\n\t * @default default neutral\n\t */\n\ttype?: TagType;\n\n\t/**\n\t * Set the color of the Tag\n\t * @default default regular\n\t */\n\tvariant?: TagVariant;\n\n\t/**\n\t * The icon component that is the right of the text\n\t * Referred to https://ozzie.sh/passing-icons-as-props-in-a-consistent-way-using-react\n\t * @default undefined\n\t */\n\tTrailingIcon?: React.FunctionComponent<React.SVGAttributes<SVGElement>>;\n\t/**\n\t * The right icon id,\n\t * @default trailing-icon\n\t */\n\ttrailingIconId?: string;\n\t/**\n\t * The right icon on click event, defaults to () => {}\n\t */\n\tonTrailingIconClicked?: MouseEventHandler<HTMLButtonElement>;\n\t/**\n\t * Tooltip props for the trailing icon\n\t * @default undefined\n\t */\n\ttrailingIconTooltip?: Omit<TooltipProps, 'children'>;\n\n\t/**\n\t * The icon component that is to the left of the text\n\t * Referred to https://ozzie.sh/passing-icons-as-props-in-a-consistent-way-using-react\n\t * @default undefined\n\t */\n\tLeadingIcon?: React.FunctionComponent<React.SVGAttributes<SVGElement>>;\n\t/**\n\t * The right icon on click event, defaults to () => {}\n\t */\n\tonLeadingIconClicked?: MouseEventHandler<HTMLButtonElement>;\n\t/**\n\t * The left icon id,\n\t * @default leading-icon\n\t */\n\tleadingIconId?: string;\n\t/**\n\t * Tooltip props for the leading icon\n\t * @default undefined\n\t */\n\tleadingIconTooltip?: Omit<TooltipProps, 'children'>;\n\n\ttagText: string | number;\n\tversion?: '1.0' | '2.0' | '3.0';\n\t/** Custom CSS padding string, e.g. '4px 8px' */\n\tpadding?: string;\n\t/** Custom height in px */\n\theight?: number;\n\tcursor?: string;\n\talignIcon?: string;\n\tnoBorder?: boolean;\n\ttagHtmlText?: JSX.Element;\n\tcontentPadding?: number;\n\ttagColor?: string;\n\tnumberOfLines?: number;\n\t/**\n\t * Override the computed background color of the tag container.\n\t * @default undefined (uses theme/type color)\n\t */\n\tbackgroundColor?: string;\n\t/**\n\t * Override the border-radius of the tag container.\n\t * @default undefined (uses variant-based radius: 4px for regular, 12px otherwise)\n\t */\n\tborderRadius?: string | number;\n\t/**\n\t * Controls the size of the tag. 'small' sets height to 16px and uses tiny font.\n\t * @default 'regular'\n\t */\n\tsize?: 'regular' | 'small';\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"model.js","sources":["../../../../src/components/tag/model.ts"],"sourcesContent":["import React from 'react';\nimport { MouseEventHandler } from 'react';\nimport { TooltipProps } from '../tooltips/Tooltip';\n\nexport type TagTheme = 'light' | 'dark';\n\nexport type TagVariant = 'regular' | 'circle' | 'compressed';\n\nexport type TagType =\n\t| 'negative'\n\t| 'warning'\n\t| 'positive'\n\t| 'neutral'\n\t| 'white'\n\t| 'purple'\n\t| 'blue'\n\t| 'grey'\n\t| 'ai';\n\nexport const ValidTagTypeMap = {\n\tregular: {\n\t\tnegative: true,\n\t\twarning: true,\n\t\tpositive: true,\n\t\tneutral: true,\n\t\twhite: true,\n\t\tpurple: true,\n\t\tblue: true,\n\t\tai: true,\n\t},\n\tcircle: {\n\t\tnegative: true,\n\t\twarning: true,\n\t\tpositive: true,\n\t\tneutral: true,\n\t\tblue: true,\n\t\tgrey: true,\n\t\tai: true,\n\t},\n\tcompressed: {\n\t\tnegative: true,\n\t\twarning: true,\n\t\tpositive: true,\n\t\tneutral: true,\n\t\twhite: true,\n\t\tpurple: true,\n\t\tblue: true,\n\t\tai: true,\n\t},\n};\n\nexport interface TagProps extends React.BaseHTMLAttributes<HTMLDivElement> {\n\t/**\n\t * Set the theme of the Tag\n\t * @default default light\n\t */\n\ttheme?: TagTheme;\n\n\t/**\n\t * Set the color of the Tag\n\t * @default default neutral\n\t */\n\ttype?: TagType;\n\n\t/**\n\t * Set the color of the Tag\n\t * @default default regular\n\t */\n\tvariant?: TagVariant;\n\n\t/**\n\t * The icon component that is the right of the text\n\t * Referred to https://ozzie.sh/passing-icons-as-props-in-a-consistent-way-using-react\n\t * @default undefined\n\t */\n\tTrailingIcon?: React.FunctionComponent<React.SVGAttributes<SVGElement>>;\n\t/**\n\t * The right icon id,\n\t * @default trailing-icon\n\t */\n\ttrailingIconId?: string;\n\t/**\n\t * The right icon on click event, defaults to () => {}\n\t */\n\tonTrailingIconClicked?: MouseEventHandler<HTMLButtonElement>;\n\t/**\n\t * Tooltip props for the trailing icon\n\t * @default undefined\n\t */\n\ttrailingIconTooltip?: Omit<TooltipProps, 'children'>;\n\n\t/**\n\t * The icon component that is to the left of the text\n\t * Referred to https://ozzie.sh/passing-icons-as-props-in-a-consistent-way-using-react\n\t * @default undefined\n\t */\n\tLeadingIcon?: React.FunctionComponent<React.SVGAttributes<SVGElement>>;\n\t/**\n\t * The right icon on click event, defaults to () => {}\n\t */\n\tonLeadingIconClicked?: MouseEventHandler<HTMLButtonElement>;\n\t/**\n\t * The left icon id,\n\t * @default leading-icon\n\t */\n\tleadingIconId?: string;\n\t/**\n\t * Tooltip props for the leading icon\n\t * @default undefined\n\t */\n\tleadingIconTooltip?: Omit<TooltipProps, 'children'>;\n\n\ttagText: string | number;\n\tversion?: '1.0' | '2.0' | '3.0';\n\t/** Custom CSS padding string, e.g. '4px 8px' */\n\tpadding?: string;\n\t/** Custom height in px */\n\theight?: number;\n\tcursor?: string;\n\talignIcon?: string;\n\tnoBorder?: boolean;\n\ttagHtmlText?: JSX.Element;\n\tcontentPadding?: number;\n\ttagColor?: string;\n\tnumberOfLines?: number;\n\t/**\n\t * Override the computed background color of the tag container.\n\t * @default undefined (uses theme/type color)\n\t */\n\tbackgroundColor?: string;\n\t/**\n\t * Override the border-radius of the tag container.\n\t * @default undefined (uses variant-based radius: 4px for regular, 12px otherwise)\n\t */\n\tborderRadius?: string | number;\n\t/**\n\t * Controls the size of the tag. 'small' sets height to 16px and uses tiny font.\n\t * @default 'regular'\n\t */\n\tsize?: 'regular' | 'small';\n\t/**\n\t * Background color on hover.\n\t * @default undefined (no hover effect)\n\t */\n\thoverBackgroundColor?: string;\n}\n"],"names":["ValidTagTypeMap"],"mappings":"AAmBO,MAAMA,IAAkB;AAAA,EAC9B,SAAS;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,IACV,SAAS;AAAA,IACT,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,IAAI;AAAA,EAAA;AAAA,EAEL,QAAQ;AAAA,IACP,UAAU;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM;AAAA,IACN,MAAM;AAAA,IACN,IAAI;AAAA,EAAA;AAAA,EAEL,YAAY;AAAA,IACX,UAAU;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,IACV,SAAS;AAAA,IACT,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,IAAI;AAAA,EAAA;AAEN;"}
|
|
@@ -48,5 +48,5 @@ interface ExtensionConfig {
|
|
|
48
48
|
renderSlashCommandItem?: (item: SlashCommandItem, isActive: boolean) => ReactNode;
|
|
49
49
|
renderSlashCommandDropdown?: (props: SlashCommandDropdownRenderProps) => ReactNode;
|
|
50
50
|
}
|
|
51
|
-
export declare function buildExtensions(config: ExtensionConfig): (import('@tiptap/core').Extension<import('./characterLimit/CharacterLimitExtension').CharacterLimitOptions, any> | import('@tiptap/core').Node<
|
|
51
|
+
export declare function buildExtensions(config: ExtensionConfig): (import('@tiptap/core').Extension<import('./characterLimit/CharacterLimitExtension').CharacterLimitOptions, any> | import('@tiptap/core').Node<any, any> | import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Node<import('@tiptap/extension-mention').MentionOptions<any, import('@tiptap/extension-mention').MentionNodeAttrs>, any> | import('@tiptap/core').Extension<import('@tiptap/starter-kit').StarterKitOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extensions').PlaceholderOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extensions').CharacterCountOptions, import('@tiptap/extensions').CharacterCountStorage> | import('@tiptap/core').Node<import('@tiptap/extension-paragraph').ParagraphOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-hard-break').HardBreakOptions, any> | import('@tiptap/core').Mark<import('@tiptap/extension-underline').UnderlineOptions, any> | import('@tiptap/core').Mark<import('@tiptap/extension-link').LinkOptions, any> | import('@tiptap/core').Mark<import('@tiptap/extension-text-style').TextStyleOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-text-style').ColorOptions, any> | import('@tiptap/core').Mark<import('@tiptap/extension-highlight').HighlightOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-text-align').TextAlignOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-image').ImageOptions, any>)[];
|
|
52
52
|
export {};
|
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
import s from "@tiptap/extension-character-count";
|
|
2
2
|
import i from "@tiptap/extension-color";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import S from "@tiptap/extension-font-family";
|
|
4
|
+
import k from "@tiptap/extension-hard-break";
|
|
5
|
+
import M from "@tiptap/extension-highlight";
|
|
6
6
|
import b from "@tiptap/extension-image";
|
|
7
7
|
import C from "@tiptap/extension-link";
|
|
8
|
-
import
|
|
8
|
+
import E from "../../node_modules/@tiptap/extension-paragraph/dist/index.js";
|
|
9
9
|
import l from "@tiptap/extension-placeholder";
|
|
10
|
-
import
|
|
10
|
+
import y from "@tiptap/extension-subscript";
|
|
11
11
|
import T from "@tiptap/extension-superscript";
|
|
12
|
-
import
|
|
13
|
-
import { TextStyle as
|
|
14
|
-
import
|
|
12
|
+
import L from "@tiptap/extension-text-align";
|
|
13
|
+
import { TextStyle as P } from "@tiptap/extension-text-style";
|
|
14
|
+
import H from "@tiptap/extension-underline";
|
|
15
15
|
import m from "@tiptap/starter-kit";
|
|
16
|
-
import { isAllowedLinkUrl as
|
|
17
|
-
import { CharacterLimitExtension as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { SectionDividerNode as K } from "./sectionDivider/SectionDividerNode.js";
|
|
16
|
+
import { isAllowedLinkUrl as w } from "../../helpers/sanitize.js";
|
|
17
|
+
import { CharacterLimitExtension as A } from "./characterLimit/CharacterLimitExtension.js";
|
|
18
|
+
import { FontSizeExtension as D } from "./FontSizeExtension.js";
|
|
19
|
+
import { HtmlTagStripExtension as I } from "./htmlTagStrip/HtmlTagStripExtension.js";
|
|
20
|
+
import { JsonHighlightExtension as g } from "./jsonHighlight/JsonHighlightExtension.js";
|
|
21
|
+
import { buildAgentMentionExtension as B, buildTeamMentionExtension as O } from "./mention/MentionExtension.js";
|
|
22
|
+
import { PasteExtension as R } from "./paste/PasteExtension.js";
|
|
23
|
+
import { PasteNormalizationExtension as z } from "./plainClipboard/PasteNormalizationExtension.js";
|
|
24
|
+
import { SectionDividerNode as F } from "./sectionDivider/SectionDividerNode.js";
|
|
26
25
|
import { SendShortcutExtension as d } from "./sendShortcut/SendShortcutExtension.js";
|
|
27
|
-
import { buildSlashCommandExtension as
|
|
28
|
-
import { VariableDecorationExtension as
|
|
29
|
-
function
|
|
26
|
+
import { buildSlashCommandExtension as U } from "./slashCommand/SlashCommandExtension.js";
|
|
27
|
+
import { VariableDecorationExtension as K } from "./variable/VariableDecorationExtension.js";
|
|
28
|
+
function he(e) {
|
|
30
29
|
if (e.features?.jsonMode)
|
|
31
30
|
return [
|
|
32
31
|
m.configure({
|
|
@@ -49,7 +48,7 @@ function xe(e) {
|
|
|
49
48
|
|
|
50
49
|
}`
|
|
51
50
|
}),
|
|
52
|
-
|
|
51
|
+
g,
|
|
53
52
|
d.configure({
|
|
54
53
|
onSend: e.onSend,
|
|
55
54
|
sendShortcut: e.sendShortcut,
|
|
@@ -57,13 +56,13 @@ function xe(e) {
|
|
|
57
56
|
}),
|
|
58
57
|
...e.maxCharacters ? [s.configure({ limit: e.maxCharacters })] : []
|
|
59
58
|
];
|
|
60
|
-
const o = e.features?.richPaste ?? !1, p = e.features?.richTypography ?? !1, n = e.features?.allowedMarks, t = (r) => !n || n.includes(r), u =
|
|
59
|
+
const o = e.features?.richPaste ?? !1, p = e.features?.richTypography ?? !1, n = e.features?.allowedMarks, t = (r) => !n || n.includes(r), u = k.extend({
|
|
61
60
|
addKeyboardShortcuts() {
|
|
62
61
|
return {
|
|
63
62
|
"Shift-Enter": () => this.editor.commands.setHardBreak()
|
|
64
63
|
};
|
|
65
64
|
}
|
|
66
|
-
}), a = (r) => r === "0" || r === "0px" || r === "0pt" || r === "0em", h =
|
|
65
|
+
}), a = (r) => r === "0" || r === "0px" || r === "0pt" || r === "0em", h = E.extend({
|
|
67
66
|
addAttributes() {
|
|
68
67
|
return {
|
|
69
68
|
...this.parent?.() ?? {},
|
|
@@ -90,7 +89,7 @@ function xe(e) {
|
|
|
90
89
|
}),
|
|
91
90
|
h,
|
|
92
91
|
u,
|
|
93
|
-
...t("underline") ? [
|
|
92
|
+
...t("underline") ? [H] : [],
|
|
94
93
|
// Extend Link to strip addPasteRules() and addInputRules() so pasting a
|
|
95
94
|
// URL never creates a hyperlink regardless of autolink/linkOnPaste values.
|
|
96
95
|
C.extend({
|
|
@@ -102,21 +101,21 @@ function xe(e) {
|
|
|
102
101
|
linkOnPaste: !1,
|
|
103
102
|
// Block javascript:/data:/vbscript: hrefs. TipTap keeps the href
|
|
104
103
|
// attribute verbatim, so scheme validation must live here.
|
|
105
|
-
isAllowedUri: (r) =>
|
|
104
|
+
isAllowedUri: (r) => w(r),
|
|
106
105
|
HTMLAttributes: {
|
|
107
106
|
rel: "noopener noreferrer",
|
|
108
107
|
class: "bik-link"
|
|
109
108
|
}
|
|
110
109
|
}),
|
|
111
|
-
|
|
110
|
+
P,
|
|
112
111
|
l.configure({
|
|
113
112
|
placeholder: e.placeholder ?? "Type a message..."
|
|
114
113
|
}),
|
|
115
114
|
// Consumer paste callback runs first. If it returns true the event is
|
|
116
115
|
// consumed and neither PlainClipboardExtension nor the editor's default
|
|
117
116
|
// paste handling will run for that event.
|
|
118
|
-
...e.onPaste ? [
|
|
119
|
-
|
|
117
|
+
...e.onPaste ? [R.configure({ onPaste: e.onPaste })] : [],
|
|
118
|
+
z.configure({
|
|
120
119
|
preserveMarks: o,
|
|
121
120
|
// Only email + signature (richPaste) keep the rich HTML paste pipeline.
|
|
122
121
|
// Every other channel (WhatsApp, IG, FB, comments) forces plain-text
|
|
@@ -128,15 +127,15 @@ function xe(e) {
|
|
|
128
127
|
sendShortcut: e.sendShortcut,
|
|
129
128
|
extraShortcuts: e.shortcuts ?? []
|
|
130
129
|
}),
|
|
131
|
-
|
|
130
|
+
K,
|
|
132
131
|
// Strip HTML tags from typed text.
|
|
133
132
|
// Non-email (WhatsApp, IG, private note): strip ALL tags.
|
|
134
133
|
// Email (richPaste): strip only dangerous tags (script, iframe, form, etc.)
|
|
135
134
|
// while preserving legitimate email tags (h1, table, div, etc.).
|
|
136
|
-
|
|
135
|
+
I.configure({ stripAll: !o }),
|
|
137
136
|
...e.maxCharacters ? [s.configure({ limit: e.maxCharacters })] : [],
|
|
138
137
|
...e.characterLimit ? [
|
|
139
|
-
|
|
138
|
+
A.configure({
|
|
140
139
|
limit: e.characterLimit,
|
|
141
140
|
hard: e.characterLimitHard
|
|
142
141
|
})
|
|
@@ -145,10 +144,10 @@ function xe(e) {
|
|
|
145
144
|
// node is part of the schema in every editor instance. This means imperative
|
|
146
145
|
// callers (setBodyAndSections / setSectionContent) work even when no
|
|
147
146
|
// `sections` prop was provided at mount time.
|
|
148
|
-
|
|
147
|
+
F
|
|
149
148
|
], f = [
|
|
150
149
|
...e.mentions?.agents ? [
|
|
151
|
-
|
|
150
|
+
B(
|
|
152
151
|
e.mentions.agents,
|
|
153
152
|
e.onMentionSelected,
|
|
154
153
|
e.renderMentionItem,
|
|
@@ -158,7 +157,7 @@ function xe(e) {
|
|
|
158
157
|
)
|
|
159
158
|
] : [],
|
|
160
159
|
...e.mentions?.teams ? [
|
|
161
|
-
|
|
160
|
+
O(
|
|
162
161
|
e.mentions.teams,
|
|
163
162
|
e.onMentionSelected,
|
|
164
163
|
e.renderMentionItem,
|
|
@@ -167,7 +166,7 @@ function xe(e) {
|
|
|
167
166
|
)
|
|
168
167
|
] : [],
|
|
169
168
|
...e.slashCommands ? [
|
|
170
|
-
|
|
169
|
+
U(
|
|
171
170
|
e.slashCommands,
|
|
172
171
|
e.onSlashCommandSelected,
|
|
173
172
|
e.renderSlashCommandItem,
|
|
@@ -176,22 +175,17 @@ function xe(e) {
|
|
|
176
175
|
] : []
|
|
177
176
|
], x = p ? [
|
|
178
177
|
i,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
178
|
+
M.configure({ multicolor: !0 }),
|
|
179
|
+
S,
|
|
180
|
+
D,
|
|
181
|
+
L.configure({ types: ["heading", "paragraph"] }),
|
|
182
|
+
y,
|
|
184
183
|
T,
|
|
185
184
|
b
|
|
186
|
-
] : [i]
|
|
187
|
-
return [
|
|
188
|
-
...c,
|
|
189
|
-
...f,
|
|
190
|
-
...x,
|
|
191
|
-
...S
|
|
192
|
-
];
|
|
185
|
+
] : [i];
|
|
186
|
+
return [...c, ...f, ...x];
|
|
193
187
|
}
|
|
194
188
|
export {
|
|
195
|
-
|
|
189
|
+
he as buildExtensions
|
|
196
190
|
};
|
|
197
191
|
//# sourceMappingURL=buildExtensions.js.map
|