@luscii-healthtech/web-ui 58.2.5 → 58.3.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/index.development.js +28 -0
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/components/InstrumentCard/InstrumentCard.d.ts +99 -0
- package/dist/src/generated/components/InstrumentCard/InstrumentCard.d.ts +99 -0
- package/dist/src/generated/index.d.ts +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/stories/InstrumentCard.stories.d.ts +43 -0
- package/dist/web-ui-tailwind.css +18 -0
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -5050,6 +5050,33 @@ const MediaPicker = React__namespace.default.forwardRef((props, ref) => {
|
|
|
5050
5050
|
|
|
5051
5051
|
const TagGroup = ({ children, tags, tagSize = "large", className }) => jsxRuntime.jsxs("div", { className: classNames__default.default("ui:flex ui:flex-row ui:flex-wrap ui:gap-2", className), children: [children, tags === null || tags === void 0 ? void 0 : tags.map((tag) => jsxRuntime.jsx(Tag, Object.assign({ _size: tagSize }, tag)))] });
|
|
5052
5052
|
|
|
5053
|
+
const typeIcons = {
|
|
5054
|
+
info: BookOpenIcon,
|
|
5055
|
+
questionnaire: ClipboardListIcon,
|
|
5056
|
+
numeric: HashIcon,
|
|
5057
|
+
document: DocumentLinesIcon,
|
|
5058
|
+
contact: PersonIcon,
|
|
5059
|
+
other: CircleEllipsisIcon,
|
|
5060
|
+
scripted: SigmaSquareIcon,
|
|
5061
|
+
sum: SigmaSquareIcon
|
|
5062
|
+
};
|
|
5063
|
+
const InstrumentCard = ({ type, title, category, meta, id, count, variant = "compact", state = "default", errorMessage, className }) => {
|
|
5064
|
+
const isDetailed = variant === "detailed";
|
|
5065
|
+
const isError = state === "error";
|
|
5066
|
+
const TypeIcon = isError ? ExclamationMarkIcon : typeIcons[type];
|
|
5067
|
+
const textColor = isError ? "error" : "neutral";
|
|
5068
|
+
if (!isDetailed) {
|
|
5069
|
+
return jsxRuntime.jsxs(Stack, { axis: "x", align: "center", _gap: "base", _py: "base", _pl: "base", _pr: "m", className: classNames__default.default("ui:inline-flex ui:bg-background-neutral-primary-default ui:[border-radius:var(--ui-semantic-radius-m)]", className), children: [jsxRuntime.jsx(TypeIcon, { "aria-hidden": true, width: 14, height: 14, className: classNames__default.default("ui:shrink-0", {
|
|
5070
|
+
"ui:text-icon-error-primary-default": isError,
|
|
5071
|
+
"ui:text-icon-brand-primary-default": !isError
|
|
5072
|
+
}) }), jsxRuntime.jsx(Text, { variant: "body-small-regular", color: textColor, children: isError ? errorMessage : title })] });
|
|
5073
|
+
}
|
|
5074
|
+
return jsxRuntime.jsxs(Stack, { axis: "x", align: "start", justify: "between", width: "full", _py: "m", _pl: "m", _pr: "base", className: classNames__default.default("ui:bg-background-neutral-primary-default ui:[border-radius:var(--ui-semantic-radius-m)]", className), children: [jsxRuntime.jsxs(Stack, { axis: "x", _gap: "base", className: "ui:min-w-0 ui:flex-1", children: [jsxRuntime.jsx(Box, { _py: "xs", className: "ui:shrink-0", children: jsxRuntime.jsx(TypeIcon, { "aria-hidden": true, width: 16, height: 16, className: classNames__default.default({
|
|
5075
|
+
"ui:text-icon-error-primary-default": isError,
|
|
5076
|
+
"ui:text-icon-brand-primary-default": !isError
|
|
5077
|
+
}) }) }), jsxRuntime.jsxs(Stack, { _gap: "base", className: "ui:min-w-0 ui:flex-1", children: [jsxRuntime.jsx(Text, { variant: "body-medium-regular", color: textColor, truncate: true, className: "ui:min-w-0", children: title }), isError && jsxRuntime.jsx(Text, { variant: "body-small-regular", color: "error", children: errorMessage }), !isError && (category || meta) && jsxRuntime.jsxs(Stack, { axis: "x", align: "center", children: [category && jsxRuntime.jsx(Text, { variant: "body-small-regular", color: "neutral", children: category }), category && meta && jsxRuntime.jsx(Box, { _mx: "base", className: "ui:h-[12px] ui:w-px ui:shrink-0 ui:bg-border-neutral-primary-default" }), meta && jsxRuntime.jsx(Text, { variant: "body-small-regular", color: "neutral", children: meta })] }), id && jsxRuntime.jsx(Tag, { _size: "small", _variant: "bordered", _leadingIcon: jsxRuntime.jsx(CopyToClipboardIcon, { "aria-hidden": true }), children: id })] })] }), count !== void 0 && jsxRuntime.jsx(Tag, { _size: "small", _variant: "flat", _leadingIcon: jsxRuntime.jsx(CopyToClipboardIcon, { "aria-hidden": true }), className: "ui:shrink-0", children: jsxRuntime.jsx(Text, { variant: "body-small-bold", as: "span", children: count }) })] });
|
|
5078
|
+
};
|
|
5079
|
+
|
|
5053
5080
|
var css_248z$1 = "/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */\n.cweb-textarea {\n resize: none;\n background-color: field;\n}\n.cweb-textarea.has-icon {\n background-size: 24px;\n background-position: 10px 10px;\n background-repeat: no-repeat;\n padding-left: 44px;\n}\n.cweb-textarea.resizable {\n resize: both;\n}\n.cweb-textarea.resizable-x {\n resize: horizontal;\n}\n.cweb-textarea.resizable-y {\n resize: vertical;\n}\n.cweb-textarea:focus {\n border-color: var(--color-primary);\n}\n.cweb-textarea:disabled {\n cursor: not-allowed;\n}\n.cweb-textarea.has-error {\n border: 1px solid #b91c1c;\n color: #991b1b;\n}";
|
|
5054
5081
|
styleInject(css_248z$1);
|
|
5055
5082
|
|
|
@@ -7288,6 +7315,7 @@ exports.InfoField = InfoField;
|
|
|
7288
7315
|
exports.InfoIcon = InfoIcon;
|
|
7289
7316
|
exports.Input = Input;
|
|
7290
7317
|
exports.InputSelect = InputSelectWithSubComponents;
|
|
7318
|
+
exports.InstrumentCard = InstrumentCard;
|
|
7291
7319
|
exports.LabelText = LabelText;
|
|
7292
7320
|
exports.LabeledCheckbox = LabeledCheckbox;
|
|
7293
7321
|
exports.LabeledCheckboxCard = LabeledCheckboxCard;
|