@vectara/vectara-ui 13.7.0 → 13.9.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/lib/components/badge/Badge.js +1 -1
- package/lib/components/badge/_index.scss +8 -0
- package/lib/components/flex/_flexItem.scss +2 -0
- package/lib/styles/index.css +8 -0
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/index.js +3 -0
- package/lib/utils/testIdify.d.ts +1 -0
- package/lib/utils/testIdify.js +7 -0
- package/lib/utils/testIdify.test.d.ts +1 -0
- package/lib/utils/testIdify.test.js +12 -0
- package/package.json +1 -1
|
@@ -27,7 +27,7 @@ export const VuiBadge = (_a) => {
|
|
|
27
27
|
const classes = classNames(className, "vuiBadge", `vuiBadge--${color}`, {
|
|
28
28
|
"vuiBadge--clickable": onClick !== null && onClick !== void 0 ? onClick : href
|
|
29
29
|
});
|
|
30
|
-
const content = (_jsxs(VuiFlexContainer, Object.assign({ alignItems: "center", spacing: "xxs" }, { children: [isSelected && (_jsx(VuiFlexItem, { children: _jsx(VuiIcon, Object.assign({ size: "xs", color: "inherit", className: "vuiBadge__icon" }, { children: _jsx(BiCheck, {}) })) })), _jsx(VuiFlexItem, Object.assign({ id: id }, { children: children })), onClose && (_jsx(VuiFlexItem, { children: _jsx(VuiIconButton, { "aria-label": "Remove", "aria-describedby": id, size: "xs", color: "subdued", className: "vuiBadge__icon", onClick: (e) => {
|
|
30
|
+
const content = (_jsxs(VuiFlexContainer, Object.assign({ alignItems: "center", spacing: "xxs" }, { children: [isSelected && (_jsx(VuiFlexItem, { children: _jsx(VuiIcon, Object.assign({ size: "xs", color: "inherit", className: "vuiBadge__icon" }, { children: _jsx(BiCheck, {}) })) })), _jsx(VuiFlexItem, Object.assign({ id: id }, { children: _jsx("div", Object.assign({ className: "vuiBadge__content" }, { children: children })) })), onClose && (_jsx(VuiFlexItem, { children: _jsx(VuiIconButton, { "aria-label": "Remove", "aria-describedby": id, size: "xs", color: "subdued", className: "vuiBadge__icon", onClick: (e) => {
|
|
31
31
|
e.stopPropagation();
|
|
32
32
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
33
33
|
}, icon: _jsx(VuiIcon, Object.assign({ size: "xs" }, { children: _jsx(BiX, {}) })) }) }))] })));
|
|
@@ -20,6 +20,14 @@
|
|
|
20
20
|
height: min-content !important;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
.vuiBadge__content {
|
|
24
|
+
// text-overflow doesn't work on flexbox elements.
|
|
25
|
+
display: block;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
text-overflow: ellipsis;
|
|
29
|
+
}
|
|
30
|
+
|
|
23
31
|
// Color
|
|
24
32
|
$color: (
|
|
25
33
|
accent: (
|
package/lib/styles/index.css
CHANGED
|
@@ -574,6 +574,13 @@ fieldset {
|
|
|
574
574
|
height: min-content !important;
|
|
575
575
|
}
|
|
576
576
|
|
|
577
|
+
.vuiBadge__content {
|
|
578
|
+
display: block;
|
|
579
|
+
overflow: hidden;
|
|
580
|
+
white-space: nowrap;
|
|
581
|
+
text-overflow: ellipsis;
|
|
582
|
+
}
|
|
583
|
+
|
|
577
584
|
.vuiBadge--accent {
|
|
578
585
|
color: var(--vui-color-accent-shade) !important;
|
|
579
586
|
background-color: rgba(var(--vui-color-accent-shade-rgb), 0.1);
|
|
@@ -2476,6 +2483,7 @@ h2.react-datepicker__current-month {
|
|
|
2476
2483
|
display: flex;
|
|
2477
2484
|
flex-direction: column;
|
|
2478
2485
|
align-items: flex-start;
|
|
2486
|
+
min-width: 0;
|
|
2479
2487
|
}
|
|
2480
2488
|
|
|
2481
2489
|
.vuiFlexItem--truncate {
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const testIdify: (str?: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { testIdify } from "./testIdify";
|
|
2
|
+
describe("testIdify", () => {
|
|
3
|
+
test("replaces spaces with dashes", () => {
|
|
4
|
+
expect(testIdify("selectPromptTemplateButton-Custom prompt template-1.0")).toBe("selectPromptTemplateButton-Custom-prompt-template-1-0");
|
|
5
|
+
});
|
|
6
|
+
test("replaces @ . and + with dashes", () => {
|
|
7
|
+
expect(testIdify("user@example.com+tag")).toBe("user-example-com-tag");
|
|
8
|
+
});
|
|
9
|
+
test("handles multiple special characters", () => {
|
|
10
|
+
expect(testIdify("prompt@vectara.com + settings")).toBe("prompt-vectara-com---settings");
|
|
11
|
+
});
|
|
12
|
+
});
|