@luscii-healthtech/web-ui 35.8.1 → 35.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/dist/components/Tag/Tag.d.ts +2 -1
- package/dist/index.development.js +42 -9
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/web-ui-tailwind.css +403 -54
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ interface TagPropsShared extends React.ComponentPropsWithoutRef<"span"> {
|
|
|
5
5
|
colorTheme?: Color;
|
|
6
6
|
size?: Size;
|
|
7
7
|
variant?: "flat" | "bordered";
|
|
8
|
+
showIcon?: boolean;
|
|
8
9
|
/**
|
|
9
10
|
* Truncate the text if it overflows the tag.
|
|
10
11
|
*/
|
|
@@ -26,5 +27,5 @@ interface PropsWithText extends TagPropsShared {
|
|
|
26
27
|
text: string;
|
|
27
28
|
}
|
|
28
29
|
export type Props = PropsWithChildren | PropsWithText;
|
|
29
|
-
export declare const Tag: ({ text, colorTheme, className, size, variant, truncate, children, ...rest }: Props) => React.JSX.Element;
|
|
30
|
+
export declare const Tag: ({ text, colorTheme, className, size, variant, showIcon, truncate, children, ...rest }: Props) => React.JSX.Element;
|
|
30
31
|
export {};
|
|
@@ -2278,15 +2278,31 @@ const Modal = (props) => {
|
|
|
2278
2278
|
Modal.setAppElement = ReactModal__default.default.setAppElement;
|
|
2279
2279
|
|
|
2280
2280
|
const Tag = (_a) => {
|
|
2281
|
-
var { text, colorTheme = "gray", className, size = "base", variant = "flat", truncate, children } = _a, rest = __rest(_a, ["text", "colorTheme", "className", "size", "variant", "truncate", "children"]);
|
|
2281
|
+
var { text, colorTheme = "gray", className, size = "base", variant = "flat", showIcon, truncate, children } = _a, rest = __rest(_a, ["text", "colorTheme", "className", "size", "variant", "showIcon", "truncate", "children"]);
|
|
2282
|
+
const isBordered = variant === "bordered" || "";
|
|
2282
2283
|
return React__namespace.default.createElement(
|
|
2283
|
-
|
|
2284
|
-
Object.assign({ className: classNames__default.default("ui-inline-flex ui-items-center ui-rounded-lg ui-px-2 ui-py-1", { "overflow-hidden": truncate }, className, {
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
"
|
|
2289
|
-
|
|
2284
|
+
Stack,
|
|
2285
|
+
Object.assign({ axis: "x", gap: "xxxxs", className: classNames__default.default("ui-inline-flex ui-items-center ui-rounded-lg ui-px-2 ui-py-1", { "overflow-hidden": truncate }, className, {
|
|
2286
|
+
[[
|
|
2287
|
+
"ui-bg-negative-background ui-text-on-negative",
|
|
2288
|
+
isBordered && "ui-border-negative-border"
|
|
2289
|
+
].join(" ")]: colorTheme === "red",
|
|
2290
|
+
[[
|
|
2291
|
+
"ui-bg-warning-background ui-text-on-warning",
|
|
2292
|
+
isBordered && "ui-border-warning-border"
|
|
2293
|
+
].join(" ")]: colorTheme === "amber",
|
|
2294
|
+
[[
|
|
2295
|
+
"ui-bg-positive-background ui-text-on-positive",
|
|
2296
|
+
isBordered && "ui-border-positive-border"
|
|
2297
|
+
].join(" ")]: colorTheme === "green",
|
|
2298
|
+
[[
|
|
2299
|
+
"ui-bg-neutral-background ui-text-on-surface",
|
|
2300
|
+
isBordered && "ui-border-neutral-border-high-contrast"
|
|
2301
|
+
].join(" ")]: colorTheme === "gray",
|
|
2302
|
+
[[
|
|
2303
|
+
"ui-bg-primary-background ui-text-primary",
|
|
2304
|
+
isBordered && "ui-border-primary-border"
|
|
2305
|
+
].join(" ")]: colorTheme === "blue"
|
|
2290
2306
|
}, {
|
|
2291
2307
|
/**
|
|
2292
2308
|
* Adding a border adds it to the outside of an element. This means that the border will
|
|
@@ -2294,8 +2310,9 @@ const Tag = (_a) => {
|
|
|
2294
2310
|
* variants have the same dimensions, we need to adjust the padding to account for
|
|
2295
2311
|
* the border width.
|
|
2296
2312
|
*/
|
|
2297
|
-
"ui-border ui-
|
|
2313
|
+
"ui-border ui-px-[calc(theme('spacing.2')-1px)] ui-py-[calc(theme('spacing.1')-1px)]": variant === "bordered"
|
|
2298
2314
|
}) }, rest),
|
|
2315
|
+
showIcon && React__namespace.default.createElement(TagIcon, { colorTheme, size }),
|
|
2299
2316
|
React__namespace.default.createElement(
|
|
2300
2317
|
Text,
|
|
2301
2318
|
{
|
|
@@ -2311,6 +2328,22 @@ const Tag = (_a) => {
|
|
|
2311
2328
|
)
|
|
2312
2329
|
);
|
|
2313
2330
|
};
|
|
2331
|
+
function TagIcon({ colorTheme, size }) {
|
|
2332
|
+
const sizeClass = classNames__default.default({ "ui-h-[16px] ui-w-[16px]": size === "small" });
|
|
2333
|
+
const props = { size: "s" };
|
|
2334
|
+
switch (colorTheme) {
|
|
2335
|
+
case "red":
|
|
2336
|
+
return React__namespace.default.createElement(SmallCircleIcon, Object.assign({}, props, { className: sizeClass }));
|
|
2337
|
+
case "amber":
|
|
2338
|
+
return React__namespace.default.createElement(SmallSquareIcon, Object.assign({}, props, { className: sizeClass }));
|
|
2339
|
+
case "green":
|
|
2340
|
+
return React__namespace.default.createElement(SmallArrowUpIcon, Object.assign({}, props, { className: classNames__default.default(sizeClass, "ui-rotate-90") }));
|
|
2341
|
+
case "gray":
|
|
2342
|
+
return React__namespace.default.createElement(SmallDiamondIcon, Object.assign({}, props, { className: classNames__default.default(sizeClass, "ui-text-on-surface-variant") }));
|
|
2343
|
+
case "blue":
|
|
2344
|
+
return React__namespace.default.createElement(SmallArrowUpIcon, Object.assign({}, props, { className: classNames__default.default(sizeClass, "ui-rotate-90") }));
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2314
2347
|
|
|
2315
2348
|
function ChatBubble(props) {
|
|
2316
2349
|
const { as: Component = "div", children, className, sender: _, timestamp: __, readReceipt, color = "blue", tipPosition } = props, rest = __rest(props, ["as", "children", "className", "sender", "timestamp", "readReceipt", "color", "tipPosition"]);
|